Author: asoldano
Date: 2013-08-28 10:40:15 -0400 (Wed, 28 Aug 2013)
New Revision: 17897
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/JBWS2150TestCaseForked.java
Log:
[JBWS-3699][JBWS-3692] Removing workaround in JBWS2150TestCaseForked and using new feature
instead
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/JBWS2150TestCaseForked.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/JBWS2150TestCaseForked.java 2013-08-28
14:39:10 UTC (rev 17896)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/JBWS2150TestCaseForked.java 2013-08-28
14:40:15 UTC (rev 17897)
@@ -24,6 +24,8 @@
import java.net.URL;
import java.util.Collection;
import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
@@ -37,6 +39,7 @@
import javax.xml.namespace.QName;
import javax.xml.ws.BindingProvider;
import javax.xml.ws.Service;
+import javax.xml.ws.WebServiceFeature;
import junit.framework.Test;
@@ -533,12 +536,6 @@
ServiceIface endpoint = getEndpoint(wsdlLocation, "CodeFirstService");
if (setTargetAddress) {
((BindingProvider)endpoint).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
addr);
- } else {
- //We can end up building multiple clients in the same bus and those clients
might be built against
- //different endpoints that are however published at the same address (at
different time of course).
- //So we explicitly set the BindingProvider.ENDPOINT_ADDRESS_PROPERTY in the req
ctx to the soap:address
- //from the wsdl to prevent caching related issues.
-
((BindingProvider)endpoint).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
address);
}
assertEquals(endpoint.echo("hello"), "hello");
}
@@ -561,7 +558,17 @@
private ServiceIface getEndpoint(String wsdlLocation, String serviceName) throws
Exception
{
- Service service = Service.create(new URL(wsdlLocation), new QName(NAMESPACE,
serviceName));
+ List<WebServiceFeature> features = new
LinkedList<WebServiceFeature>();
+ if (isIntegrationCXF()) {
+ //Setting UseNewBusFeature as the tests here deploy / undeploy endpoints with
different wsdl at the same URL
+ //so we need to avoid caching issues related to the WSDLManager in the CXF Bus.
+
+ //Service service = Service.create(new URL(wsdlLocation), new QName(NAMESPACE,
serviceName), new UseNewBusFeature())
+
+ Class<?> clazz =
Class.forName("org.jboss.wsf.stack.cxf.client.UseNewBusFeature");
+ features.add((WebServiceFeature)clazz.newInstance());
+ }
+ Service service = Service.create(new URL(wsdlLocation), new QName(NAMESPACE,
serviceName), features.toArray(new WebServiceFeature[features.size()]));
QName portName = service.getPorts().next();
return service.getPort(portName, ServiceIface.class);
}
Show replies by date