Author: thomas.diesler(a)jboss.com
Date: 2008-04-11 07:38:40 -0400 (Fri, 11 Apr 2008)
New Revision: 6353
Added:
framework/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/
framework/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/JBWS1178TestCase.java
framework/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/TestEndpoint.java
framework/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/TestEndpointImpl.java
framework/trunk/src/test/resources/jaxws/jbws1178/
framework/trunk/src/test/resources/jaxws/jbws1178/WEB-INF/
framework/trunk/src/test/resources/jaxws/jbws1178/WEB-INF/web.xml
Modified:
framework/trunk/src/test/ant-import/build-jars-jaxws.xml
Log:
Move jbws1178 test to framework
Modified: framework/trunk/src/test/ant-import/build-jars-jaxws.xml
===================================================================
--- framework/trunk/src/test/ant-import/build-jars-jaxws.xml 2008-04-11 11:37:22 UTC (rev
6352)
+++ framework/trunk/src/test/ant-import/build-jars-jaxws.xml 2008-04-11 11:38:40 UTC (rev
6353)
@@ -123,6 +123,13 @@
</fileset>
</jar>
+ <!-- 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/TestEndpointImpl.class"/>
+ </classes>
+ </war>
+
<!-- jaxws-jbws1190 -->
<war destfile="${tests.output.dir}/libs/jaxws-jbws1190.war"
webxml="${tests.output.dir}/resources/jaxws/jbws1190/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/classes">
Added:
framework/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/JBWS1178TestCase.java
===================================================================
--- framework/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/JBWS1178TestCase.java
(rev 0)
+++
framework/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/JBWS1178TestCase.java 2008-04-11
11:38:40 UTC (rev 6353)
@@ -0,0 +1,104 @@
+/*
+ * 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 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.ws.BindingProvider;
+import javax.xml.ws.Service;
+
+import junit.extensions.TestSetup;
+import junit.framework.Test;
+
+import org.jboss.wsf.common.ObjectNameFactory;
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * [JBWS-1178] Multiple virtual host and soap:address problem
+ * [JBWS-864] soap:address in wsdl ignores <url-pattern>
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 05-Oct-2006
+ */
+public class JBWS1178TestCase extends JBossWSTest
+{
+
+ public static Test suite()
+ {
+ TestSetup testSetup = new JBossWSTestSetup(JBWS1178TestCase.class,
"jaxws-jbws1178.war")
+ {
+ private final ObjectName objectName =
ObjectNameFactory.create("jboss.ws:service=ServerConfig");
+ private String webServiceHost;
+
+ public void setUp() throws Exception
+ {
+ // Setting the WebServiceHost to an empty string, causes the request host to
be used.
+ // This must be done before deploy time.
+ webServiceHost = (String)getServer().getAttribute(objectName,
"WebServiceHost");
+ getServer().setAttribute(objectName, new
Attribute("WebServiceHost", ""));
+ super.setUp();
+ }
+
+ public void tearDown() throws Exception
+ {
+ super.tearDown();
+ getServer().setAttribute(objectName, new
Attribute("WebServiceHost", webServiceHost));
+ }
+ };
+ return testSetup;
+ }
+
+
+ public void testHostAddress() throws Exception
+ {
+ InetAddress inetAddr = InetAddress.getByName(getServerHost());
+ URL wsdlURL = new URL("http://" + inetAddr.getHostAddress() +
":8080/jaxws-jbws1178/testpattern?wsdl");
+
+ QName serviceName = new QName("http://org.jboss.ws/jbws1178",
"TestEndpointService");
+ 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());
+ }
+
+ public void testHostName() throws Exception
+ {
+ InetAddress inetAddr = InetAddress.getByName(getServerHost());
+ URL wsdlURL = new URL("http://" + inetAddr.getHostName() +
":8080/jaxws-jbws1178/testpattern?wsdl");
+
+ QName serviceName = new QName("http://org.jboss.ws/jbws1178",
"TestEndpointService");
+ 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());
+ }
+}
Property changes on:
framework/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/JBWS1178TestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: framework/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/TestEndpoint.java
===================================================================
--- framework/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/TestEndpoint.java
(rev 0)
+++
framework/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/TestEndpoint.java 2008-04-11
11:38:40 UTC (rev 6353)
@@ -0,0 +1,34 @@
+/*
+ * 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 interface TestEndpoint
+{
+ @WebMethod
+ public String echo(String input);
+}
Property changes on:
framework/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/TestEndpoint.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
framework/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/TestEndpointImpl.java
===================================================================
--- framework/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/TestEndpointImpl.java
(rev 0)
+++
framework/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/TestEndpointImpl.java 2008-04-11
11:38:40 UTC (rev 6353)
@@ -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;
+ }
+}
Property changes on:
framework/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/TestEndpointImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: framework/trunk/src/test/resources/jaxws/jbws1178/WEB-INF/web.xml
===================================================================
--- framework/trunk/src/test/resources/jaxws/jbws1178/WEB-INF/web.xml
(rev 0)
+++ framework/trunk/src/test/resources/jaxws/jbws1178/WEB-INF/web.xml 2008-04-11 11:38:40
UTC (rev 6353)
@@ -0,0 +1,16 @@
+<?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>TestEndpoint</servlet-name>
+
<servlet-class>org.jboss.test.ws.jaxws.jbws1178.TestEndpointImpl</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>TestEndpoint</servlet-name>
+ <!-- [JBWS-864] soap:address in wsdl ignores <url-pattern> -->
+ <url-pattern>/testpattern</url-pattern>
+ </servlet-mapping>
+</web-app>
\ No newline at end of file
Property changes on: framework/trunk/src/test/resources/jaxws/jbws1178/WEB-INF/web.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF