Skip to content

Commit

Permalink
[JBWS-3947] Run prepare once per thread
Browse files Browse the repository at this point in the history
  • Loading branch information
asoldano committed Sep 14, 2015
1 parent 3b6c07a commit 39adfd7
Showing 1 changed file with 20 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,25 @@

public class JAXWSBenchmark extends AbstractJavaSamplerClient
{
private String endpointURL = "http://" + JBossWSTestHelper.getServerHost() + ":" + JBossWSTestHelper.getServerPort() + "/jaxws-benchmark-basic/EndpointService/EndpointImpl";
private String targetNS = "http://basic.test.benchmark.jaxws.ws.test.jboss.org/";
private final String endpointURL = "http://" + JBossWSTestHelper.getServerHost() + ":" + JBossWSTestHelper.getServerPort() + "/jaxws-benchmark-basic/EndpointService/EndpointImpl";
private final String targetNS = "http://basic.test.benchmark.jaxws.ws.test.jboss.org/";
private Endpoint ep;

@Override
public void setupTest(JavaSamplerContext context) {
super.setupTest(context);
try {
this.ep = prepare();
} catch (Exception e) {
throw new RuntimeException(e);
}
}

@Override
public void teardownTest(JavaSamplerContext context) {
super.teardownTest(context);
this.ep = null;
}

@Override
public SampleResult runTest(JavaSamplerContext ctx)
Expand All @@ -23,11 +40,11 @@ public SampleResult runTest(JavaSamplerContext ctx)
sampleResult.sampleStart();

try {
Endpoint ep = prepare();
performIteration(ep);
sampleResult.setSuccessful(true);
} catch (Exception e) {
//TODO log exception?
sampleResult.setSuccessful(false);
} finally {
sampleResult.sampleEnd();
}
Expand Down

0 comments on commit 39adfd7

Please sign in to comment.