Author: thomas.diesler(a)jboss.com
Date: 2007-01-18 08:59:21 -0500 (Thu, 18 Jan 2007)
New Revision: 1996
Added:
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/webserviceref/ServiceRefOverridesTestCase.java
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/webserviceref/TestEndpointClientOne.java
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/webserviceref/TestEndpointClientTwo.java
trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/META-INF-override/
trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/META-INF-override/application-client.xml
trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/META-INF-override/jboss-client.xml
trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/WEB-INF-client/
trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/WEB-INF-client/web.xml
Removed:
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/webserviceref/ServiceRefParserTestCase.java
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/webserviceref/TestEndpointClient.java
trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/servlet-client/
Modified:
trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/ServiceObjectFactory.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/UnifiedServiceRef.java
trunk/jbossws-tests/ant-import/build-jars-jaxws.xml
trunk/jbossws-tests/build.xml
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefClientTestCase.java
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefServletTestCase.java
trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/META-INF-secure/application-client.xml
trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/META-INF/jboss-client.xml
Log:
Expand, enable webserviceref tests
Modified:
trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/ServiceObjectFactory.java
===================================================================
---
trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/ServiceObjectFactory.java 2007-01-18
13:58:21 UTC (rev 1995)
+++
trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/ServiceObjectFactory.java 2007-01-18
13:59:21 UTC (rev 1996)
@@ -91,6 +91,7 @@
String serviceClassName =
(String)ref.get(ServiceReferenceable.SERVICE_CLASS_NAME).getContent();
String targetClassName =
(String)ref.get(ServiceReferenceable.TARGET_CLASS_NAME).getContent();
UnifiedServiceRef usRef = unmarshallServiceRef(ref);
+ String serviceRefName = usRef.getServiceRefName();
ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
Class serviceClass = ctxLoader.loadClass(serviceClassName);
@@ -99,8 +100,10 @@
if (Service.class.isAssignableFrom(serviceClass) == false)
throw new IllegalArgumentException("WebServiceRef type '" +
serviceClass + "' is not assignable to javax.xml.ws.Service");
+ // Receives either a javax.xml.ws.Service or a JAXWS dynamic proxy
Object target;
+ // Get the URL to the wsdl
URL wsdlURL = getWsdlLocationURL(targetClass != null ? targetClass :
serviceClass, usRef);
// Generic javax.xml.ws.Service
@@ -112,7 +115,7 @@
}
else
{
- throw new IllegalArgumentException("Cannot create generic
javax.xml.ws.Service without wsdlLocation");
+ throw new IllegalArgumentException("Cannot create generic
javax.xml.ws.Service without wsdlLocation: " + serviceRefName);
}
}
// Generated javax.xml.ws.Service subclass
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/UnifiedServiceRef.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/UnifiedServiceRef.java 2007-01-18
13:58:21 UTC (rev 1995)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/UnifiedServiceRef.java 2007-01-18
13:59:21 UTC (rev 1996)
@@ -28,17 +28,17 @@
import org.jboss.ws.core.server.UnifiedVirtualFile;
/**
- * Represents a <service-ref> element of the jboss.xml, jboss-web.xml,
jboss-client.xml deployment descriptor
- * for the 5.0 schema
+ * Represents a <service-ref> element of the jboss.xml, jboss-web.xml,
jboss-client.xml
*
* @author Thomas.Diesler(a)jboss.com
+ * @since 16-Dec-2006
*/
public class UnifiedServiceRef implements Serializable
{
private static final long serialVersionUID = -5518998734737147195L;
private UnifiedVirtualFile vfsRoot;
- private String encName;
+ private String serviceRefName;
private String wsdlLocation;
private String configName;
private String configFile;
@@ -46,7 +46,7 @@
public UnifiedServiceRef(UnifiedVirtualFile vfsRoot, String name)
{
this.vfsRoot = vfsRoot;
- this.encName = name;
+ this.serviceRefName = name;
}
public UnifiedVirtualFile getRootFile()
@@ -54,9 +54,9 @@
return vfsRoot;
}
- public String getEncName()
+ public String getServiceRefName()
{
- return encName;
+ return serviceRefName;
}
public String getWsdlLocation()
@@ -93,7 +93,7 @@
{
StringBuilder sb = new StringBuilder();
sb.append("[");
- sb.append("name=").append(encName);
+ sb.append("name=").append(serviceRefName);
sb.append(",config-name=").append(configName);
sb.append(",config-file=").append(configFile);
sb.append(",wsdl=").append(wsdlLocation);
Modified: trunk/jbossws-tests/ant-import/build-jars-jaxws.xml
===================================================================
--- trunk/jbossws-tests/ant-import/build-jars-jaxws.xml 2007-01-18 13:58:21 UTC (rev
1995)
+++ trunk/jbossws-tests/ant-import/build-jars-jaxws.xml 2007-01-18 13:59:21 UTC (rev
1996)
@@ -533,7 +533,7 @@
</war>
<jar
destfile="${tests.output.dir}/libs/jaxws-webserviceref-client.jar">
<fileset dir="${tests.output.dir}/classes">
- <include
name="org/jboss/test/ws/jaxws/webserviceref/TestEndpointClient.class"/>
+ <include
name="org/jboss/test/ws/jaxws/webserviceref/TestEndpointClientOne.class"/>
<include
name="org/jboss/test/ws/jaxws/webserviceref/TestEndpointService.class"/>
<include
name="org/jboss/test/ws/jaxws/webserviceref/TestEndpoint.class"/>
</fileset>
@@ -543,10 +543,10 @@
<include name="wsdl/**"/>
</metainf>
<manifest>
- <attribute name="main-class"
value="org.jboss.test.ws.jaxws.webserviceref.TestEndpointClient"/>
+ <attribute name="main-class"
value="org.jboss.test.ws.jaxws.webserviceref.TestEndpointClientOne"/>
</manifest>
</jar>
- <war
destfile="${tests.output.dir}/libs/jaxws-webserviceref-servlet-client.war"
webxml="${tests.output.dir}/resources/jaxws/webserviceref/servlet-client/WEB-INF/web.xml">
+ <war
destfile="${tests.output.dir}/libs/jaxws-webserviceref-servlet-client.war"
webxml="${tests.output.dir}/resources/jaxws/webserviceref/WEB-INF-client/web.xml">
<classes dir="${tests.output.dir}/classes">
<include
name="org/jboss/test/ws/jaxws/webserviceref/ServletClient.class"/>
<include
name="org/jboss/test/ws/jaxws/webserviceref/TestEndpointService.class"/>
@@ -592,6 +592,23 @@
<attribute name="main-class"
value="org.jboss.test.ws.jaxws.webserviceref.SecureEndpointClient"/>
</manifest>
</jar>
+ <jar
destfile="${tests.output.dir}/libs/jaxws-webserviceref-override-client.jar">
+ <fileset dir="${tests.output.dir}/classes">
+ <include
name="org/jboss/test/ws/jaxws/webserviceref/TestEndpointClientTwo.class"/>
+ <include
name="org/jboss/test/ws/jaxws/webserviceref/TestEndpointService.class"/>
+ <include
name="org/jboss/test/ws/jaxws/webserviceref/TestEndpoint.class"/>
+ </fileset>
+ <metainf
dir="${tests.output.dir}/resources/jaxws/webserviceref/META-INF-override">
+ <include name="application-client.xml"/>
+ <include name="jboss-client.xml"/>
+ </metainf>
+ <metainf
dir="${tests.output.dir}/resources/jaxws/webserviceref/META-INF">
+ <include name="wsdl/**"/>
+ </metainf>
+ <manifest>
+ <attribute name="main-class"
value="org.jboss.test.ws.jaxws.webserviceref.TestEndpointClientTwo"/>
+ </manifest>
+ </jar>
<!-- jaxws-wrapped-accessor -->
<war warfile="${tests.output.dir}/libs/jaxws-wrapped-accessor.war"
webxml="${tests.output.dir}/resources/jaxws/wrapped/accessor/WEB-INF/web.xml">
Modified: trunk/jbossws-tests/build.xml
===================================================================
--- trunk/jbossws-tests/build.xml 2007-01-18 13:58:21 UTC (rev 1995)
+++ trunk/jbossws-tests/build.xml 2007-01-18 13:59:21 UTC (rev 1996)
@@ -172,7 +172,6 @@
<pathelement location="${thirdparty.dir}/stax-api.jar"/>
<pathelement location="${thirdparty.dir}/xmlunit1.0.jar"/>
<pathelement location="${jboss.client}/jboss-ejb3-client.jar"/>
- <pathelement location="${jboss.server.lib}/jboss.jar"/>
</path>
<!-- The test client classpath -->
Added:
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/webserviceref/ServiceRefOverridesTestCase.java
===================================================================
---
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/webserviceref/ServiceRefOverridesTestCase.java
(rev 0)
+++
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/webserviceref/ServiceRefOverridesTestCase.java 2007-01-18
13:59:21 UTC (rev 1996)
@@ -0,0 +1,100 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.webserviceref;
+
+import junit.framework.Test;
+
+import org.jboss.ejb3.client.ClientLauncher;
+import org.jboss.test.ws.JBossWSTest;
+import org.jboss.test.ws.JBossWSTestSetup;
+
+/**
+ * Test @WebServiceRef overrides in jboss-client.xml
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 18-Jan-2007
+ */
+public class ServiceRefOverridesTestCase extends JBossWSTest
+{
+ public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() +
":8080/jaxws-webserviceref";
+
+ public static Test suite()
+ {
+ return JBossWSTestSetup.newTestSetup(ServiceRefOverridesTestCase.class,
"jaxws-webserviceref.war, jaxws-webserviceref-override-client.jar");
+ }
+
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+
+ if (TestEndpointClientTwo.iniCtx == null)
+ TestEndpointClientTwo.iniCtx = getInitialContext();
+ }
+
+ public void testService1() throws Throwable
+ {
+ String resStr = invokeTest(getName());
+ assertEquals(getName(), resStr);
+ }
+
+ public void testService2() throws Throwable
+ {
+ String resStr = invokeTest(getName());
+ assertEquals(getName(), resStr);
+ }
+
+ public void testService3() throws Throwable
+ {
+ String resStr = invokeTest(getName());
+ assertEquals(getName() + getName(), resStr);
+ }
+
+ public void testService4() throws Throwable
+ {
+ String resStr = invokeTest(getName());
+ assertEquals(getName() + getName(), resStr);
+ }
+
+ public void testPort1() throws Throwable
+ {
+ String resStr = invokeTest(getName());
+ assertEquals(getName(), resStr);
+ }
+
+ public void testPort2() throws Throwable
+ {
+ String resStr = invokeTest(getName());
+ assertEquals(getName() + getName(), resStr);
+ }
+
+ public void testPort3() throws Throwable
+ {
+ String resStr = invokeTest(getName());
+ assertEquals(getName() + getName(), resStr);
+ }
+
+ private String invokeTest(String reqStr) throws Throwable
+ {
+ new ClientLauncher().launch(TestEndpointClientTwo.class.getName(),
"jbossws-client", new String[] { reqStr });
+ return TestEndpointClientTwo.testResult.get(reqStr);
+ }
+}
Property changes on:
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/webserviceref/ServiceRefOverridesTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted:
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/webserviceref/ServiceRefParserTestCase.java
===================================================================
---
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/webserviceref/ServiceRefParserTestCase.java 2007-01-18
13:58:21 UTC (rev 1995)
+++
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/webserviceref/ServiceRefParserTestCase.java 2007-01-18
13:59:21 UTC (rev 1996)
@@ -1,44 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.webserviceref;
-
-import java.io.File;
-
-import org.jboss.ejb3.metamodel.JBossClientDDObjectFactory;
-import org.jboss.test.ws.JBossWSTest;
-
-/**
- * Test the JAXWS annotation: javax.xml.ws.WebServiceRef
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 23-Oct-2005
- */
-public class ServiceRefParserTestCase extends JBossWSTest
-{
- public void testServiceRefParser() throws Exception
- {
- File ddFile = new
File("resources/jaxws/webserviceref/META-INF-secure/jboss-client.xml");
- assertTrue (ddFile.exists());
-
- JBossClientDDObjectFactory.parse(ddFile.toURL(), null);
- }
-}
Deleted:
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/webserviceref/TestEndpointClient.java
===================================================================
---
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/webserviceref/TestEndpointClient.java 2007-01-18
13:58:21 UTC (rev 1995)
+++
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/webserviceref/TestEndpointClient.java 2007-01-18
13:59:21 UTC (rev 1996)
@@ -1,132 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.webserviceref;
-
-import java.util.ArrayList;
-
-import javax.naming.InitialContext;
-import javax.xml.ws.WebServiceException;
-import javax.xml.ws.WebServiceRef;
-import javax.xml.ws.WebServiceRefs;
-
-import org.jboss.logging.Logger;
-
-//Test on type with wsdlLocation
-@WebServiceRef(name = "service1", value = TestEndpointService.class,
wsdlLocation = "META-INF/wsdl/TestEndpoint.wsdl")
-
-// Test multiple on type
-@WebServiceRefs( {
- @WebServiceRef(name = "service2", value = TestEndpointService.class),
- @WebServiceRef(name = "port1", value = TestEndpointService.class, type =
TestEndpoint.class) })
-public class TestEndpointClient
-{
- // Provide logging
- private static Logger log = Logger.getLogger(TestEndpointClient.class);
-
- // Test on field with name
- @WebServiceRef(name = "TestEndpointService3")
- public static TestEndpointService service3;
-
- // Test on field without name
- @WebServiceRef
- public static TestEndpointService service4;
-
- // Test on method with value
- @WebServiceRef(name = "TestEndpointService5")
- public static void setServiceSetter5(TestEndpointService service)
- {
- TestEndpointClient.service5 = service;
- }
-
- private static TestEndpointService service5;
-
- // Test on method without name
- @WebServiceRef
- public static void setServiceSetter6(TestEndpointService service)
- {
- TestEndpointClient.service6 = service;
- }
-
- private static TestEndpointService service6;
-
- // Test on field with name and value
- @WebServiceRef(name = "Port2", value = TestEndpointService.class)
- public static TestEndpoint port2;
-
- // Test on field with value
- @WebServiceRef(value = TestEndpointService.class)
- public static TestEndpoint port3;
-
- // Test on field
- @WebServiceRef
- public static TestEndpoint port4;
-
- // Test on field with name
- @WebServiceRef (name = "Port5")
- public static TestEndpoint port5;
-
- public static InitialContext iniCtx;
- public static String retStr;
-
- public static void main(String[] args)
- {
- String inStr = args[0];
- log.info("echo: " + inStr);
-
- ArrayList<TestEndpoint> ports = new ArrayList<TestEndpoint>();
- try
- {
- System.out.println("FIXME: [EJBTHREE-760] - @WebServiceRef not bound to
java:comp/env");
-
//ports.add(((TestEndpointService)iniCtx.lookup("java:comp/env/service1")).getTestEndpointPort());
-
//ports.add(((TestEndpointService)iniCtx.lookup("java:comp/env/service2")).getTestEndpointPort());
- ports.add((TestEndpoint)service3.getPort(TestEndpoint.class));
-
//ports.add(((TestEndpointService)iniCtx.lookup("java:comp/env/TestEndpointService3")).getTestEndpointPort());
- ports.add((TestEndpoint)service4.getPort(TestEndpoint.class));
- //ports.add(((TestEndpointService)iniCtx.lookup("java:comp/env/" +
ApplicationClient.class.getName() + "/service4")).getTestEndpointPort());
- ports.add((TestEndpoint)service5.getPort(TestEndpoint.class));
-
//ports.add(((TestEndpointService)iniCtx.lookup("java:comp/env/TestEndpointService5")).getTestEndpointPort());
- ports.add((TestEndpoint)service6.getPort(TestEndpoint.class));
- //ports.add(((TestEndpointService)iniCtx.lookup("java:comp/env/" +
ApplicationClient.class.getName() + "/serviceSetter6")).getTestEndpointPort());
- //ports.add((TestEndpoint)iniCtx.lookup("java:comp/env/port1"));
- ports.add(port2);
- //ports.add((TestEndpoint)iniCtx.lookup("java:comp/env/Port2"));
- ports.add(port3);
- //ports.add((TestEndpoint)iniCtx.lookup("java:comp/env/" +
ApplicationClient.class.getName() + "/port3"));
- ports.add(port4);
- ports.add(port5);
- }
- catch (Exception ex)
- {
- log.error("Cannot add port", ex);
- throw new WebServiceException(ex);
- }
-
- for (TestEndpoint port : ports)
- {
- String outStr = port.echo(inStr);
- if (inStr.equals(outStr) == false)
- throw new WebServiceException("Invalid echo return: " + inStr);
- }
-
- retStr = inStr;
- }
-}
Copied:
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/webserviceref/TestEndpointClientOne.java
(from rev 1991,
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/webserviceref/TestEndpointClient.java)
===================================================================
---
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/webserviceref/TestEndpointClientOne.java
(rev 0)
+++
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/webserviceref/TestEndpointClientOne.java 2007-01-18
13:59:21 UTC (rev 1996)
@@ -0,0 +1,130 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.webserviceref;
+
+import java.util.ArrayList;
+
+import javax.naming.InitialContext;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.WebServiceRef;
+import javax.xml.ws.WebServiceRefs;
+
+import org.jboss.logging.Logger;
+
+//Test on type with wsdlLocation
+@WebServiceRef(name = "service1", value = TestEndpointService.class,
wsdlLocation = "META-INF/wsdl/TestEndpoint.wsdl")
+
+// Test multiple on type
+@WebServiceRefs( {
+ @WebServiceRef(name = "service2", value = TestEndpointService.class),
+ @WebServiceRef(name = "port1", value = TestEndpointService.class, type =
TestEndpoint.class) })
+public class TestEndpointClientOne
+{
+ // Provide logging
+ private static Logger log = Logger.getLogger(TestEndpointClientOne.class);
+
+ // Test on field with name
+ @WebServiceRef(name = "TestEndpointService3")
+ public static TestEndpointService service3;
+
+ // Test on field without name
+ @WebServiceRef
+ public static TestEndpointService service4;
+
+ // Test on method with name
+ @WebServiceRef(name = "TestEndpointService5")
+ public static void setServiceSetter5(TestEndpointService service)
+ {
+ TestEndpointClientOne.service5 = service;
+ }
+ private static TestEndpointService service5;
+
+ // Test on method without name
+ @WebServiceRef
+ public static void setServiceSetter6(TestEndpointService service)
+ {
+ TestEndpointClientOne.service6 = service;
+ }
+ private static TestEndpointService service6;
+
+ // Test on field with name and value
+ @WebServiceRef(name = "Port2", value = TestEndpointService.class)
+ public static TestEndpoint port2;
+
+ // Test on field with value
+ @WebServiceRef(value = TestEndpointService.class)
+ public static TestEndpoint port3;
+
+ // Test on field
+ @WebServiceRef
+ public static TestEndpoint port4;
+
+ // Test on field with name
+ @WebServiceRef (name = "Port5")
+ public static TestEndpoint port5;
+
+ public static InitialContext iniCtx;
+ public static String retStr;
+
+ public static void main(String[] args)
+ {
+ String inStr = args[0];
+ log.info("echo: " + inStr);
+
+ ArrayList<TestEndpoint> ports = new ArrayList<TestEndpoint>();
+ try
+ {
+
ports.add(((TestEndpointService)iniCtx.lookup("java:comp/env/service1")).getTestEndpointPort());
+
ports.add(((TestEndpointService)iniCtx.lookup("java:comp/env/service2")).getTestEndpointPort());
+ ports.add((TestEndpoint)service3.getPort(TestEndpoint.class));
+
ports.add(((TestEndpointService)iniCtx.lookup("java:comp/env/TestEndpointService3")).getTestEndpointPort());
+ ports.add((TestEndpoint)service4.getPort(TestEndpoint.class));
+ ports.add(((TestEndpointService)iniCtx.lookup("java:comp/env/" +
TestEndpointClientOne.class.getName() + "/service4")).getTestEndpointPort());
+ ports.add((TestEndpoint)service5.getPort(TestEndpoint.class));
+
ports.add(((TestEndpointService)iniCtx.lookup("java:comp/env/TestEndpointService5")).getTestEndpointPort());
+ ports.add((TestEndpoint)service6.getPort(TestEndpoint.class));
+ ports.add(((TestEndpointService)iniCtx.lookup("java:comp/env/" +
TestEndpointClientOne.class.getName() +
"/serviceSetter6")).getTestEndpointPort());
+ ports.add((TestEndpoint)iniCtx.lookup("java:comp/env/port1"));
+ ports.add(port2);
+ ports.add((TestEndpoint)iniCtx.lookup("java:comp/env/Port2"));
+ ports.add(port3);
+ ports.add((TestEndpoint)iniCtx.lookup("java:comp/env/" +
TestEndpointClientOne.class.getName() + "/port3"));
+ ports.add(port4);
+ ports.add(port5);
+ }
+ catch (Exception ex)
+ {
+ log.error("Cannot add port", ex);
+ throw new WebServiceException(ex);
+ }
+
+ for (TestEndpoint port : ports)
+ {
+ String outStr = port.echo(inStr);
+ if (inStr.equals(outStr) == false)
+ throw new WebServiceException("Invalid echo return: " + inStr);
+ }
+
+ retStr = inStr;
+ }
+}
Added:
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/webserviceref/TestEndpointClientTwo.java
===================================================================
---
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/webserviceref/TestEndpointClientTwo.java
(rev 0)
+++
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/webserviceref/TestEndpointClientTwo.java 2007-01-18
13:59:21 UTC (rev 1996)
@@ -0,0 +1,137 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.webserviceref;
+
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.naming.InitialContext;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebServiceRef;
+import javax.xml.ws.WebServiceRefs;
+
+//Test on type
+@WebServiceRef(name = "Service1")
+// Test multiple on type
+@WebServiceRefs( { @WebServiceRef(name = "Service2"), @WebServiceRef(name =
"Port1", type = TestEndpoint.class) })
+public class TestEndpointClientTwo
+{
+ // Test on field
+ @WebServiceRef(name = "Service3")
+ public static Service service3;
+
+ // Test on field
+ @WebServiceRef(name = "Service4")
+ public static TestEndpointService service4;
+
+ // Test on field
+ @WebServiceRef(name = "Port2")
+ public static TestEndpoint port2;
+
+ // Test on field
+ @WebServiceRef(name = "Port3")
+ public static TestEndpoint port3;
+
+ public static InitialContext iniCtx;
+ public static Map<String, String> testResult = new HashMap<String,
String>();
+
+ public static void main(String[] args) throws Exception
+ {
+ String testName = args[0];
+ TestEndpointClientTwo client = new TestEndpointClientTwo();
+ Method method = TestEndpointClientTwo.class.getMethod(testName, new Class[] {
String.class });
+ try
+ {
+ String retStr = (String)method.invoke(client, testName);
+ testResult.put(testName, retStr);
+ }
+ catch (Exception ex)
+ {
+ testResult.put(testName, ex.toString());
+ }
+ }
+
+ public String testService1(String reqStr) throws Exception
+ {
+ Service service = (Service)iniCtx.lookup("java:comp/env/Service1");
+ TestEndpoint port = service.getPort(TestEndpoint.class);
+ return port.echo(reqStr);
+ }
+
+ public String testService2(String reqStr) throws Exception
+ {
+ Service service = (Service)iniCtx.lookup("java:comp/env/Service2");
+ TestEndpoint port = service.getPort(TestEndpoint.class);
+ return port.echo(reqStr);
+ }
+
+ public String testService3(String reqStr) throws Exception
+ {
+ TestEndpoint port = service3.getPort(TestEndpoint.class);
+ String resStr1 = port.echo(reqStr);
+
+ Service service = (Service)iniCtx.lookup("java:comp/env/Service3");
+ port = service.getPort(TestEndpoint.class);
+ String resStr2 = port.echo(reqStr);
+
+ return resStr1 + resStr2;
+ }
+
+ public String testService4(String reqStr) throws Exception
+ {
+ TestEndpoint port = service4.getPort(TestEndpoint.class);
+ String resStr1 = port.echo(reqStr);
+
+ Service service = (Service)iniCtx.lookup("java:comp/env/Service4");
+ port = service.getPort(TestEndpoint.class);
+ String resStr2 = port.echo(reqStr);
+
+ return resStr1 + resStr2;
+ }
+
+ public String testPort1(String reqStr) throws Exception
+ {
+ TestEndpoint port = (TestEndpoint)iniCtx.lookup("java:comp/env/Port1");
+ return port.echo(reqStr);
+ }
+
+ public String testPort2(String reqStr) throws Exception
+ {
+ String resStr1 = port2.echo(reqStr);
+
+ TestEndpoint port = (TestEndpoint)iniCtx.lookup("java:comp/env/Port2");
+ String resStr2 = port.echo(reqStr);
+
+ return resStr1 + resStr2;
+ }
+
+ public String testPort3(String reqStr) throws Exception
+ {
+ String resStr1 = port3.echo(reqStr);
+
+ TestEndpoint port = (TestEndpoint)iniCtx.lookup("java:comp/env/Port3");
+ String resStr2 = port.echo(reqStr);
+
+ return resStr1 + resStr2;
+ }
+}
Property changes on:
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/webserviceref/TestEndpointClientTwo.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified:
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefClientTestCase.java
===================================================================
---
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefClientTestCase.java 2007-01-18
13:58:21 UTC (rev 1995)
+++
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefClientTestCase.java 2007-01-18
13:59:21 UTC (rev 1996)
@@ -73,9 +73,9 @@
public void testApplicationClient() throws Throwable
{
String helloWorld = "Hello World!";
- TestEndpointClient.iniCtx = getInitialContext();
+ TestEndpointClientOne.iniCtx = getInitialContext();
- new ClientLauncher().launch(TestEndpointClient.class.getName(),
"jbossws-client", new String[]{helloWorld});
- assertEquals(helloWorld, TestEndpointClient.retStr);
+ new ClientLauncher().launch(TestEndpointClientOne.class.getName(),
"jbossws-client", new String[]{helloWorld});
+ assertEquals(helloWorld, TestEndpointClientOne.retStr);
}
}
Modified:
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefServletTestCase.java
===================================================================
---
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefServletTestCase.java 2007-01-18
13:58:21 UTC (rev 1995)
+++
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefServletTestCase.java 2007-01-18
13:59:21 UTC (rev 1996)
@@ -73,19 +73,13 @@
public void testServletClient() throws Exception
{
- if (isTargetJBoss50())
- {
- System.out.println("FIXME: [JBAS-3824] Fix ENC for EJB2.1 and
Servlets");
- return;
- }
-
if (isTargetJBoss50() == false)
{
System.out.println("FIXME: [JBWS-1438] Implement @WebServiceRef injection
for JBossAS-4.2");
return;
}
- deploy("jaxws-webserviceref-servlet-client.jar");
+ deploy("jaxws-webserviceref-servlet-client.war");
try
{
URL url = new URL(TARGET_ENDPOINT_ADDRESS +
"-servlet-client?echo=HelloWorld");
@@ -95,7 +89,7 @@
}
finally
{
- undeploy("jaxws-webserviceref-servlet-client.jar");
+ undeploy("jaxws-webserviceref-servlet-client.war");
}
}
}
Modified:
trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/META-INF/jboss-client.xml
===================================================================
---
trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/META-INF/jboss-client.xml 2007-01-18
13:58:21 UTC (rev 1995)
+++
trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/META-INF/jboss-client.xml 2007-01-18
13:59:21 UTC (rev 1996)
@@ -33,7 +33,7 @@
@WebServiceRef
-->
<service-ref>
-
<service-ref-name>org.jboss.test.ws.jaxws.webserviceref.TestEndpointClient/service4</service-ref-name>
+
<service-ref-name>org.jboss.test.ws.jaxws.webserviceref.TestEndpointClientOne/service4</service-ref-name>
<wsdl-override>META-INF/wsdl/TestEndpoint.wsdl</wsdl-override>
</service-ref>
@@ -49,7 +49,7 @@
@WebServiceRef
-->
<service-ref>
-
<service-ref-name>org.jboss.test.ws.jaxws.webserviceref.TestEndpointClient/serviceSetter6</service-ref-name>
+
<service-ref-name>org.jboss.test.ws.jaxws.webserviceref.TestEndpointClientOne/serviceSetter6</service-ref-name>
<wsdl-override>META-INF/wsdl/TestEndpoint.wsdl</wsdl-override>
</service-ref>
@@ -73,7 +73,7 @@
@WebServiceRef(value = TestEndpointService.class)
-->
<service-ref>
-
<service-ref-name>org.jboss.test.ws.jaxws.webserviceref.TestEndpointClient/port3</service-ref-name>
+
<service-ref-name>org.jboss.test.ws.jaxws.webserviceref.TestEndpointClientOne/port3</service-ref-name>
<wsdl-override>META-INF/wsdl/TestEndpoint.wsdl</wsdl-override>
</service-ref>
@@ -81,7 +81,7 @@
@WebServiceRef
-->
<service-ref>
-
<service-ref-name>org.jboss.test.ws.jaxws.webserviceref.TestEndpointClient/port4</service-ref-name>
+
<service-ref-name>org.jboss.test.ws.jaxws.webserviceref.TestEndpointClientOne/port4</service-ref-name>
<wsdl-override>META-INF/wsdl/TestEndpoint.wsdl</wsdl-override>
</service-ref>
Added:
trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/META-INF-override/application-client.xml
===================================================================
---
trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/META-INF-override/application-client.xml
(rev 0)
+++
trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/META-INF-override/application-client.xml 2007-01-18
13:59:21 UTC (rev 1996)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<application-client version="5"
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/application-client_5.xsd">
+
+ <display-name>TestEndpointService</display-name>
+
+</application-client>
Property changes on:
trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/META-INF-override/application-client.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/META-INF-override/jboss-client.xml
===================================================================
---
trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/META-INF-override/jboss-client.xml
(rev 0)
+++
trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/META-INF-override/jboss-client.xml 2007-01-18
13:59:21 UTC (rev 1996)
@@ -0,0 +1,65 @@
+<?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>
+
+
+ <!--
+ @WebServiceRef(name = "Service1")
+ -->
+ <service-ref>
+ <service-ref-name>Service1</service-ref-name>
+ <wsdl-override>META-INF/wsdl/TestEndpoint.wsdl</wsdl-override>
+ </service-ref>
+
+ <!--
+ @WebServiceRef(name = "Service2")
+ -->
+ <service-ref>
+ <service-ref-name>Service2</service-ref-name>
+ <wsdl-override>META-INF/wsdl/TestEndpoint.wsdl</wsdl-override>
+ </service-ref>
+
+ <!--
+ @WebServiceRef(name = "Service3")
+ -->
+ <service-ref>
+ <service-ref-name>Service3</service-ref-name>
+ <wsdl-override>META-INF/wsdl/TestEndpoint.wsdl</wsdl-override>
+ </service-ref>
+
+ <!--
+ @WebServiceRef(name = "Service4")
+ -->
+ <service-ref>
+ <service-ref-name>Service4</service-ref-name>
+ <wsdl-override>META-INF/wsdl/TestEndpoint.wsdl</wsdl-override>
+ </service-ref>
+
+ <!--
+ @WebServiceRef(name = "Port1", type = TestEndpoint.class)
+ -->
+ <service-ref>
+ <service-ref-name>Port1</service-ref-name>
+ <wsdl-override>META-INF/wsdl/TestEndpoint.wsdl</wsdl-override>
+ </service-ref>
+
+ <!--
+ @WebServiceRef(name = "Port2")
+ -->
+ <service-ref>
+ <service-ref-name>Port2</service-ref-name>
+ <wsdl-override>META-INF/wsdl/TestEndpoint.wsdl</wsdl-override>
+ </service-ref>
+
+ <!--
+ @WebServiceRef(name = "Port3")
+ -->
+ <service-ref>
+ <service-ref-name>Port3</service-ref-name>
+ <wsdl-override>META-INF/wsdl/TestEndpoint.wsdl</wsdl-override>
+ </service-ref>
+
+</jboss-client>
\ No newline at end of file
Property changes on:
trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/META-INF-override/jboss-client.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified:
trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/META-INF-secure/application-client.xml
===================================================================
---
trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/META-INF-secure/application-client.xml 2007-01-18
13:58:21 UTC (rev 1995)
+++
trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/META-INF-secure/application-client.xml 2007-01-18
13:59:21 UTC (rev 1996)
@@ -3,6 +3,6 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/application-client_5.xsd">
- <display-name>TestEndpointService</display-name>
+ <display-name>SecureEndpointService</display-name>
</application-client>
Added: trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/WEB-INF-client/web.xml
===================================================================
--- trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/WEB-INF-client/web.xml
(rev 0)
+++
trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/WEB-INF-client/web.xml 2007-01-18
13:59:21 UTC (rev 1996)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+
+ <servlet>
+ <servlet-name>ServletClient</servlet-name>
+
<servlet-class>org.jboss.test.ws.jaxws.webserviceref.ServletClient</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>ServletClient</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+</web-app>
\ No newline at end of file
Property changes on:
trunk/jbossws-tests/src/main/resources/jaxws/webserviceref/WEB-INF-client/web.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF