Author: thomas.diesler(a)jboss.com
Date: 2008-04-11 07:29:26 -0400 (Fri, 11 Apr 2008)
New Revision: 6351
Added:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/TestEndpointImpl.java
Modified:
stack/native/trunk/ant-import-tests/build-jars-jaxws.xml
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/JBWS1178TestCase.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/TestEndpoint.java
stack/native/trunk/src/test/resources/jaxws/jbws1178/WEB-INF/web.xml
Log:
[JBWS-2104] Migrate JBWS1178TestCase to JAX-WS
Modified: stack/native/trunk/ant-import-tests/build-jars-jaxws.xml
===================================================================
--- stack/native/trunk/ant-import-tests/build-jars-jaxws.xml 2008-04-11 09:26:31 UTC (rev
6350)
+++ stack/native/trunk/ant-import-tests/build-jars-jaxws.xml 2008-04-11 11:29:26 UTC (rev
6351)
@@ -158,7 +158,7 @@
<!-- jaxws-jbws1178 -->
<war destfile="${tests.output.dir}/libs/jaxws-jbws1178.war"
webxml="${tests.output.dir}/resources/jaxws/jbws1178/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/classes">
- <include
name="org/jboss/test/ws/jaxws/jbws1178/TestEndpoint.class"/>
+ <include
name="org/jboss/test/ws/jaxws/jbws1178/TestEndpointImpl.class"/>
</classes>
</war>
Modified:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/JBWS1178TestCase.java
===================================================================
---
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/JBWS1178TestCase.java 2008-04-11
09:26:31 UTC (rev 6350)
+++
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/JBWS1178TestCase.java 2008-04-11
11:29:26 UTC (rev 6351)
@@ -23,20 +23,20 @@
import java.net.InetAddress;
import java.net.URL;
+import java.util.Map;
import javax.management.Attribute;
import javax.management.ObjectName;
import javax.xml.namespace.QName;
-import javax.xml.rpc.Service;
-import javax.xml.rpc.ServiceFactory;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
import junit.extensions.TestSetup;
import junit.framework.Test;
-import org.jboss.ws.core.jaxrpc.client.CallImpl;
+import org.jboss.wsf.common.ObjectNameFactory;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestSetup;
-import org.jboss.wsf.common.ObjectNameFactory;
/**
* [JBWS-1178] Multiple virtual host and soap:address problem
@@ -79,12 +79,11 @@
InetAddress inetAddr = InetAddress.getByName(getServerHost());
URL wsdlURL = new URL("http://" + inetAddr.getHostAddress() +
":8080/jaxws-jbws1178/testpattern?wsdl");
- ServiceFactory factory = ServiceFactory.newInstance();
QName serviceName = new QName("http://org.jboss.ws/jbws1178",
"TestEndpointService");
- QName portName = new QName("http://org.jboss.ws/jbws1178",
"TestEndpointPort");
- Service service = factory.createService(wsdlURL, serviceName);
- CallImpl call = (CallImpl)service.createCall(portName);
- URL epURL = new URL(call.getEndpointMetaData().getEndpointAddress());
+ Service service = Service.create(wsdlURL, serviceName);
+ TestEndpoint port = service.getPort(TestEndpoint.class);
+ Map<String, Object> reqCtx = ((BindingProvider)port).getRequestContext();
+ URL epURL = new
URL((String)reqCtx.get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY));
assertEquals(wsdlURL.getHost(), epURL.getHost());
}
@@ -94,12 +93,11 @@
InetAddress inetAddr = InetAddress.getByName(getServerHost());
URL wsdlURL = new URL("http://" + inetAddr.getHostName() +
":8080/jaxws-jbws1178/testpattern?wsdl");
- ServiceFactory factory = ServiceFactory.newInstance();
QName serviceName = new QName("http://org.jboss.ws/jbws1178",
"TestEndpointService");
- QName portName = new QName("http://org.jboss.ws/jbws1178",
"TestEndpointPort");
- Service service = factory.createService(wsdlURL, serviceName);
- CallImpl call = (CallImpl)service.createCall(portName);
- URL epURL = new URL(call.getEndpointMetaData().getEndpointAddress());
+ Service service = Service.create(wsdlURL, serviceName);
+ TestEndpoint port = service.getPort(TestEndpoint.class);
+ Map<String, Object> reqCtx = ((BindingProvider)port).getRequestContext();
+ URL epURL = new
URL((String)reqCtx.get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY));
assertEquals(wsdlURL.getHost(), epURL.getHost());
}
Modified:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/TestEndpoint.java
===================================================================
---
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/TestEndpoint.java 2008-04-11
09:26:31 UTC (rev 6350)
+++
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/TestEndpoint.java 2008-04-11
11:29:26 UTC (rev 6351)
@@ -25,13 +25,10 @@
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
-@WebService(name = "TestEndpoint", targetNamespace =
"http://org.jboss.ws/jbws1178")
+@WebService(name = "TestEndpoint", serviceName =
"TestEndpointService", targetNamespace =
"http://org.jboss.ws/jbws1178")
@SOAPBinding(style = SOAPBinding.Style.RPC)
-public class TestEndpoint
+public interface TestEndpoint
{
@WebMethod
- public String echo(String input)
- {
- return input;
- }
+ public String echo(String input);
}
Copied:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/TestEndpointImpl.java
(from rev 6350,
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/TestEndpoint.java)
===================================================================
---
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/TestEndpointImpl.java
(rev 0)
+++
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/TestEndpointImpl.java 2008-04-11
11:29:26 UTC (rev 6351)
@@ -0,0 +1,37 @@
+/*
+ * 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.jbws1178;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+@WebService(name = "TestEndpoint", serviceName =
"TestEndpointService", targetNamespace =
"http://org.jboss.ws/jbws1178")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+public class TestEndpointImpl
+{
+ @WebMethod
+ public String echo(String input)
+ {
+ return input;
+ }
+}
Modified: stack/native/trunk/src/test/resources/jaxws/jbws1178/WEB-INF/web.xml
===================================================================
--- stack/native/trunk/src/test/resources/jaxws/jbws1178/WEB-INF/web.xml 2008-04-11
09:26:31 UTC (rev 6350)
+++ stack/native/trunk/src/test/resources/jaxws/jbws1178/WEB-INF/web.xml 2008-04-11
11:29:26 UTC (rev 6351)
@@ -5,7 +5,7 @@
<servlet>
<servlet-name>TestEndpoint</servlet-name>
-
<servlet-class>org.jboss.test.ws.jaxws.jbws1178.TestEndpoint</servlet-class>
+
<servlet-class>org.jboss.test.ws.jaxws.jbws1178.TestEndpointImpl</servlet-class>
</servlet>
<servlet-mapping>