[jbossws-commits] JBossWS SVN: r19374 - in stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test: java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust and 4 other directories.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Wed Jan 14 09:22:53 EST 2015


Author: asoldano
Date: 2015-01-14 09:22:53 -0500 (Wed, 14 Jan 2015)
New Revision: 19374

Removed:
   stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/shared/WSTrustAppUtils.java
Modified:
   stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/secconv/SecureConversationTestCase.java
   stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustTestCase.java
   stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/actas/ActAsServiceIface.java
   stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/actas/ActAsServiceImpl.java
   stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/onbehalfof/OnBehalfOfServiceIface.java
   stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/onbehalfof/OnBehalfOfServiceImpl.java
   stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/ActAsService_schema1.xsd
   stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/OnBehalfOfService_schema1.xsd
Log:
Explicitly pass target host/port to WS-Trust ActAs and OnBehalfOf test endpoints



Modified: stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/secconv/SecureConversationTestCase.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/secconv/SecureConversationTestCase.java	2015-01-14 13:43:26 UTC (rev 19373)
+++ stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/secconv/SecureConversationTestCase.java	2015-01-14 14:22:53 UTC (rev 19374)
@@ -94,7 +94,7 @@
    public void test() throws Exception
    {
       QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy", "SecurityService");
-      URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-samples-wsse-policy-secconv/SecureConversationService?wsdl");
+      URL wsdlURL = new URL("http://" + getServerHost() + ":" + getServerPort() + "/jaxws-samples-wsse-policy-secconv/SecureConversationService?wsdl");
       Service service = Service.create(wsdlURL, serviceName);
       ServiceIface proxy = (ServiceIface)service.getPort(ServiceIface.class);
       setupWsse(proxy, true);

Modified: stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustTestCase.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustTestCase.java	2015-01-14 13:43:26 UTC (rev 19373)
+++ stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustTestCase.java	2015-01-14 14:22:53 UTC (rev 19374)
@@ -132,7 +132,6 @@
          .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.actas.ActAsServiceIface.class)
          .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.actas.ActAsServiceImpl.class)
          .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.service.ServiceIface.class)
-         .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.shared.WSTrustAppUtils.class)
          .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/ActAsService.wsdl"), "wsdl/ActAsService.wsdl")
          .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/ActAsService_schema1.xsd"), "wsdl/ActAsService_schema1.xsd")
          .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/WEB-INF/actasstore.jks"), "classes/actasstore.jks")
@@ -155,7 +154,6 @@
          .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.onbehalfof.OnBehalfOfServiceIface.class)
          .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.onbehalfof.OnBehalfOfServiceImpl.class)
          .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.service.ServiceIface.class)
-         .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.shared.WSTrustAppUtils.class)
          .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/OnBehalfOfService.wsdl"), "wsdl/OnBehalfOfService.wsdl")
          .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/OnBehalfOfService_schema1.xsd"), "wsdl/OnBehalfOfService_schema1.xsd")
          .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/wsse/policy/trust/WEB-INF/actasstore.jks"), "classes/actasstore.jks")
@@ -412,7 +410,7 @@
 
          WSTrustTestUtils.setupWsseAndSTSClientActAs((BindingProvider) proxy, bus);
 
