Author: alessio.soldano(a)jboss.com
Date: 2013-01-25 13:19:52 -0500 (Fri, 25 Jan 2013)
New Revision: 17258
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/CXFClientConfigurationTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/Helper.java
Log:
[JBWS-3592] Adding testcase
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/CXFClientConfigurationTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/CXFClientConfigurationTestCase.java 2013-01-25
18:19:15 UTC (rev 17257)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/CXFClientConfigurationTestCase.java 2013-01-25
18:19:52 UTC (rev 17258)
@@ -56,6 +56,14 @@
assertEquals("1",
runTestInContainer("testCustomClientConfigurationFromFile"));
}
+ public void testCustomClientConfigurationFromFileUsingFeature() throws Exception {
+ assertTrue(getHelper().testCustomClientConfigurationFromFileUsingFeature());
+ }
+
+ public void testCustomClientConfigurationFromFileUsingFeatureInContainer() throws
Exception {
+ assertEquals("1",
runTestInContainer("testCustomClientConfigurationFromFileUsingFeature"));
+ }
+
/**
* Verifies a client configuration can be changed after another one has been set
*
@@ -89,6 +97,10 @@
assertEquals("1",
runTestInContainer("testCustomClientConfiguration"));
}
+ public void testCustomClientConfigurationUsingFeatureInContainer() throws Exception {
+ assertEquals("1",
runTestInContainer("testCustomClientConfigurationUsingFeature"));
+ }
+
// -------------------------
private Helper getHelper() {
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/Helper.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/Helper.java 2013-01-25
18:19:15 UTC (rev 17257)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/Helper.java 2013-01-25
18:19:52 UTC (rev 17258)
@@ -27,6 +27,7 @@
import javax.xml.ws.Service;
import org.apache.cxf.frontend.ClientProxy;
+import org.jboss.ws.api.configuration.ClientConfigFeature;
import org.jboss.ws.api.configuration.ClientConfigUtil;
import org.jboss.ws.api.configuration.ClientConfigurer;
import org.jboss.wsf.test.ClientHelper;
@@ -52,6 +53,14 @@
return
ClientProxy.getClient(port).getEndpoint().get("propA").equals("fileValueA");
}
+ public boolean testCustomClientConfigurationFromFileUsingFeature() throws Exception
+ {
+ Service service = Service.create(new URL(address + "?wsdl"),
serviceName);
+ Endpoint port = (Endpoint)service.getPort(Endpoint.class, new
ClientConfigFeature("META-INF/jaxws-client-config.xml", "Custom Client
Config", true));
+
+ return
ClientProxy.getClient(port).getEndpoint().get("propA").equals("fileValueA");
+ }
+
public boolean testConfigurationChange() throws Exception
{
Service service = Service.create(new URL(address + "?wsdl"),
serviceName);
@@ -139,6 +148,31 @@
}
}
+ public boolean testCustomClientConfigurationUsingFeature() throws Exception
+ {
+ final URL wsdlURL = new URL(address + "?wsdl");
+ final String testConfigName = "MyTestConfig";
+ try
+ {
+ //-- add test client configuration
+ TestUtils.addTestCaseClientConfiguration(testConfigName);
+ // --
+
+ Service service = Service.create(wsdlURL, serviceName);
+ Endpoint port = (Endpoint)service.getPort(Endpoint.class, new
ClientConfigFeature(null, testConfigName, true));
+ org.apache.cxf.endpoint.Endpoint ep =
ClientProxy.getClient(port).getEndpoint();
+ ep.put("propZ", "valueZ");
+
+ return (ep.get("propT").equals("valueT") &&
ep.get("propZ").equals("valueZ"));
+ }
+ finally
+ {
+ // -- remove test client configuration --
+ TestUtils.removeTestCaseClientConfiguration(testConfigName);
+ // --
+ }
+ }
+
@Override
public void setTargetEndpoint(String address)
{
Show replies by date