Author: asoldano
Date: 2013-10-04 13:43:35 -0400 (Fri, 04 Oct 2013)
New Revision: 17981
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/endpoint/TestServlet.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/udp/TestServlet.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/SampleSTS.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/ant-import/build-jars-jaxws.xml
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/ant-import/build-samples-jaxws.xml
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3223/TestServlet.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/management/recording/MemoryBufferRecorderTestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/publish/EndpointPublishServlet.java
Log:
[JBWS-3714] Futher testsuite fixes
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml 2013-10-04
16:37:48 UTC (rev 17980)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml 2013-10-04
17:43:35 UTC (rev 17981)
@@ -219,6 +219,9 @@
<include
name="org/jboss/test/ws/jaxws/cxf/endpoint/TestServlet.class"/>
<include
name="org/jboss/test/ws/jaxws/cxf/endpoint/HelloWorld*.class"/>
</classes>
+ <manifest>
+ <attribute name="Dependencies"
value="org.jboss.ws.common"/>
+ </manifest>
</war>
<!-- jaxws-cxf-fastinfoset -->
@@ -545,7 +548,7 @@
dir="${tests.output.dir}/test-resources/jaxws/cxf/udp/META-INF/wsdl"
prefix="WEB-INF/classes/META-INF/wsdl"/>
<manifest>
- <attribute name="Dependencies"
value="org.jboss.ws.cxf.jbossws-cxf-client services"/>
+ <attribute name="Dependencies"
value="org.jboss.ws.common,org.jboss.ws.cxf.jbossws-cxf-client services"/>
</manifest>
</war>
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/endpoint/TestServlet.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/endpoint/TestServlet.java 2013-10-04
16:37:48 UTC (rev 17980)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/endpoint/TestServlet.java 2013-10-04
17:43:35 UTC (rev 17981)
@@ -26,6 +26,8 @@
import javax.servlet.http.HttpServlet;
import javax.xml.ws.Endpoint;
+import org.jboss.ws.common.utils.AddressUtils;
+
/**
* @author Magesh Kumar B <mageshbk(a)jboss.com> (C) 2011 Red Hat Inc.
*/
@@ -36,11 +38,7 @@
@Override
public void init(ServletConfig config) throws ServletException
{
- String hostName = System.getProperty("jboss.bind.address",
"localhost");
- if (hostName.startsWith(":"))
- {
- hostName = "[" + hostName + "]";
- }
+ String hostName =
toIPv6URLFormat(System.getProperty("jboss.bind.address",
"localhost"));
String serviceURL = "http://" + hostName +
":18080/HelloWorldService";
_endpoint = Endpoint.publish(serviceURL, new
HelloWorldImpl(Thread.currentThread().getContextClassLoader()));
}
@@ -50,4 +48,18 @@
{
_endpoint.stop();
}
+
+ private String toIPv6URLFormat(final String host)
+ {
+ boolean isIPv6URLFormatted = false;
+ if (host.startsWith("[") && host.endsWith("]")) {
+ isIPv6URLFormatted = true;
+ }
+ //return IPv6 URL formatted address
+ if (isIPv6URLFormatted) {
+ return host;
+ } else {
+ return AddressUtils.isValidIPv6Address(host) ? "[" + host +
"]" : host;
+ }
+ }
}
\ No newline at end of file
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/udp/TestServlet.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/udp/TestServlet.java 2013-10-04
16:37:48 UTC (rev 17980)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/udp/TestServlet.java 2013-10-04
17:43:35 UTC (rev 17981)
@@ -34,6 +34,7 @@
import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
+import org.jboss.ws.common.utils.AddressUtils;
@WebServlet(name = "TestServlet", urlPatterns = "/*")
public class TestServlet extends HttpServlet
@@ -77,11 +78,20 @@
}
private static String getHost() {
- String hostName = System.getProperty("jboss.bind.address",
"localhost");
- if (hostName.startsWith(":"))
- {
- hostName = "[" + hostName + "]";
+ return toIPv6URLFormat(System.getProperty("jboss.bind.address",
"localhost"));
+ }
+
+ private static String toIPv6URLFormat(final String host)
+ {
+ boolean isIPv6URLFormatted = false;
+ if (host.startsWith("[") && host.endsWith("]")) {
+ isIPv6URLFormatted = true;
}
- return hostName;
+ //return IPv6 URL formatted address
+ if (isIPv6URLFormatted) {
+ return host;
+ } else {
+ return AddressUtils.isValidIPv6Address(host) ? "[" + host +
"]" : host;
+ }
}
}
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/SampleSTS.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/SampleSTS.java 2013-10-04
16:37:48 UTC (rev 17980)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/SampleSTS.java 2013-10-04
17:43:35 UTC (rev 17981)
@@ -65,7 +65,9 @@
List<ServiceMBean> services = new LinkedList<ServiceMBean>();
StaticService service = new StaticService();
-
service.setEndpoints(Arrays.asList("http://localhost:(\\d)*/jaxws-samples-wsse-policy-trust/SecurityService",
"http://\\[::1\\]:(\\d)*/jaxws-samples-wsse-policy-trust/SecurityService"));
+
service.setEndpoints(Arrays.asList("http://localhost:(\\d)*/jaxws-samples-wsse-policy-trust/SecurityService",
+
"http://\\[::1\\]:(\\d)*/jaxws-samples-wsse-policy-trust/SecurityService",
+
"http://\\[0:0:0:0:0:0:0:1\\]:(\\d)*/jaxws-samples-wsse-policy-trust/SecurityService"));
services.add(service);
TokenIssueOperation issueOperation = new TokenIssueOperation();
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/ant-import/build-jars-jaxws.xml
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/ant-import/build-jars-jaxws.xml 2013-10-04
16:37:48 UTC (rev 17980)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/ant-import/build-jars-jaxws.xml 2013-10-04
17:43:35 UTC (rev 17981)
@@ -1193,6 +1193,9 @@
<webinf
dir="${tests.output.dir}/test-resources/jaxws/jbws3223/WEB-INF">
<include name="wsdl/**" />
</webinf>
+ <manifest>
+ <attribute name="Dependencies" value="org.jboss.ws.common"
/>
+ </manifest>
</war>
<!-- jaxws-jbws3250 -->
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/ant-import/build-samples-jaxws.xml
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/ant-import/build-samples-jaxws.xml 2013-10-04
16:37:48 UTC (rev 17980)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/ant-import/build-samples-jaxws.xml 2013-10-04
17:43:35 UTC (rev 17981)
@@ -562,6 +562,9 @@
<webinf dir="${tests.output.dir}/test-resources/publish/WEB-INF"
erroronmissingdir="false">
<include name="wsdl/**"/>
</webinf>
+ <manifest>
+ <attribute name="Dependencies" value="org.jboss.ws.common"
/>
+ </manifest>
</war>
<!-- management-recording-as7.jar -->
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3223/TestServlet.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3223/TestServlet.java 2013-10-04
16:37:48 UTC (rev 17980)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3223/TestServlet.java 2013-10-04
17:43:35 UTC (rev 17981)
@@ -31,6 +31,8 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import org.jboss.ws.common.utils.AddressUtils;
+
@SuppressWarnings("serial")
public class TestServlet extends HttpServlet
{
@@ -40,12 +42,7 @@
String param = req.getParameter("param");
boolean clCheck = Boolean.parseBoolean(req.getParameter("clCheck"));
Client client = new Client(clCheck);
- String jbossBindAddress = System.getProperty("jboss.bind.address",
"localhost");
- if (jbossBindAddress.startsWith(":"))
- {
- jbossBindAddress = "[" + jbossBindAddress + "]";
- }
- URL wsdlURL = new URL("http://" + jbossBindAddress +
":8080/jaxws-jbws3223?wsdl");
+ URL wsdlURL = new URL("http://" + getHost() +
":8080/jaxws-jbws3223?wsdl");
String retStr = client.run(param, wsdlURL);
// Return the result
@@ -54,5 +51,22 @@
pw.close();
}
+ private static String getHost() {
+ return toIPv6URLFormat(System.getProperty("jboss.bind.address",
"localhost"));
+ }
+ private static String toIPv6URLFormat(final String host)
+ {
+ boolean isIPv6URLFormatted = false;
+ if (host.startsWith("[") && host.endsWith("]")) {
+ isIPv6URLFormatted = true;
+ }
+ //return IPv6 URL formatted address
+ if (isIPv6URLFormatted) {
+ return host;
+ } else {
+ return AddressUtils.isValidIPv6Address(host) ? "[" + host +
"]" : host;
+ }
+ }
+
}
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/management/recording/MemoryBufferRecorderTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/management/recording/MemoryBufferRecorderTestCase.java 2013-10-04
16:37:48 UTC (rev 17980)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/management/recording/MemoryBufferRecorderTestCase.java 2013-10-04
17:43:35 UTC (rev 17981)
@@ -166,6 +166,7 @@
l.add("localhost");
l.add("127.0.0.1");
l.add("[::1]");
+ l.add("[0:0:0:0:0:0:0:1]");
HostFilter hostFilter = new HostFilter(l,false); //destination
RecordFilter[] filters = new RecordFilter[] {operationFilter, hostFilter};
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/publish/EndpointPublishServlet.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/publish/EndpointPublishServlet.java 2013-10-04
16:37:48 UTC (rev 17980)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/publish/EndpointPublishServlet.java 2013-10-04
17:43:35 UTC (rev 17981)
@@ -22,14 +22,8 @@
package org.jboss.test.ws.publish;
import java.io.IOException;
-import java.io.PrintWriter;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
import java.net.URL;
import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
import java.util.Map;
import java.util.ServiceLoader;
@@ -41,6 +35,7 @@
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
+import org.jboss.ws.common.utils.AddressUtils;
import org.jboss.wsf.spi.classloading.ClassLoaderProvider;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.metadata.webservices.PortComponentMetaData;
@@ -89,11 +84,7 @@
}
//call endpoint
- String jbossBindAddress = System.getProperty("jboss.bind.address",
"localhost");
- if (jbossBindAddress.startsWith(":"))
- {
- jbossBindAddress = "[" + jbossBindAddress + "]";
- }
+ String jbossBindAddress =
toIPv6URLFormat(System.getProperty("jboss.bind.address",
"localhost"));
invoke(new URL("http://" + jbossBindAddress +
":8080/ep-publish-test/pattern?wsdl"), new
QName("http://publish.ws.test.jboss.org/", "EndpointService"));
invoke(new URL("http://" + jbossBindAddress +
":8080/ep-publish-test/pattern2?wsdl"), new
QName("http://publish.ws.test.jboss.org/", "EndpointService2"));
invoke(new URL("http://" + jbossBindAddress +
":8080/ep-publish-test/pattern3?wsdl"), new
QName("http://publish.ws.test.jboss.org/", "EndpointService3"));
@@ -124,6 +115,20 @@
}
}
}
+
+ private static String toIPv6URLFormat(final String host)
+ {
+ boolean isIPv6URLFormatted = false;
+ if (host.startsWith("[") && host.endsWith("]")) {
+ isIPv6URLFormatted = true;
+ }
+ //return IPv6 URL formatted address
+ if (isIPv6URLFormatted) {
+ return host;
+ } else {
+ return AddressUtils.isValidIPv6Address(host) ? "[" + host +
"]" : host;
+ }
+ }
// See
https://issues.jboss.org/browse/JBWS-3579
//