Author: ropalka
Date: 2012-02-23 10:08:01 -0500 (Thu, 23 Feb 2012)
New Revision: 15718
Removed:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxrpc/samples/serviceref/ApplicationClient.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/EndpointClientTwo.java
shared-testsuite/trunk/testsuite/src/test/resources/jaxrpc/samples/serviceref/META-INF/jboss-client.xml
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/samples/serviceref/META-INF/jboss-client.xml
Modified:
shared-testsuite/trunk/testsuite/src/test/ant-import/build-samples-jaxrpc.xml
shared-testsuite/trunk/testsuite/src/test/ant-import/build-samples-jaxws.xml
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxrpc/samples/serviceref/ServiceRefClientTestCase.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/serviceref/EndpointImpl.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/serviceref/EndpointService.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/serviceref/ServiceRefClientTestCase.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/EndpointClientOne.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/WebServiceRefClientTestCase.java
shared-testsuite/trunk/testsuite/src/test/resources/jaxrpc/samples/serviceref/META-INF/application-client.xml
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/samples/serviceref/META-INF/application-client.xml
Log:
[JBWS-3444] reviewed and enabled shared appclient tests
Modified: shared-testsuite/trunk/testsuite/src/test/ant-import/build-samples-jaxrpc.xml
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/ant-import/build-samples-jaxrpc.xml 2012-02-23
15:05:38 UTC (rev 15717)
+++
shared-testsuite/trunk/testsuite/src/test/ant-import/build-samples-jaxrpc.xml 2012-02-23
15:08:01 UTC (rev 15718)
@@ -449,19 +449,27 @@
<include name="webservices.xml"/>
</webinf>
</war>
- <jar
destfile="${tests.output.dir}/test-libs/jaxrpc-samples-serviceref-client.jar">
+ <jar
destfile="${tests.output.dir}/test-libs/jaxrpc-samples-serviceref-appclient.jar">
<fileset dir="${tests.output.dir}/test-classes">
<include
name="org/jboss/test/ws/jaxrpc/samples/serviceref/ApplicationClient.class"/>
<include
name="org/jboss/test/ws/jaxrpc/samples/serviceref/TestEndpointService.class"/>
<include
name="org/jboss/test/ws/jaxrpc/samples/serviceref/TestEndpoint.class"/>
</fileset>
+ <manifest>
+ <attribute name="main-class"
value="org.jboss.ws.common.appclient.AppclientKiller"/>
+ <attribute name="Dependencies"
value="org.jboss.ws.common"/>
+ </manifest>
<metainf
dir="${tests.output.dir}/test-resources/jaxrpc/samples/serviceref/META-INF">
<include name="application-client.xml"/>
- <include name="jboss-client.xml"/>
<include name="jaxrpc-mapping.xml"/>
<include name="wsdl/**"/>
</metainf>
</jar>
+ <jar
destfile="${tests.output.dir}/test-libs/jaxrpc-samples-serviceref-appclient.ear">
+ <fileset dir="${tests.output.dir}/test-libs">
+ <include name="jaxrpc-samples-serviceref-appclient.jar"/>
+ </fileset>
+ </jar>
<war
destfile="${tests.output.dir}/test-libs/jaxrpc-samples-serviceref-servlet-client.war"
webxml="${tests.output.dir}/test-resources/jaxrpc/samples/serviceref/servlet-client/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/test-classes">
Modified: shared-testsuite/trunk/testsuite/src/test/ant-import/build-samples-jaxws.xml
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/ant-import/build-samples-jaxws.xml 2012-02-23
15:05:38 UTC (rev 15717)
+++
shared-testsuite/trunk/testsuite/src/test/ant-import/build-samples-jaxws.xml 2012-02-23
15:08:01 UTC (rev 15718)
@@ -281,18 +281,26 @@
<include
name="org/jboss/test/ws/jaxws/samples/serviceref/EndpointService.class"/>
</classes>
</war>
- <jar
destfile="${tests.output.dir}/test-libs/jaxws-samples-serviceref-client.jar">
+ <jar
destfile="${tests.output.dir}/test-libs/jaxws-samples-serviceref-appclient.jar">
<fileset dir="${tests.output.dir}/test-classes">
<include
name="org/jboss/test/ws/jaxws/samples/serviceref/ApplicationClient.class"/>
<include
name="org/jboss/test/ws/jaxws/samples/serviceref/EndpointService.class"/>
<include
name="org/jboss/test/ws/jaxws/samples/serviceref/Endpoint.class"/>
</fileset>
+ <manifest>
+ <attribute name="main-class"
value="org.jboss.ws.common.appclient.AppclientKiller"/>
+ <attribute name="Dependencies"
value="org.jboss.ws.common"/>
+ </manifest>
<metainf
dir="${tests.output.dir}/test-resources/jaxws/samples/serviceref/META-INF">
<include name="application-client.xml"/>
- <include name="jboss-client.xml"/>
<include name="wsdl/**"/>
</metainf>
</jar>
+ <jar
destfile="${tests.output.dir}/test-libs/jaxws-samples-serviceref-appclient.ear">
+ <fileset dir="${tests.output.dir}/test-libs">
+ <include name="jaxws-samples-serviceref-appclient.jar"/>
+ </fileset>
+ </jar>
<war
destfile="${tests.output.dir}/test-libs/jaxws-samples-serviceref-servlet-client.war"
webxml="${tests.output.dir}/test-resources/jaxws/samples/serviceref/servlet-client/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/test-classes">
<include
name="org/jboss/test/ws/jaxws/samples/serviceref/ServletClient.class"/>
@@ -424,7 +432,7 @@
<include
name="org/jboss/test/ws/jaxws/samples/webserviceref/EndpointImpl.class"/>
</classes>
</war>
- <jar
destfile="${tests.output.dir}/test-libs/jaxws-samples-webserviceref-client.jar">
+ <jar
destfile="${tests.output.dir}/test-libs/jaxws-samples-webserviceref-appclient.jar">
<fileset dir="${tests.output.dir}/test-classes">
<include
name="org/jboss/test/ws/jaxws/samples/webserviceref/EndpointClientOne.class"/>
<include
name="org/jboss/test/ws/jaxws/samples/webserviceref/EndpointService.class"/>
@@ -439,6 +447,11 @@
<attribute name="main-class"
value="org.jboss.test.ws.jaxws.samples.webserviceref.EndpointClientOne"/>
</manifest>
</jar>
+ <jar
destfile="${tests.output.dir}/test-libs/jaxws-samples-webserviceref-appclient.ear">
+ <fileset dir="${tests.output.dir}/test-libs">
+ <include name="jaxws-samples-webserviceref-appclient.jar"/>
+ </fileset>
+ </jar>
<war
destfile="${tests.output.dir}/test-libs/jaxws-samples-webserviceref-servlet-client.war"
webxml="${tests.output.dir}/test-resources/jaxws/samples/webserviceref/WEB-INF-client/web.xml">
<classes dir="${tests.output.dir}/test-classes">
Deleted:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxrpc/samples/serviceref/ApplicationClient.java
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxrpc/samples/serviceref/ApplicationClient.java 2012-02-23
15:05:38 UTC (rev 15717)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxrpc/samples/serviceref/ApplicationClient.java 2012-02-23
15:08:01 UTC (rev 15718)
@@ -1,68 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, 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.jaxrpc.samples.serviceref;
-
-import java.rmi.RemoteException;
-import java.util.ArrayList;
-
-import javax.naming.InitialContext;
-import javax.xml.rpc.JAXRPCException;
-import javax.xml.rpc.Service;
-
-import org.jboss.logging.Logger;
-
-public class ApplicationClient
-{
- // Provide logging
- private static Logger log = Logger.getLogger(ApplicationClient.class);
-
- public static InitialContext encCtx;
- public static String retStr;
-
- public static void main(String[] args) throws RemoteException
- {
- String inStr = args[0];
- log.info("echo: " + inStr);
-
- ArrayList ports = new ArrayList();
- try
- {
-
ports.add((TestEndpoint)((Service)encCtx.lookup("java:comp/env/service1")).getPort(TestEndpoint.class));
-
ports.add(((TestEndpointService)encCtx.lookup("java:comp/env/service2")).getTestEndpointPort());
- }
- catch (Exception ex)
- {
- log.error("Cannot add port", ex);
- throw new JAXRPCException(ex);
- }
-
- for (int i = 0; i < ports.size(); i++)
- {
- TestEndpoint port = (TestEndpoint)ports.get(i);
- String outStr = port.echo(inStr);
- if (inStr.equals(outStr) == false)
- throw new JAXRPCException("Invalid echo return: " + inStr);
- }
-
- retStr = inStr;
- }
-}
Modified:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxrpc/samples/serviceref/ServiceRefClientTestCase.java
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxrpc/samples/serviceref/ServiceRefClientTestCase.java 2012-02-23
15:05:38 UTC (rev 15717)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxrpc/samples/serviceref/ServiceRefClientTestCase.java 2012-02-23
15:08:01 UTC (rev 15718)
@@ -23,6 +23,7 @@
import java.net.URL;
+import javax.naming.InitialContext;
import javax.xml.namespace.QName;
import javax.xml.rpc.Service;
import javax.xml.rpc.ServiceException;
@@ -37,7 +38,7 @@
* Test the JAXRPC <service-ref>
*
* @author Thomas.Diesler(a)jboss.com
- * @since 23-Oct-2005
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
*/
public class ServiceRefClientTestCase extends JBossWSTest
{
@@ -45,7 +46,7 @@
public static Test suite()
{
- return new JBossWSTestSetup(ServiceRefClientTestCase.class,
"jaxrpc-samples-serviceref.war, jaxrpc-samples-serviceref-client.jar");
+ return new JBossWSTestSetup(ServiceRefClientTestCase.class,
"jaxrpc-samples-serviceref.war,
jaxrpc-samples-serviceref-appclient.ear#jaxrpc-samples-serviceref-appclient.jar");
}
public void testDynamicProxyNeg() throws Exception
@@ -70,9 +71,13 @@
public void testApplicationClient() throws Exception
{
- String helloWorld = "Hello World!";
- ApplicationClient.encCtx = getInitialContext();
- ApplicationClient.main(new String[] { helloWorld });
- assertEquals(helloWorld, ApplicationClient.retStr);
+ final InitialContext ctx = getAppclientInitialContext();
+ final TestEndpoint port1 =
(TestEndpoint)((Service)ctx.lookup("java:service1")).getPort(TestEndpoint.class);
+ final TestEndpoint port2 =
((TestEndpointService)ctx.lookup("java:service2")).getTestEndpointPort();
+ final String msg = "Hello World!";
+
+ assertEquals(msg, port1.echo(msg));
+ assertEquals(msg, port2.echo(msg));
}
+
}
Modified:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/serviceref/EndpointImpl.java
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/serviceref/EndpointImpl.java 2012-02-23
15:05:38 UTC (rev 15717)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/serviceref/EndpointImpl.java 2012-02-23
15:08:01 UTC (rev 15718)
@@ -34,7 +34,7 @@
* @since 12-Mar-2007
*/
-@WebService (name = "Endpoint")
+@WebService (name = "Endpoint", serviceName = "EndpointService")
@SOAPBinding(style = SOAPBinding.Style.RPC)
public class EndpointImpl
{
Modified:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/serviceref/EndpointService.java
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/serviceref/EndpointService.java 2012-02-23
15:05:38 UTC (rev 15717)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/serviceref/EndpointService.java 2012-02-23
15:08:01 UTC (rev 15718)
@@ -21,6 +21,7 @@
*/
package org.jboss.test.ws.jaxws.samples.serviceref;
+import java.io.Serializable;
import java.net.MalformedURLException;
import java.net.URL;
import javax.xml.namespace.QName;
@@ -28,7 +29,6 @@
import javax.xml.ws.WebEndpoint;
import javax.xml.ws.WebServiceClient;
-
/**
* JBossWS Generated Source
*
@@ -43,15 +43,16 @@
*/
@WebServiceClient(name = "EndpointService", targetNamespace =
"http://serviceref.samples.jaxws.ws.test.jboss.org/", wsdlLocation =
"http://tddell:8080/jaxws-samples-serviceref?wsdl")
public class EndpointService
- extends Service
+ extends Service implements Serializable
{
- private final static URL TESTENDPOINTSERVICE_WSDL_LOCATION;
+ private static final long serialVersionUID = 1L;
+ private final static URL TESTENDPOINTSERVICE_WSDL_LOCATION;
static {
URL url = null;
try {
- url = new URL("http://tddell:8080/jaxws-samples-serviceref?wsdl");
+ url = new
URL("http://localhost:8080/jaxws-samples-serviceref?wsdl");
} catch (MalformedURLException e) {
e.printStackTrace();
}
Modified:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/serviceref/ServiceRefClientTestCase.java
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/serviceref/ServiceRefClientTestCase.java 2012-02-23
15:05:38 UTC (rev 15717)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/serviceref/ServiceRefClientTestCase.java 2012-02-23
15:08:01 UTC (rev 15718)
@@ -39,7 +39,7 @@
* Test the JAXWS <service-ref>
*
* @author Thomas.Diesler(a)jboss.com
- * @author <a href="mailto:richard.opalka@jboss.org">Richard
Opalka</a>
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
*/
public class ServiceRefClientTestCase extends JBossWSTest
{
@@ -47,7 +47,7 @@
public static Test suite()
{
- String archives =
"jaxws-samples-serviceref.war,jaxws-samples-serviceref-client.jar";
+ String archives =
"jaxws-samples-serviceref.war,jaxws-samples-serviceref-appclient.ear#jaxws-samples-serviceref-appclient.jar";
return new JBossWSTestSetup(ServiceRefClientTestCase.class, archives);
}
@@ -73,8 +73,8 @@
public void testApplicationClient() throws Exception
{
- InitialContext iniCtx = getInitialContext("jbossws-client");
- Service service = (Service) iniCtx.lookup("java:comp/env/service2");
+ InitialContext iniCtx = getAppclientInitialContext();
+ Service service = (Service) iniCtx.lookup("java:service2");
Endpoint port = service.getPort(Endpoint.class);
assertNotNull(port);
Modified:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/EndpointClientOne.java
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/EndpointClientOne.java 2012-02-23
15:05:38 UTC (rev 15717)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/EndpointClientOne.java 2012-02-23
15:08:01 UTC (rev 15718)
@@ -138,11 +138,14 @@
throw new WebServiceException(ex);
}
+ System.out.println("TEST START");
for (Endpoint port : ports)
{
+ System.out.println("Testing: " + port);
String outStr = port.echo(inStr);
if (inStr.equals(outStr) == false)
throw new WebServiceException("Invalid echo return: " + inStr);
}
+ System.out.println("TEST END");
}
}
Deleted:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/EndpointClientTwo.java
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/EndpointClientTwo.java 2012-02-23
15:05:38 UTC (rev 15717)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/EndpointClientTwo.java 2012-02-23
15:08:01 UTC (rev 15718)
@@ -1,214 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, 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.samples.webserviceref;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.naming.InitialContext;
-import javax.xml.ws.BindingProvider;
-import javax.xml.ws.Service;
-import javax.xml.ws.WebServiceRef;
-import javax.xml.ws.WebServiceRefs;
-
-import org.jboss.logging.Logger;
-import org.jboss.test.ws.jaxws.samples.webserviceref.Endpoint;
-import org.jboss.test.ws.jaxws.samples.webserviceref.EndpointService;
-
-// Test on type
-@WebServiceRef(name = "Service1", type = EndpointService.class)
-// Test multiple on type
-@WebServiceRefs
-(
- {
- @WebServiceRef(name = "Service2", type = EndpointService.class),
- @WebServiceRef(name = "Port1", type = Endpoint.class)
- }
-)
-public class EndpointClientTwo
-{
- // provide logging
- private static final Logger log = Logger.getLogger(EndpointClientTwo.class);
-
- // Test on field
- @WebServiceRef(name = "Service3")
- static Service service3;
-
- // Test on field
- @WebServiceRef(name = "Service4")
- static EndpointService service4;
-
- // Test on field
- @WebServiceRef(name = "Port2")
- static Endpoint port2;
-
- // Test on field
- @WebServiceRef(name = "Port3")
- static Endpoint port3;
-
- static InitialContext iniCtx;
- static Map<String, String> testResult = new HashMap<String, String>();
-
- public static void main(String[] args) throws Exception
- {
- String testName = args[0];
- EndpointClientTwo client = new EndpointClientTwo();
- Method method = EndpointClientTwo.class.getMethod(testName, new Class[] {
String.class });
- try
- {
- String retStr = (String)method.invoke(client, testName);
- testResult.put(testName, retStr);
- }
- catch (InvocationTargetException ex)
- {
- log.error("Invocation error", ex);
- testResult.put(testName, ex.getTargetException().toString());
- }
- catch (Exception ex)
- {
- log.error("Error", ex);
- testResult.put(testName, ex.toString());
- }
- }
-
- /**
- * Customize service-class-name, service-qname
- */
- public String testService1(String reqStr) throws Exception
- {
- EndpointService service =
(EndpointService)iniCtx.lookup("java:comp/env/Service1");
- Endpoint port = service.getEndpointPort();
- return port.echo(reqStr);
- }
-
- /**
- * Customize config-name, config-file
- */
- public String testService2(String reqStr) throws Exception
- {
- Service service = (Service)iniCtx.lookup("java:comp/env/Service2");
-
- Endpoint port = service.getPort(Endpoint.class);
- //verifyConfig((ConfigProvider)port);
-
- return port.echo(reqStr);
- }
-
- /**
- * Customize service-class-name, service-qname
- */
- public String testService3(String reqStr) throws Exception
- {
- Endpoint port = ((EndpointService)service3).getEndpointPort();
- String resStr1 = port.echo(reqStr);
-
- EndpointService service =
(EndpointService)iniCtx.lookup("java:comp/env/Service3");
- port = service.getEndpointPort();
-
- String resStr2 = port.echo(reqStr);
-
- return resStr1 + resStr2;
- }
-
- /**
- * Customize config-name, config-file
- */
- public String testService4(String reqStr) throws Exception
- {
- Endpoint port = service4.getEndpointPort();
- String resStr1 = port.echo(reqStr);
- //verifyConfig((ConfigProvider)port);
-
- EndpointService service =
(EndpointService)iniCtx.lookup("java:comp/env/Service4");
- port = service.getEndpointPort();
- //verifyConfig((ConfigProvider)port);
-
- String resStr2 = port.echo(reqStr);
-
- return resStr1 + resStr2;
- }
-
- /**
- * Customize port-info: port-qname, config-name, config-file
- */
- public String testPort1(String reqStr) throws Exception
- {
- Endpoint port = (Endpoint)iniCtx.lookup("java:comp/env/Port1");
- //verifyConfig((ConfigProvider)port);
-
- return port.echo(reqStr);
- }
-
- /**
- * Customize port-info: service-endpoint-interface, config-name, config-file
- */
- public String testPort2(String reqStr) throws Exception
- {
- //verifyConfig((ConfigProvider)port2);
- String resStr1 = port2.echo(reqStr);
-
- Endpoint port = (Endpoint)iniCtx.lookup("java:comp/env/Port2");
- //verifyConfig((ConfigProvider)port);
-
- String resStr2 = port.echo(reqStr);
-
- return resStr1 + resStr2;
- }
-
- /**
- * Customize port-info: service-endpoint-interface, port-qname, stub-property
- */
- public String testPort3(String reqStr) throws Exception
- {
- String resStr1 = port3.echo(reqStr);
-
- BindingProvider bp = (BindingProvider)port3;
- verifyProperties(bp.getRequestContext());
-
- Endpoint port = (Endpoint)iniCtx.lookup("java:comp/env/Port3");
- String resStr2 = port.echo(reqStr);
-
- return resStr1 + resStr2;
- }
-
- private void verifyProperties(Map<String, Object> ctx)
- {
- String username = (String)ctx.get(BindingProvider.USERNAME_PROPERTY);
- if ("kermit".equals(username) == false)
- throw new RuntimeException("Invalid username: " + username);
-
- String password = (String)ctx.get(BindingProvider.PASSWORD_PROPERTY);
- if ("thefrog".equals(password) == false)
- throw new RuntimeException("Invalid password: " + password);
- }
-
- /*private void verifyConfig(ConfigProvider cp)
- {
- if ("Custom Client".equals(cp.getConfigName()) == false)
- throw new RuntimeException("Invalid config name: " +
cp.getConfigName());
-
- if ("META-INF/jbossws-client-config.xml".equals(cp.getConfigFile()) ==
false)
- throw new RuntimeException("Invalid config file: " +
cp.getConfigFile());
- } */
-}
Modified:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/WebServiceRefClientTestCase.java
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/WebServiceRefClientTestCase.java 2012-02-23
15:05:38 UTC (rev 15717)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/WebServiceRefClientTestCase.java 2012-02-23
15:08:01 UTC (rev 15718)
@@ -21,6 +21,8 @@
*/
package org.jboss.test.ws.jaxws.samples.webserviceref;
+import java.io.ByteArrayOutputStream;
+import java.io.OutputStream;
import java.net.URL;
import javax.xml.namespace.QName;
@@ -28,8 +30,8 @@
import junit.framework.Test;
-import org.jboss.ejb3.client.ClientLauncher;
import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestHelper;
import org.jboss.wsf.test.JBossWSTestSetup;
/**
@@ -44,7 +46,7 @@
public static Test suite()
{
- return new JBossWSTestSetup(WebServiceRefClientTestCase.class,
"jaxws-samples-webserviceref.war, jaxws-samples-webserviceref-client.jar");
+ return new JBossWSTestSetup(WebServiceRefClientTestCase.class,
"jaxws-samples-webserviceref.war");
}
public void testGeneratedService() throws Exception
@@ -74,7 +76,13 @@
public void testApplicationClient() throws Throwable
{
- String helloWorld = "Hello World!";
- new ClientLauncher().launch(EndpointClientOne.class.getName(),
"jbossws-client", new String[] { helloWorld });
+ final String appclientArg = "Hello World!";
+ final OutputStream appclientOS = new ByteArrayOutputStream();
+ final Process appclientProcess =
JBossWSTestHelper.deployAppclient("jaxws-samples-webserviceref-appclient.ear#jaxws-samples-webserviceref-appclient.jar",
appclientOS, appclientArg);
+ appclientProcess.waitFor();
+ final String appclientLog = appclientOS.toString();
+ assertTrue(!appclientLog.contains("Invalid echo return"));
+ assertTrue(appclientLog.contains("TEST START"));
+ assertTrue(appclientLog.contains("TEST END"));
}
}
Modified:
shared-testsuite/trunk/testsuite/src/test/resources/jaxrpc/samples/serviceref/META-INF/application-client.xml
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/resources/jaxrpc/samples/serviceref/META-INF/application-client.xml 2012-02-23
15:05:38 UTC (rev 15717)
+++
shared-testsuite/trunk/testsuite/src/test/resources/jaxrpc/samples/serviceref/META-INF/application-client.xml 2012-02-23
15:08:01 UTC (rev 15718)
@@ -8,7 +8,7 @@
<display-name>JAXRPC simple tests</display-name>
<service-ref>
- <service-ref-name>service1</service-ref-name>
+ <service-ref-name>java:jboss/exported/service1</service-ref-name>
<service-interface>javax.xml.rpc.Service</service-interface>
<wsdl-file>META-INF/wsdl/TestEndpoint.wsdl</wsdl-file>
<jaxrpc-mapping-file>META-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
@@ -18,7 +18,7 @@
</service-ref>
<service-ref>
- <service-ref-name>service2</service-ref-name>
+ <service-ref-name>java:jboss/exported/service2</service-ref-name>
<service-interface>org.jboss.test.ws.jaxrpc.samples.serviceref.TestEndpointService</service-interface>
<wsdl-file>META-INF/wsdl/TestEndpoint.wsdl</wsdl-file>
<jaxrpc-mapping-file>META-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
Deleted:
shared-testsuite/trunk/testsuite/src/test/resources/jaxrpc/samples/serviceref/META-INF/jboss-client.xml
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/resources/jaxrpc/samples/serviceref/META-INF/jboss-client.xml 2012-02-23
15:05:38 UTC (rev 15717)
+++
shared-testsuite/trunk/testsuite/src/test/resources/jaxrpc/samples/serviceref/META-INF/jboss-client.xml 2012-02-23
15:08:01 UTC (rev 15718)
@@ -1,7 +0,0 @@
-<?xml version='1.0' encoding='UTF-8' ?>
-
-<!DOCTYPE jboss-client PUBLIC "-//JBoss//DTD Application Client 4.0//EN"
"http://www.jboss.org/j2ee/dtd/jboss-client_4_0.dtd">
-
-<jboss-client>
- <jndi-name>jbossws-client</jndi-name>
-</jboss-client>
Modified:
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/samples/serviceref/META-INF/application-client.xml
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/samples/serviceref/META-INF/application-client.xml 2012-02-23
15:05:38 UTC (rev 15717)
+++
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/samples/serviceref/META-INF/application-client.xml 2012-02-23
15:08:01 UTC (rev 15718)
@@ -5,16 +5,16 @@
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/application-client_5.xsd">
<display-name>jaxws simple tests</display-name>
-
+
<service-ref>
- <service-ref-name>service1</service-ref-name>
+ <service-ref-name>java:jboss/exported/service1</service-ref-name>
<service-interface>javax.xml.ws.Service</service-interface>
<wsdl-file>META-INF/wsdl/Endpoint.wsdl</wsdl-file>
<service-qname
xmlns:ns1="http://serviceref.samples.jaxws.ws.test.jboss.org/"&...
</service-ref>
<service-ref>
- <service-ref-name>service2</service-ref-name>
+ <service-ref-name>java:jboss/exported/service2</service-ref-name>
<service-interface>org.jboss.test.ws.jaxws.samples.serviceref.EndpointService</service-interface>
<wsdl-file>META-INF/wsdl/Endpoint.wsdl</wsdl-file>
<service-qname
xmlns:ns1="http://serviceref.samples.jaxws.ws.test.jboss.org/"&...
Deleted:
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/samples/serviceref/META-INF/jboss-client.xml
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/samples/serviceref/META-INF/jboss-client.xml 2012-02-23
15:05:38 UTC (rev 15717)
+++
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/samples/serviceref/META-INF/jboss-client.xml 2012-02-23
15:08:01 UTC (rev 15718)
@@ -1,14 +0,0 @@
-<?xml version='1.0' encoding='UTF-8' ?>
-<!DOCTYPE jboss-client PUBLIC "-//JBoss//DTD Application Client 5.0//EN"
"http://www.jboss.org/j2ee/dtd/jboss-client_5_0.dtd">
-
-<jboss-client>
- <jndi-name>jbossws-client</jndi-name>
-
- <!--service-ref>
- <service-ref-name>service2</service-ref-name>
- <port-component-ref>
-
<service-endpoint-interface>org.jboss.test.ws.jaxws.samples.serviceref.Endpoint</service-endpoint-interface>
-
<
port-qname>{http://serviceref.samples.jaxws.ws.test.jboss.org/}Endpoin...
- </port-component-ref>
- </service-ref-->
-</jboss-client>