-         assertEquals("ActAs WS-Trust Hello World!", proxy.sayHello());
+         assertEquals("ActAs WS-Trust Hello World!", proxy.sayHello(getServerHost(), String.valueOf(getServerPort())));
       }
       finally
       {
@@ -447,7 +445,7 @@
          */
          WSTrustTestUtils.setupWsseAndSTSClientOnBehalfOf((BindingProvider) proxy, bus);
 
-         assertEquals("OnBehalfOf WS-Trust Hello World!", proxy.sayHello());
+         assertEquals("OnBehalfOf WS-Trust Hello World!", proxy.sayHello(getServerHost(), String.valueOf(getServerPort())));
       }
       finally
       {

Modified: stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/actas/ActAsServiceIface.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/actas/ActAsServiceIface.java	2015-01-14 13:43:26 UTC (rev 19373)
+++ stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/actas/ActAsServiceIface.java	2015-01-14 14:22:53 UTC (rev 19374)
@@ -35,5 +35,5 @@
 public interface ActAsServiceIface
 {
    @WebMethod
-   String sayHello();
+   String sayHello(String host, String port);
 }

Modified: stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/actas/ActAsServiceImpl.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/actas/ActAsServiceImpl.java	2015-01-14 13:43:26 UTC (rev 19373)
+++ stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/actas/ActAsServiceImpl.java	2015-01-14 14:22:53 UTC (rev 19374)
@@ -21,6 +21,15 @@
  */
 package org.jboss.test.ws.jaxws.samples.wsse.policy.trust.actas;
 
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Map;
+
+import javax.jws.WebService;
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusFactory;
 import org.apache.cxf.annotations.EndpointProperties;
@@ -28,16 +37,7 @@
 import org.apache.cxf.ws.security.SecurityConstants;
 import org.apache.cxf.ws.security.trust.STSClient;
 import org.jboss.test.ws.jaxws.samples.wsse.policy.trust.service.ServiceIface;
-import org.jboss.test.ws.jaxws.samples.wsse.policy.trust.shared.WSTrustAppUtils;
 
-import javax.jws.WebService;
-import javax.xml.namespace.QName;
-import javax.xml.ws.BindingProvider;
-import javax.xml.ws.Service;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Map;
-
 /**
  * User: rsearls at redhat.com
  * Date: 1/26/14
@@ -61,12 +61,12 @@
 
 public class ActAsServiceImpl implements ActAsServiceIface
 {
-   public String sayHello() {
+   public String sayHello(String host, String port) {
       Bus bus = BusFactory.newInstance().createBus();
       try {
          BusFactory.setThreadDefaultBus(bus);
 
-         final String serviceURL = "http://" + WSTrustAppUtils.getServerHost() + ":8080/jaxws-samples-wsse-policy-trust/SecurityService";
+         final String serviceURL = "http://" + host + ":" + port + "/jaxws-samples-wsse-policy-trust/SecurityService";
          final QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy", "SecurityService");
          final URL wsdlURL = new URL(serviceURL + "?wsdl");
          Service service = Service.create(wsdlURL, serviceName);

Modified: stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/onbehalfof/OnBehalfOfServiceIface.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/onbehalfof/OnBehalfOfServiceIface.java	2015-01-14 13:43:26 UTC (rev 19373)
+++ stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/onbehalfof/OnBehalfOfServiceIface.java	2015-01-14 14:22:53 UTC (rev 19374)
@@ -35,5 +35,5 @@
 public interface OnBehalfOfServiceIface
 {
    @WebMethod
-   String sayHello();
+   String sayHello(String host, String port);
 }

Modified: stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/onbehalfof/OnBehalfOfServiceImpl.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/onbehalfof/OnBehalfOfServiceImpl.java	2015-01-14 13:43:26 UTC (rev 19373)
+++ stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/onbehalfof/OnBehalfOfServiceImpl.java	2015-01-14 14:22:53 UTC (rev 19374)
@@ -28,7 +28,6 @@
 import org.apache.cxf.ws.security.SecurityConstants;
 import org.apache.cxf.ws.security.trust.STSClient;
 import org.jboss.test.ws.jaxws.samples.wsse.policy.trust.service.ServiceIface;
-import org.jboss.test.ws.jaxws.samples.wsse.policy.trust.shared.WSTrustAppUtils;
 
 import javax.jws.WebService;
 import javax.xml.namespace.QName;
@@ -60,12 +59,12 @@
 
 public class OnBehalfOfServiceImpl implements OnBehalfOfServiceIface
 {
-   public String sayHello() {
+   public String sayHello(String host, String port) {
       Bus bus = BusFactory.newInstance().createBus();
       try {
          BusFactory.setThreadDefaultBus(bus);
 
-         final String serviceURL = "http://" + WSTrustAppUtils.getServerHost() + ":8080/jaxws-samples-wsse-policy-trust/SecurityService";
+         final String serviceURL = "http://" + host + ":" + port + "/jaxws-samples-wsse-policy-trust/SecurityService";
          final QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy", "SecurityService");
          final URL wsdlURL = new URL(serviceURL + "?wsdl");
          Service service = Service.create(wsdlURL, serviceName);

Deleted: stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/shared/WSTrustAppUtils.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/shared/WSTrustAppUtils.java	2015-01-14 13:43:26 UTC (rev 19373)
+++ stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/shared/WSTrustAppUtils.java	2015-01-14 14:22:53 UTC (rev 19374)
@@ -1,64 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2012, 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.wsse.policy.trust.shared;
-
-import java.net.Inet6Address;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-
-/**
- *
- * User: rsearls
- * Date: 2/5/14
- */
-public class WSTrustAppUtils {
-
-   public static String getServerHost() {
-      final String host = System.getProperty("jboss.bind.address", "localhost");
-      return toIPv6URLFormat(host);
-   }
-
-   private static String toIPv6URLFormat(final String host)
-   {
-      try
-      {
-         if (host.startsWith("[") || host.startsWith(":"))
-         {
-            if (System.getProperty("java.net.preferIPv4Stack") == null)
-            {
-               throw new IllegalStateException("always provide java.net.preferIPv4Stack JVM property when using IPv6 address format");
-            }
-            if (System.getProperty("java.net.preferIPv6Addresses") == null)
-            {
-               throw new IllegalStateException("always provide java.net.preferIPv6Addresses JVM property when using IPv6 address format");
-            }
-         }
-         final boolean isIPv6Address = InetAddress.getByName(host) instanceof Inet6Address;
-         final boolean isIPv6Formatted = isIPv6Address && host.startsWith("[");
-         return isIPv6Address && !isIPv6Formatted ? "[" + host + "]" : host;
-      }
-      catch (final UnknownHostException e)
-      {
-         throw new RuntimeException(e);
-      }
-   }
-}

Modified: stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/ActAsService_schema1.xsd
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/ActAsService_schema1.xsd	2015-01-14 13:43:26 UTC (rev 19373)
+++ stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/ActAsService_schema1.xsd	2015-01-14 14:22:53 UTC (rev 19374)
@@ -8,7 +8,10 @@
   <xs:element name="sayHelloResponse" type="tns:sayHelloResponse"/>
 
   <xs:complexType name="sayHello">
-    <xs:sequence/>
+    <xs:sequence>
+      <xs:element name="host" type="xs:string" minOccurs="0"/>
+      <xs:element name="port" type="xs:string" minOccurs="0"/>
+    </xs:sequence>
   </xs:complexType>
 
   <xs:complexType name="sayHelloResponse">

Modified: stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/OnBehalfOfService_schema1.xsd
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/OnBehalfOfService_schema1.xsd	2015-01-14 13:43:26 UTC (rev 19373)
+++ stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/OnBehalfOfService_schema1.xsd	2015-01-14 14:22:53 UTC (rev 19374)
@@ -8,7 +8,10 @@
   <xs:element name="sayHelloResponse" type="tns:sayHelloResponse"/>
 
   <xs:complexType name="sayHello">
-    <xs:sequence/>
+    <xs:sequence>
+      <xs:element name="host" type="xs:string" minOccurs="0"/>
+      <xs:element name="port" type="xs:string" minOccurs="0"/>
+    </xs:sequence>
   </xs:complexType>
 
   <xs:complexType name="sayHelloResponse">



More information about the jbossws-commits mailing list