Author: asoldano
Date: 2014-03-26 13:09:02 -0400 (Wed, 26 Mar 2014)
New Revision: 18543
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3060/JBWS3060Tests.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2934/AbstractTestCase.java
Log:
Few minor changes to prevent possible concurrency issues in the testsuite
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3060/JBWS3060Tests.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3060/JBWS3060Tests.java 2014-03-26
16:35:00 UTC (rev 18542)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3060/JBWS3060Tests.java 2014-03-26
17:09:02 UTC (rev 18543)
@@ -116,9 +116,9 @@
private static class CallableOne implements Callable<Boolean>
{
- private EndpointOne port;
- private boolean oneway;
- private int seqNum;
+ private final EndpointOne port;
+ private final boolean oneway;
+ private final int seqNum;
public CallableOne(EndpointOne port, boolean oneway, int seqNum)
{
@@ -145,9 +145,9 @@
private static class CallableTwo implements Callable<Boolean>
{
- private EndpointTwo port;
- private boolean oneway;
- private int seqNum;
+ private final EndpointTwo port;
+ private final boolean oneway;
+ private final int seqNum;
public CallableTwo(EndpointTwo port, boolean oneway, int seqNum)
{
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2934/AbstractTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2934/AbstractTestCase.java 2014-03-26
16:35:00 UTC (rev 18542)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2934/AbstractTestCase.java 2014-03-26
17:09:02 UTC (rev 18543)
@@ -55,8 +55,12 @@
URL wsdlURL = new URL(getEndpointAddress() + "?wsdl");
Service service = Service.create(wsdlURL, serviceName);
- for (int i = 0; i < THREADS_COUNT; i++)
+ for (int i = 0; i < THREADS_COUNT; i++) {
proxies[i] = service.getPort(Endpoint.class);
+ //Make the request context threadsafe as we'll be setting the
ENDPOINT_ADDRESS_PROPERTY in it;
+ //see
http://cxf.apache.org/faq.html#FAQ-AreJAX-WSclientproxiesthreadsafe? for
more details
+
((BindingProvider)proxies[i]).getRequestContext().put("thread.local.request.context",
"true");
+ }
}
public void testEndpointConcurrently() throws Exception
@@ -92,7 +96,7 @@
private final String jobName;
private final Endpoint proxy;
private final int countOfRequests;
- private Exception exception;
+ private volatile Exception exception;
private final String endpointAddress;
private static final Logger log = Logger.getLogger(TestJob.class);