Author: asoldano
Date: 2014-10-03 12:10:29 -0400 (Fri, 03 Oct 2014)
New Revision: 18970
Added:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/Endpoint2.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/jaxws-client-config.xml
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCaseForked.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/Helper.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/Helper.java
Log:
[JBWS-3836] Improving and extending tests
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCaseForked.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCaseForked.java 2014-10-03
16:09:51 UTC (rev 18969)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCaseForked.java 2014-10-03
16:10:29 UTC (rev 18970)
@@ -60,6 +60,8 @@
.addClass(org.jboss.test.helper.TestServlet.class)
.addClass(org.jboss.test.ws.jaxws.clientConfig.CustomHandler.class)
.addClass(org.jboss.test.ws.jaxws.clientConfig.Endpoint.class)
+ .addClass(org.jboss.test.ws.jaxws.clientConfig.Endpoint2.class)
+
.addAsResource("org/jboss/test/ws/jaxws/clientConfig/jaxws-client-config.xml",
"jaxws-client-config.xml")
.addClass(org.jboss.test.ws.jaxws.clientConfig.Helper.class)
.addClass(org.jboss.test.ws.jaxws.clientConfig.LogHandler.class)
.addClass(org.jboss.test.ws.jaxws.clientConfig.RoutingHandler.class)
@@ -104,10 +106,17 @@
public void testSEIClassDefaultClientConfigurationInContainer() throws Exception {
assertEquals("1",
runTestInContainer("testSEIClassDefaultClientConfiguration"));
}
+ //no corresponding test on Dispatch, as that has no SEI
- public void testSEIClassDefaultClientConfigurationOnDispatchInContainer() throws
Exception {
- assertEquals("1",
runTestInContainer("testSEIClassDefaultClientConfigurationOnDispatch"));
+ /**
+ * Verifies the SEI class FQN client configuration from default conf file
+ *
+ * @throws Exception
+ */
+ public void testSEIClassDefaultFileClientConfigurationInContainer() throws Exception
{
+ assertEquals("1",
runTestInContainer("testSEIClassDefaultFileClientConfiguration"));
}
+ //no corresponding test on Dispatch, as that has no SEI
/**
* Verifies a client configuration from AS model can be set
Added:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/Endpoint2.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/Endpoint2.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/Endpoint2.java 2014-10-03
16:10:29 UTC (rev 18970)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.clientConfig;
+
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+@WebService(name="Endpoint")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+public interface Endpoint2
+{
+ public String echo(String input);
+}
Property changes on:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/Endpoint2.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/Helper.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/Helper.java 2014-10-03
16:09:51 UTC (rev 18969)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/Helper.java 2014-10-03
16:10:29 UTC (rev 18970)
@@ -462,11 +462,20 @@
}
}
- public boolean testSEIClassDefaultClientConfigurationOnDispatch() throws Exception
+ /**
+ * This test hacks the current ServerConfig temporarily adding a test client
configuration
+ * (named as the Endoint SEI class FQN)- Then it calls the sends messages to the same
endpoint,
+ * initially using the Endpoint SEI and then using the Endpoint2 SEI. The two port
proxies are
+ * expected to behave differently because of a default jaxws-client-config.xml
descriptor
+ * including a configuration for Endpoint2 SEI class FQN. The test eventually removes
the test
+ * client configuration from the ServerConfig.
+ *
+ * @return
+ * @throws Exception
+ */
+ public boolean testSEIClassDefaultFileClientConfiguration() throws Exception
{
- final String reqString = "<ns1:echo
xmlns:ns1=\"http://clientConfig.jaxws.ws.test.jboss.org/\">&...;
QName serviceName = new
QName("http://clientConfig.jaxws.ws.test.jboss.org/",
"EndpointImplService");
- QName portName = new
QName("http://clientConfig.jaxws.ws.test.jboss.org/",
"EndpointPort");
URL wsdlURL = new URL(address + "?wsdl");
final String testConfigName =
"org.jboss.test.ws.jaxws.clientConfig.Endpoint";
@@ -477,19 +486,29 @@
// --
Service service = Service.create(wsdlURL, serviceName);
- Dispatch<Source> dispatch = service.createDispatch(portName, Source.class,
Mode.PAYLOAD);
+ Endpoint port = (Endpoint)service.getPort(Endpoint.class);
- BindingProvider bp = (BindingProvider)dispatch;
+ BindingProvider bp = (BindingProvider)port;
@SuppressWarnings("rawtypes")
List<Handler> hc = bp.getBinding().getHandlerChain();
hc.add(new UserHandler());
bp.getBinding().setHandlerChain(hc);
- ClientConfigUtil.setConfigHandlers(bp, null, testConfigName);
+ String resStr = port.echo("Kermit");
+ if (!"Kermit|RoutOut|UserOut|endpoint|UserIn|RoutIn".equals(resStr))
{
+ return false;
+ }
+
+ Endpoint2 port2 = (Endpoint2)service.getPort(Endpoint2.class);
- Source resSource = dispatch.invoke(new DOMSource(DOMUtils.parse(reqString)));
- String resStr =
DOMUtils.getTextContent(DOMUtils.sourceToElement(resSource).getElementsByTagName("return").item(0));
- return
("Kermit|RoutOut|UserOut|endpoint|UserIn|RoutIn".equals(resStr));
+ bp = (BindingProvider)port2;
+ hc = bp.getBinding().getHandlerChain();
+ hc.add(new UserHandler());
+ bp.getBinding().setHandlerChain(hc);
+
+ resStr = port2.echo("Kermit");
+ return
("Kermit|RoutOut|UserOut|LogOut|endpoint|LogIn|UserIn|RoutIn".equals(resStr));
+
}
finally
{
Added:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/jaxws-client-config.xml
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/jaxws-client-config.xml
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/jaxws-client-config.xml 2014-10-03
16:10:29 UTC (rev 18970)
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jaxws-config xmlns="urn:jboss:jbossws-jaxws-config:4.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+ xsi:schemaLocation="urn:jboss:jbossws-jaxws-config:4.0
schema/jbossws-jaxws-config_4_0.xsd">
+
+ <client-config>
+
<config-name>org.jboss.test.ws.jaxws.clientConfig.Endpoint2</config-name>
+ <pre-handler-chains>
+ <javaee:handler-chain>
+ <javaee:handler>
+ <javaee:handler-name>Routing Handler</javaee:handler-name>
+
<javaee:handler-class>org.jboss.test.ws.jaxws.clientConfig.RoutingHandler</javaee:handler-class>
+ </javaee:handler>
+ </javaee:handler-chain>
+ </pre-handler-chains>
+ <post-handler-chains>
+ <javaee:handler-chain>
+ <javaee:handler>
+ <javaee:handler-name>Log Handler</javaee:handler-name>
+
<javaee:handler-class>org.jboss.test.ws.jaxws.clientConfig.LogHandler</javaee:handler-class>
+ </javaee:handler>
+ </javaee:handler-chain>
+ </post-handler-chains>
+ </client-config>
+
+</jaxws-config>
\ No newline at end of file
Property changes on:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/jaxws-client-config.xml
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/Helper.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/Helper.java 2014-10-03
16:09:51 UTC (rev 18969)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/Helper.java 2014-10-03
16:10:29 UTC (rev 18970)
@@ -21,44 +21,15 @@
*/
package org.jboss.test.ws.jaxws.jbws3282;
-import java.net.URL;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.Service;
-
import org.jboss.test.helper.ClientHelper;
import org.jboss.wsf.spi.metadata.config.EndpointConfig;
public class Helper implements ClientHelper
{
- private final String targetNS = "http://jbws3282.jaxws.ws.test.jboss.org/";
private final String testConfig =
"org.jboss.test.ws.jaxws.jbws3282.Endpoint2Impl";
private String address;
private static volatile EndpointConfig defaultEndpointConfig;
- public boolean testHandlerChainVanillaServer() throws Exception
- {
- QName serviceName = new QName(targetNS, "Endpoint2ImplService");
- URL wsdlURL = new URL(address + "/ep2?wsdl");
- Service service = Service.create(wsdlURL, serviceName);
- Endpoint port = (Endpoint)service.getPort(Endpoint.class);
- String resStr = port.echo("Kermit");
- if (!"Kermit|EpIn|endpoint2|EpOut".equals(resStr)) {
- return false;
- }
-
- serviceName = new QName(targetNS, "Endpoint3ImplService");
- wsdlURL = new URL(address + "/ep3?wsdl");
- service = Service.create(wsdlURL, serviceName);
- port = (Endpoint)service.getPort(Endpoint.class);
- resStr = port.echo("Kermit");
- if (!"Kermit|EpIn|endpoint3|EpOut".equals(resStr)) {
- return false;
- }
-
- return true;
- }
-
public boolean setupConfigurations() throws Exception
{
defaultEndpointConfig = TestUtils.getAndVerifyDefaultEndpointConfiguration();
@@ -75,39 +46,6 @@
return true;
}
- public boolean testHandlerChainModifiedServer() throws Exception
- {
- final EndpointConfig defaultEndpointConfig =
TestUtils.getAndVerifyDefaultEndpointConfiguration();
- final String testConfig =
"org.jboss.test.ws.jaxws.jbws3282.Endpoint2Impl";
- try {
- TestUtils.addTestCaseEndpointConfiguration(testConfig);
- TestUtils.changeDefaultEndpointConfiguration();
-
- QName serviceName = new QName(targetNS, "Endpoint2ImplService");
- URL wsdlURL = new URL(address + "/ep2?wsdl");
- Service service = Service.create(wsdlURL, serviceName);
- Endpoint port = (Endpoint)service.getPort(Endpoint.class);
- String resStr = port.echo("Kermit");
- if (!"Kermit|RoutIn|EpIn|endpoint2|EpOut|RoutOut".equals(resStr)) {
- return false;
- }
-
- serviceName = new QName(targetNS, "Endpoint3ImplService");
- wsdlURL = new URL(address + "/ep3?wsdl");
- service = Service.create(wsdlURL, serviceName);
- port = (Endpoint)service.getPort(Endpoint.class);
- resStr = port.echo("Kermit");
- if (!"Kermit|EpIn|LogIn|endpoint3|LogOut|EpOut".equals(resStr)) {
- return false;
- }
-
- return true;
- } finally {
- TestUtils.setEndpointConfigAndReload(defaultEndpointConfig);
- TestUtils.removeTestCaseEndpointConfiguration(testConfig);
- }
- }
-
@Override
public void setTargetEndpoint(String address)
{