You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2011/10/21 13:55:31 UTC
svn commit: r1187308 [1/2] - in /cxf/trunk/services/sts:
sts-war/src/main/webapp/WEB-INF/wsdl/ systests/
systests/basic/src/test/java/org/apache/cxf/systest/sts/asymmetric/
systests/basic/src/test/java/org/apache/cxf/systest/sts/bearer/
systests/basic/...
Author: coheigea
Date: Fri Oct 21 11:55:29 2011
New Revision: 1187308
URL: http://svn.apache.org/viewvc?rev=1187308&view=rev
Log:
[CXF-3811] - Updated the basic STS system tests to use dynamic ports for the STS + enabled them
Modified:
cxf/trunk/services/sts/sts-war/src/main/webapp/WEB-INF/wsdl/ws-trust-1.4-service.wsdl
cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/asymmetric/AsymmetricBindingTest.java
cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/bearer/BearerTest.java
cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/common/TokenTestUtils.java
cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/intermediary_transformation/IntermediaryCachingPortTypeImpl.java
cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/intermediary_transformation/IntermediaryPortTypeImpl.java
cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/intermediary_transformation/IntermediaryTransformationCachingTest.java
cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/intermediary_transformation/IntermediaryTransformationTest.java
cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/issueunit/IssueUnitTest.java
cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/symmetric/SymmetricBindingTest.java
cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/transport/TransportBindingTest.java
cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/username_actas/UsernameActAsTest.java
cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/username_onbehalfof/UsernameOnBehalfOfTest.java
cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/x509_symmetric/X509SymmetricBindingTest.java
cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/bearer/cxf-service.xml
cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-encrypted-ut.xml
cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-transport.xml
cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-ut.xml
cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-x509.xml
cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/issueunit/cxf-client.xml
cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/transport/cxf-service.xml
cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/username_actas/cxf-client.xml
cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/username_onbehalfof/cxf-client.xml
cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/x509_symmetric/cxf-service.xml
cxf/trunk/services/sts/systests/pom.xml
Modified: cxf/trunk/services/sts/sts-war/src/main/webapp/WEB-INF/wsdl/ws-trust-1.4-service.wsdl
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-war/src/main/webapp/WEB-INF/wsdl/ws-trust-1.4-service.wsdl?rev=1187308&r1=1187307&r2=1187308&view=diff
==============================================================================
--- cxf/trunk/services/sts/sts-war/src/main/webapp/WEB-INF/wsdl/ws-trust-1.4-service.wsdl (original)
+++ cxf/trunk/services/sts/sts-war/src/main/webapp/WEB-INF/wsdl/ws-trust-1.4-service.wsdl Fri Oct 21 11:55:29 2011
@@ -438,7 +438,7 @@
</sp:ProtectionToken>
<sp:AlgorithmSuite>
<wsp:Policy>
- <sp:Basic256 />
+ <sp:Basic128 />
</wsp:Policy>
</sp:AlgorithmSuite>
<sp:Layout>
@@ -504,7 +504,7 @@
</sp:ProtectionToken>
<sp:AlgorithmSuite>
<wsp:Policy>
- <sp:Basic256 />
+ <sp:Basic128 />
</wsp:Policy>
</sp:AlgorithmSuite>
<sp:Layout>
Modified: cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/asymmetric/AsymmetricBindingTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/asymmetric/AsymmetricBindingTest.java?rev=1187308&r1=1187307&r2=1187308&view=diff
==============================================================================
--- cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/asymmetric/AsymmetricBindingTest.java (original)
+++ cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/asymmetric/AsymmetricBindingTest.java Fri Oct 21 11:55:29 2011
@@ -21,6 +21,7 @@ package org.apache.cxf.systest.sts.asymm
import java.net.URL;
import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
import javax.xml.ws.Service;
@@ -39,11 +40,16 @@ import org.junit.BeforeClass;
* the asymmetric binding.
*/
public class AsymmetricBindingTest extends AbstractBusClientServerTestBase {
+
+ static final String STSPORT = allocatePort(STSServer.class);
+ static final String STSPORT2 = allocatePort(STSServer.class, 2);
private static final String NAMESPACE = "http://www.example.org/contract/DoubleIt";
private static final QName SERVICE_QNAME = new QName(NAMESPACE, "DoubleItService");
private static final String PORT = allocatePort(Server.class);
+
+ private static boolean standalone;
@BeforeClass
public static void startServers() throws Exception {
@@ -55,6 +61,7 @@ public class AsymmetricBindingTest exten
);
String deployment = System.getProperty("sts.deployment");
if ("standalone".equals(deployment)) {
+ standalone = true;
assertTrue(
"Server failed to launch",
// run the server in the same process
@@ -79,8 +86,11 @@ public class AsymmetricBindingTest exten
QName portQName = new QName(NAMESPACE, "DoubleItAsymmetricSAML1Port");
DoubleItPortType asymmetricSaml1Port =
service.getPort(portQName, DoubleItPortType.class);
-
updateAddressPort(asymmetricSaml1Port, PORT);
+ if (standalone) {
+ TokenTestUtils.updateSTSPort((BindingProvider)asymmetricSaml1Port, STSPORT2);
+ }
+
doubleIt(asymmetricSaml1Port, 25);
}
@@ -99,8 +109,11 @@ public class AsymmetricBindingTest exten
QName portQName = new QName(NAMESPACE, "DoubleItAsymmetricSAML2Port");
DoubleItPortType asymmetricSaml2Port =
service.getPort(portQName, DoubleItPortType.class);
-
updateAddressPort(asymmetricSaml2Port, PORT);
+ if (standalone) {
+ TokenTestUtils.updateSTSPort((BindingProvider)asymmetricSaml2Port, STSPORT2);
+ }
+
doubleIt(asymmetricSaml2Port, 30);
TokenTestUtils.verifyToken(asymmetricSaml2Port);
@@ -121,8 +134,11 @@ public class AsymmetricBindingTest exten
QName portQName = new QName(NAMESPACE, "DoubleItAsymmetricSAML1EncryptedPort");
DoubleItPortType asymmetricSaml1EncryptedPort =
service.getPort(portQName, DoubleItPortType.class);
-
updateAddressPort(asymmetricSaml1EncryptedPort, PORT);
+ if (standalone) {
+ TokenTestUtils.updateSTSPort((BindingProvider)asymmetricSaml1EncryptedPort, STSPORT2);
+ }
+
doubleIt(asymmetricSaml1EncryptedPort, 40);
}
Modified: cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/bearer/BearerTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/bearer/BearerTest.java?rev=1187308&r1=1187307&r2=1187308&view=diff
==============================================================================
--- cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/bearer/BearerTest.java (original)
+++ cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/bearer/BearerTest.java Fri Oct 21 11:55:29 2011
@@ -23,6 +23,7 @@ import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.ws.BindingProvider;
import javax.xml.ws.Service;
import org.w3c.dom.Element;
@@ -32,6 +33,7 @@ import org.apache.cxf.bus.spring.SpringB
import org.apache.cxf.endpoint.Client;
import org.apache.cxf.endpoint.Endpoint;
import org.apache.cxf.frontend.ClientProxy;
+import org.apache.cxf.systest.sts.common.TokenTestUtils;
import org.apache.cxf.systest.sts.deployment.STSServer;
import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
import org.apache.cxf.ws.security.SecurityConstants;
@@ -50,10 +52,15 @@ import org.junit.BeforeClass;
*/
public class BearerTest extends AbstractBusClientServerTestBase {
+ static final String STSPORT = allocatePort(STSServer.class);
+ static final String STSPORT2 = allocatePort(STSServer.class, 2);
+
private static final String NAMESPACE = "http://www.example.org/contract/DoubleIt";
private static final QName SERVICE_QNAME = new QName(NAMESPACE, "DoubleItService");
private static final String PORT = allocatePort(Server.class);
+
+ private static boolean standalone;
@BeforeClass
public static void startServers() throws Exception {
@@ -65,6 +72,7 @@ public class BearerTest extends Abstract
);
String deployment = System.getProperty("sts.deployment");
if ("standalone".equals(deployment)) {
+ standalone = true;
assertTrue(
"Server failed to launch",
// run the server in the same process
@@ -89,8 +97,11 @@ public class BearerTest extends Abstract
QName portQName = new QName(NAMESPACE, "DoubleItTransportSAML2BearerPort");
DoubleItPortType transportSaml2Port =
service.getPort(portQName, DoubleItPortType.class);
-
updateAddressPort(transportSaml2Port, PORT);
+ if (standalone) {
+ TokenTestUtils.updateSTSPort((BindingProvider)transportSaml2Port, STSPORT);
+ }
+
doubleIt(transportSaml2Port, 45);
}
@@ -110,6 +121,9 @@ public class BearerTest extends Abstract
DoubleItPortType transportSaml2Port =
service.getPort(portQName, DoubleItPortType.class);
updateAddressPort(transportSaml2Port, PORT);
+ if (standalone) {
+ TokenTestUtils.updateSTSPort((BindingProvider)transportSaml2Port, STSPORT);
+ }
//
// Create a SAML2 Bearer Assertion and add it to the TokenStore so that the
Modified: cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/common/TokenTestUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/common/TokenTestUtils.java?rev=1187308&r1=1187307&r2=1187308&view=diff
==============================================================================
--- cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/common/TokenTestUtils.java (original)
+++ cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/common/TokenTestUtils.java Fri Oct 21 11:55:29 2011
@@ -20,6 +20,8 @@ package org.apache.cxf.systest.sts.commo
import java.util.List;
+import javax.xml.ws.BindingProvider;
+
import org.w3c.dom.Element;
import org.apache.cxf.endpoint.Client;
@@ -70,5 +72,17 @@ public final class TokenTestUtils {
// expected
}
}
+
+ public static void updateSTSPort(BindingProvider p, String port) {
+ STSClient stsClient = (STSClient)p.getRequestContext().get(SecurityConstants.STS_CLIENT);
+ if (stsClient != null) {
+ String location = stsClient.getWsdlLocation();
+ if (location.contains("8080")) {
+ stsClient.setWsdlLocation(location.replace("8080", port));
+ } else if (location.contains("8443")) {
+ stsClient.setWsdlLocation(location.replace("8443", port));
+ }
+ }
+ }
}
Modified: cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/intermediary_transformation/IntermediaryCachingPortTypeImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/intermediary_transformation/IntermediaryCachingPortTypeImpl.java?rev=1187308&r1=1187307&r2=1187308&view=diff
==============================================================================
--- cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/intermediary_transformation/IntermediaryCachingPortTypeImpl.java (original)
+++ cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/intermediary_transformation/IntermediaryCachingPortTypeImpl.java Fri Oct 21 11:55:29 2011
@@ -20,6 +20,7 @@ package org.apache.cxf.systest.sts.inter
import java.net.URL;
import java.security.Principal;
+import java.util.Map;
import javax.annotation.Resource;
import javax.jws.WebService;
@@ -65,6 +66,22 @@ public class IntermediaryCachingPortType
} catch (Exception ex) {
ex.printStackTrace();
}
+ if ("standalone".equals(System.getProperty("sts.deployment"))) {
+ Map<String, Object> context = ((BindingProvider)transportPort).getRequestContext();
+ STSClient stsClient = (STSClient)context.get(SecurityConstants.STS_CLIENT);
+ if (stsClient != null) {
+ String location = stsClient.getWsdlLocation();
+ if (location.contains("8080")) {
+ stsClient.setWsdlLocation(
+ location.replace("8080", IntermediaryTransformationCachingTest.STSPORT2)
+ );
+ } else if (location.contains("8443")) {
+ stsClient.setWsdlLocation(
+ location.replace("8443", IntermediaryTransformationCachingTest.STSPORT)
+ );
+ }
+ }
+ }
}
Principal pr = wsc.getUserPrincipal();
Modified: cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/intermediary_transformation/IntermediaryPortTypeImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/intermediary_transformation/IntermediaryPortTypeImpl.java?rev=1187308&r1=1187307&r2=1187308&view=diff
==============================================================================
--- cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/intermediary_transformation/IntermediaryPortTypeImpl.java (original)
+++ cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/intermediary_transformation/IntermediaryPortTypeImpl.java Fri Oct 21 11:55:29 2011
@@ -20,15 +20,19 @@ package org.apache.cxf.systest.sts.inter
import java.net.URL;
import java.security.Principal;
+import java.util.Map;
import javax.annotation.Resource;
import javax.jws.WebService;
import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
import javax.xml.ws.Service;
import javax.xml.ws.WebServiceContext;
import org.apache.cxf.feature.Features;
import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
+import org.apache.cxf.ws.security.SecurityConstants;
+import org.apache.cxf.ws.security.trust.STSClient;
import org.example.contract.doubleit.DoubleItPortType;
import org.junit.Assert;
@@ -61,6 +65,23 @@ public class IntermediaryPortTypeImpl ex
ex.printStackTrace();
}
+ if ("standalone".equals(System.getProperty("sts.deployment"))) {
+ Map<String, Object> context = ((BindingProvider)transportPort).getRequestContext();
+ STSClient stsClient = (STSClient)context.get(SecurityConstants.STS_CLIENT);
+ if (stsClient != null) {
+ String location = stsClient.getWsdlLocation();
+ if (location.contains("8080")) {
+ stsClient.setWsdlLocation(
+ location.replace("8080", IntermediaryTransformationTest.STSPORT2)
+ );
+ } else if (location.contains("8443")) {
+ stsClient.setWsdlLocation(
+ location.replace("8443", IntermediaryTransformationTest.STSPORT)
+ );
+ }
+ }
+ }
+
return transportPort.doubleIt(numberToDouble);
}
Modified: cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/intermediary_transformation/IntermediaryTransformationCachingTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/intermediary_transformation/IntermediaryTransformationCachingTest.java?rev=1187308&r1=1187307&r2=1187308&view=diff
==============================================================================
--- cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/intermediary_transformation/IntermediaryTransformationCachingTest.java (original)
+++ cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/intermediary_transformation/IntermediaryTransformationCachingTest.java Fri Oct 21 11:55:29 2011
@@ -21,10 +21,12 @@ package org.apache.cxf.systest.sts.inter
import java.net.URL;
import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
import javax.xml.ws.Service;
import org.apache.cxf.Bus;
import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.systest.sts.common.TokenTestUtils;
import org.apache.cxf.systest.sts.deployment.STSServer;
import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
import org.example.contract.doubleit.DoubleItPortType;
@@ -40,12 +42,17 @@ import org.junit.BeforeClass;
*/
public class IntermediaryTransformationCachingTest extends AbstractBusClientServerTestBase {
+ static final String STSPORT = allocatePort(STSServer.class);
+ static final String STSPORT2 = allocatePort(STSServer.class, 2);
+
static final String PORT2 = allocatePort(Server.class, 2);
private static final String NAMESPACE = "http://www.example.org/contract/DoubleIt";
private static final QName SERVICE_QNAME = new QName(NAMESPACE, "DoubleItService");
private static final String PORT = allocatePort(Intermediary.class);
+
+ private static boolean standalone;
@BeforeClass
public static void startServers() throws Exception {
@@ -63,6 +70,7 @@ public class IntermediaryTransformationC
);
String deployment = System.getProperty("sts.deployment");
if ("standalone".equals(deployment)) {
+ standalone = true;
assertTrue(
"Server failed to launch",
// run the server in the same process
@@ -88,6 +96,9 @@ public class IntermediaryTransformationC
DoubleItPortType transportPort =
service.getPort(portQName, DoubleItPortType.class);
updateAddressPort(transportPort, PORT);
+ if (standalone) {
+ TokenTestUtils.updateSTSPort((BindingProvider)transportPort, STSPORT);
+ }
// Make initial successful invocation
doubleIt(transportPort, 25);
Modified: cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/intermediary_transformation/IntermediaryTransformationTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/intermediary_transformation/IntermediaryTransformationTest.java?rev=1187308&r1=1187307&r2=1187308&view=diff
==============================================================================
--- cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/intermediary_transformation/IntermediaryTransformationTest.java (original)
+++ cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/intermediary_transformation/IntermediaryTransformationTest.java Fri Oct 21 11:55:29 2011
@@ -21,10 +21,12 @@ package org.apache.cxf.systest.sts.inter
import java.net.URL;
import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
import javax.xml.ws.Service;
import org.apache.cxf.Bus;
import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.systest.sts.common.TokenTestUtils;
import org.apache.cxf.systest.sts.deployment.STSServer;
import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
@@ -41,12 +43,17 @@ import org.junit.BeforeClass;
*/
public class IntermediaryTransformationTest extends AbstractBusClientServerTestBase {
+ static final String STSPORT = allocatePort(STSServer.class);
+ static final String STSPORT2 = allocatePort(STSServer.class, 2);
+
static final String PORT2 = allocatePort(Server.class, 2);
private static final String NAMESPACE = "http://www.example.org/contract/DoubleIt";
private static final QName SERVICE_QNAME = new QName(NAMESPACE, "DoubleItService");
private static final String PORT = allocatePort(Intermediary.class);
+
+ private static boolean standalone;
@BeforeClass
public static void startServers() throws Exception {
@@ -64,6 +71,7 @@ public class IntermediaryTransformationT
);
String deployment = System.getProperty("sts.deployment");
if ("standalone".equals(deployment)) {
+ standalone = true;
assertTrue(
"Server failed to launch",
// run the server in the same process
@@ -89,6 +97,9 @@ public class IntermediaryTransformationT
DoubleItPortType transportPort =
service.getPort(portQName, DoubleItPortType.class);
updateAddressPort(transportPort, PORT);
+ if (standalone) {
+ TokenTestUtils.updateSTSPort((BindingProvider)transportPort, STSPORT);
+ }
doubleIt(transportPort, 25);
}
@@ -109,6 +120,9 @@ public class IntermediaryTransformationT
DoubleItPortType transportPort =
service.getPort(portQName, DoubleItPortType.class);
updateAddressPort(transportPort, PORT);
+ if (standalone) {
+ TokenTestUtils.updateSTSPort((BindingProvider)transportPort, STSPORT);
+ }
try {
doubleIt(transportPort, 30);
Modified: cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/issueunit/IssueUnitTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/issueunit/IssueUnitTest.java?rev=1187308&r1=1187307&r2=1187308&view=diff
==============================================================================
--- cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/issueunit/IssueUnitTest.java (original)
+++ cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/issueunit/IssueUnitTest.java Fri Oct 21 11:55:29 2011
@@ -58,6 +58,9 @@ import org.junit.BeforeClass;
*/
public class IssueUnitTest extends AbstractBusClientServerTestBase {
+ static final String STSPORT = allocatePort(STSServer.class);
+ static final String STSPORT2 = allocatePort(STSServer.class, 2);
+
private static final String SAML1_TOKEN_TYPE =
"http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1";
private static final String SAML2_TOKEN_TYPE =
@@ -71,10 +74,13 @@ public class IssueUnitTest extends Abstr
private static final String DEFAULT_ADDRESS =
"https://localhost:8081/doubleit/services/doubleittransportsaml1";
+ private static boolean standalone;
+
@BeforeClass
public static void startServers() throws Exception {
String deployment = System.getProperty("sts.deployment");
if ("standalone".equals(deployment)) {
+ standalone = true;
assertTrue(
"Server failed to launch",
// run the server in the same process
@@ -363,7 +369,11 @@ public class IssueUnitTest extends Abstr
String context
) throws Exception {
STSClient stsClient = new STSClient(bus);
- stsClient.setWsdlLocation("https://localhost:8443/SecurityTokenService/Transport?wsdl");
+ String port = "8443";
+ if (standalone) {
+ port = STSPORT;
+ }
+ stsClient.setWsdlLocation("https://localhost:" + port + "/SecurityTokenService/Transport?wsdl");
stsClient.setServiceName("{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}SecurityTokenService");
stsClient.setEndpointName("{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}Transport_Port");
@@ -401,7 +411,11 @@ public class IssueUnitTest extends Abstr
String endpointAddress
) throws Exception {
STSClient stsClient = new STSClient(bus);
- stsClient.setWsdlLocation("https://localhost:8443/SecurityTokenService/Transport?wsdl");
+ String port = "8443";
+ if (standalone) {
+ port = STSPORT;
+ }
+ stsClient.setWsdlLocation("https://localhost:" + port + "/SecurityTokenService/Transport?wsdl");
stsClient.setServiceName("{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}SecurityTokenService");
stsClient.setEndpointName("{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}Transport_Port");
Modified: cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/symmetric/SymmetricBindingTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/symmetric/SymmetricBindingTest.java?rev=1187308&r1=1187307&r2=1187308&view=diff
==============================================================================
--- cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/symmetric/SymmetricBindingTest.java (original)
+++ cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/symmetric/SymmetricBindingTest.java Fri Oct 21 11:55:29 2011
@@ -21,6 +21,7 @@ package org.apache.cxf.systest.sts.symme
import java.net.URL;
import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
import javax.xml.ws.Service;
@@ -40,11 +41,16 @@ import org.junit.BeforeClass;
*/
public class SymmetricBindingTest extends AbstractBusClientServerTestBase {
+ static final String STSPORT = allocatePort(STSServer.class);
+ static final String STSPORT2 = allocatePort(STSServer.class, 2);
+
private static final String NAMESPACE = "http://www.example.org/contract/DoubleIt";
private static final QName SERVICE_QNAME = new QName(NAMESPACE, "DoubleItService");
private static final String PORT = allocatePort(Server.class);
+ private static boolean standalone;
+
@BeforeClass
public static void startServers() throws Exception {
assertTrue(
@@ -55,6 +61,7 @@ public class SymmetricBindingTest extend
);
String deployment = System.getProperty("sts.deployment");
if ("standalone".equals(deployment)) {
+ standalone = true;
assertTrue(
"Server failed to launch",
// run the server in the same process
@@ -79,6 +86,9 @@ public class SymmetricBindingTest extend
DoubleItPortType symmetricSaml1Port =
service.getPort(portQName, DoubleItPortType.class);
updateAddressPort(symmetricSaml1Port, PORT);
+ if (standalone) {
+ TokenTestUtils.updateSTSPort((BindingProvider)symmetricSaml1Port, STSPORT2);
+ }
doubleIt(symmetricSaml1Port, 25);
@@ -101,6 +111,9 @@ public class SymmetricBindingTest extend
DoubleItPortType symmetricSaml2Port =
service.getPort(portQName, DoubleItPortType.class);
updateAddressPort(symmetricSaml2Port, PORT);
+ if (standalone) {
+ TokenTestUtils.updateSTSPort((BindingProvider)symmetricSaml2Port, STSPORT2);
+ }
doubleIt(symmetricSaml2Port, 30);
Modified: cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/transport/TransportBindingTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/transport/TransportBindingTest.java?rev=1187308&r1=1187307&r2=1187308&view=diff
==============================================================================
--- cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/transport/TransportBindingTest.java (original)
+++ cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/transport/TransportBindingTest.java Fri Oct 21 11:55:29 2011
@@ -21,10 +21,12 @@ package org.apache.cxf.systest.sts.trans
import java.net.URL;
import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
import javax.xml.ws.Service;
import org.apache.cxf.Bus;
import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.systest.sts.common.TokenTestUtils;
import org.apache.cxf.systest.sts.deployment.STSServer;
import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
@@ -37,11 +39,16 @@ import org.junit.BeforeClass;
*/
public class TransportBindingTest extends AbstractBusClientServerTestBase {
+ static final String STSPORT = allocatePort(STSServer.class);
+ static final String STSPORT2 = allocatePort(STSServer.class, 2);
+
private static final String NAMESPACE = "http://www.example.org/contract/DoubleIt";
private static final QName SERVICE_QNAME = new QName(NAMESPACE, "DoubleItService");
private static final String PORT = allocatePort(Server.class);
+ private static boolean standalone;
+
@BeforeClass
public static void startServers() throws Exception {
assertTrue(
@@ -52,6 +59,7 @@ public class TransportBindingTest extend
);
String deployment = System.getProperty("sts.deployment");
if ("standalone".equals(deployment)) {
+ standalone = true;
assertTrue(
"Server failed to launch",
// run the server in the same process
@@ -77,6 +85,9 @@ public class TransportBindingTest extend
DoubleItPortType transportSaml1Port =
service.getPort(portQName, DoubleItPortType.class);
updateAddressPort(transportSaml1Port, PORT);
+ if (standalone) {
+ TokenTestUtils.updateSTSPort((BindingProvider)transportSaml1Port, STSPORT);
+ }
doubleIt(transportSaml1Port, 25);
@@ -98,6 +109,9 @@ public class TransportBindingTest extend
DoubleItPortType transportSaml2Port =
service.getPort(portQName, DoubleItPortType.class);
updateAddressPort(transportSaml2Port, PORT);
+ if (standalone) {
+ TokenTestUtils.updateSTSPort((BindingProvider)transportSaml2Port, STSPORT);
+ }
doubleIt(transportSaml2Port, 30);
}
@@ -124,6 +138,9 @@ public class TransportBindingTest extend
DoubleItPortType transportSaml1Port =
service.getPort(portQName, DoubleItPortType.class);
updateAddressPort(transportSaml1Port, PORT);
+ if (standalone) {
+ TokenTestUtils.updateSTSPort((BindingProvider)transportSaml1Port, STSPORT);
+ }
try {
doubleIt(transportSaml1Port, 35);
@@ -149,6 +166,9 @@ public class TransportBindingTest extend
DoubleItPortType transportSaml1Port =
service.getPort(portQName, DoubleItPortType.class);
updateAddressPort(transportSaml1Port, PORT);
+ if (standalone) {
+ TokenTestUtils.updateSTSPort((BindingProvider)transportSaml1Port, STSPORT);
+ }
doubleIt(transportSaml1Port, 40);
}
@@ -174,6 +194,9 @@ public class TransportBindingTest extend
DoubleItPortType transportSaml1Port =
service.getPort(portQName, DoubleItPortType.class);
updateAddressPort(transportSaml1Port, PORT);
+ if (standalone) {
+ TokenTestUtils.updateSTSPort((BindingProvider)transportSaml1Port, STSPORT);
+ }
try {
doubleIt(transportSaml1Port, 35);
Modified: cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/username_actas/UsernameActAsTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/username_actas/UsernameActAsTest.java?rev=1187308&r1=1187307&r2=1187308&view=diff
==============================================================================
--- cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/username_actas/UsernameActAsTest.java (original)
+++ cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/username_actas/UsernameActAsTest.java Fri Oct 21 11:55:29 2011
@@ -26,6 +26,7 @@ import javax.xml.ws.Service;
import org.apache.cxf.Bus;
import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.systest.sts.common.TokenTestUtils;
import org.apache.cxf.systest.sts.deployment.STSServer;
import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
import org.apache.cxf.ws.security.SecurityConstants;
@@ -45,11 +46,16 @@ import org.junit.BeforeClass;
*/
public class UsernameActAsTest extends AbstractBusClientServerTestBase {
+ static final String STSPORT = allocatePort(STSServer.class);
+ static final String STSPORT2 = allocatePort(STSServer.class, 2);
+
private static final String NAMESPACE = "http://www.example.org/contract/DoubleIt";
private static final QName SERVICE_QNAME = new QName(NAMESPACE, "DoubleItService");
private static final String PORT = allocatePort(Server.class);
+ private static boolean standalone;
+
@BeforeClass
public static void startServers() throws Exception {
assertTrue(
@@ -60,6 +66,7 @@ public class UsernameActAsTest extends A
);
String deployment = System.getProperty("sts.deployment");
if ("standalone".equals(deployment)) {
+ standalone = true;
assertTrue(
"Server failed to launch",
// run the server in the same process
@@ -82,26 +89,32 @@ public class UsernameActAsTest extends A
URL wsdl = UsernameActAsTest.class.getResource("DoubleIt.wsdl");
Service service = Service.create(wsdl, SERVICE_QNAME);
QName portQName = new QName(NAMESPACE, "DoubleItAsymmetricSAML2BearerPort");
- DoubleItPortType transportPort =
+ DoubleItPortType bearerPort =
service.getPort(portQName, DoubleItPortType.class);
- updateAddressPort(transportPort, PORT);
-
+ updateAddressPort(bearerPort, PORT);
+ if (standalone) {
+ TokenTestUtils.updateSTSPort((BindingProvider)bearerPort, STSPORT2);
+ }
+
// Transport port
- ((BindingProvider)transportPort).getRequestContext().put(
+ ((BindingProvider)bearerPort).getRequestContext().put(
"ws-security.username", "alice"
);
- doubleIt(transportPort, 25);
+ doubleIt(bearerPort, 25);
- DoubleItPortType transportPort2 =
+ DoubleItPortType bearerPort2 =
service.getPort(portQName, DoubleItPortType.class);
- updateAddressPort(transportPort2, PORT);
+ updateAddressPort(bearerPort2, PORT);
+ if (standalone) {
+ TokenTestUtils.updateSTSPort((BindingProvider)bearerPort2, STSPORT2);
+ }
- ((BindingProvider)transportPort2).getRequestContext().put(
+ ((BindingProvider)bearerPort2).getRequestContext().put(
"ws-security.username", "eve"
);
// This time we expect a failure as the server validator doesn't accept "eve".
try {
- doubleIt(transportPort2, 30);
+ doubleIt(bearerPort2, 30);
fail("Failure expected on an unknown user");
} catch (Exception ex) {
// expected
@@ -128,46 +141,52 @@ public class UsernameActAsTest extends A
//
// Proxy no. 1
//
- DoubleItPortType transportPort =
+ DoubleItPortType bearerPort =
service.getPort(portQName, DoubleItPortType.class);
- updateAddressPort(transportPort, PORT);
+ updateAddressPort(bearerPort, PORT);
+ if (standalone) {
+ TokenTestUtils.updateSTSPort((BindingProvider)bearerPort, STSPORT2);
+ }
TokenStore tokenStore = new MemoryTokenStore();
- ((BindingProvider)transportPort).getRequestContext().put(
+ ((BindingProvider)bearerPort).getRequestContext().put(
TokenStore.class.getName(), tokenStore
);
// Make a successful invocation
- ((BindingProvider)transportPort).getRequestContext().put(
+ ((BindingProvider)bearerPort).getRequestContext().put(
"ws-security.username", "alice"
);
- doubleIt(transportPort, 25);
+ doubleIt(bearerPort, 25);
// Change the STSClient so that it can no longer find the STS
STSClient stsClient = new STSClient(bus);
stsClient.setOnBehalfOf(new WSSUsernameCallbackHandler());
- BindingProvider p = (BindingProvider)transportPort;
+ BindingProvider p = (BindingProvider)bearerPort;
p.getRequestContext().put(SecurityConstants.STS_CLIENT, stsClient);
// This invocation should be successful as the token is cached
- doubleIt(transportPort, 25);
+ doubleIt(bearerPort, 25);
//
// Proxy no. 2
//
- DoubleItPortType transportPort2 =
+ DoubleItPortType bearerPort2 =
service.getPort(portQName, DoubleItPortType.class);
- updateAddressPort(transportPort2, PORT);
+ updateAddressPort(bearerPort2, PORT);
+ if (standalone) {
+ TokenTestUtils.updateSTSPort((BindingProvider)bearerPort2, STSPORT2);
+ }
// Change the STSClient so that it can no longer find the STS
stsClient = new STSClient(bus);
stsClient.setOnBehalfOf(new WSSUsernameCallbackHandler());
- p = (BindingProvider)transportPort2;
+ p = (BindingProvider)bearerPort2;
p.getRequestContext().put(SecurityConstants.STS_CLIENT, stsClient);
// This should fail as the cache is not being used
try {
- doubleIt(transportPort2, 40);
+ doubleIt(bearerPort2, 40);
fail("Failure expected as the token is not stored in the cache");
} catch (Exception ex) {
// expected
@@ -178,12 +197,12 @@ public class UsernameActAsTest extends A
// Make another invocation - this should succeed as the token is cached
p.getRequestContext().put("ws-security.username", "alice");
- doubleIt(transportPort2, 40);
+ doubleIt(bearerPort2, 40);
// Reset the cache - this invocation should fail
p.getRequestContext().put(TokenStore.class.getName(), new MemoryTokenStore());
try {
- doubleIt(transportPort2, 40);
+ doubleIt(bearerPort2, 40);
fail("Failure expected as the cache is reset");
} catch (Exception ex) {
// expected
@@ -207,31 +226,34 @@ public class UsernameActAsTest extends A
Service service = Service.create(wsdl, SERVICE_QNAME);
QName portQName = new QName(NAMESPACE, "DoubleItAsymmetricSAML2BearerPort");
- DoubleItPortType transportPort =
+ DoubleItPortType bearerPort =
service.getPort(portQName, DoubleItPortType.class);
- updateAddressPort(transportPort, PORT);
+ updateAddressPort(bearerPort, PORT);
+ if (standalone) {
+ TokenTestUtils.updateSTSPort((BindingProvider)bearerPort, STSPORT2);
+ }
// Disable storing tokens per-proxy
- ((BindingProvider)transportPort).getRequestContext().put(
+ ((BindingProvider)bearerPort).getRequestContext().put(
SecurityConstants.CACHE_ISSUED_TOKEN_IN_ENDPOINT, "false"
);
// Make a successful invocation
- ((BindingProvider)transportPort).getRequestContext().put(
+ ((BindingProvider)bearerPort).getRequestContext().put(
"ws-security.username", "alice"
);
- doubleIt(transportPort, 25);
+ doubleIt(bearerPort, 25);
- ((BindingProvider)transportPort).getRequestContext().put(
+ ((BindingProvider)bearerPort).getRequestContext().put(
"ws-security.username", "bob"
);
- doubleIt(transportPort, 30);
+ doubleIt(bearerPort, 30);
- ((BindingProvider)transportPort).getRequestContext().put(
+ ((BindingProvider)bearerPort).getRequestContext().put(
"ws-security.username", "eve"
);
try {
- doubleIt(transportPort, 30);
+ doubleIt(bearerPort, 30);
fail("Failure expected on a bad user");
} catch (Exception ex) {
//
@@ -240,25 +262,25 @@ public class UsernameActAsTest extends A
// Change the STSClient so that it can no longer find the STS
STSClient stsClient = new STSClient(bus);
stsClient.setOnBehalfOf(new WSSUsernameCallbackHandler());
- BindingProvider p = (BindingProvider)transportPort;
+ BindingProvider p = (BindingProvider)bearerPort;
p.getRequestContext().put(SecurityConstants.STS_CLIENT, stsClient);
// Make a successful invocation
- ((BindingProvider)transportPort).getRequestContext().put(
+ ((BindingProvider)bearerPort).getRequestContext().put(
"ws-security.username", "alice"
);
- doubleIt(transportPort, 25);
+ doubleIt(bearerPort, 25);
- ((BindingProvider)transportPort).getRequestContext().put(
+ ((BindingProvider)bearerPort).getRequestContext().put(
"ws-security.username", "bob"
);
- doubleIt(transportPort, 30);
+ doubleIt(bearerPort, 30);
- ((BindingProvider)transportPort).getRequestContext().put(
+ ((BindingProvider)bearerPort).getRequestContext().put(
"ws-security.username", "eve2"
);
try {
- doubleIt(transportPort, 30);
+ doubleIt(bearerPort, 30);
fail("Failure expected on a bad user");
} catch (Exception ex) {
//
@@ -266,11 +288,11 @@ public class UsernameActAsTest extends A
// Reset the cache - this invocation should fail
p.getRequestContext().put(TokenStore.class.getName(), new MemoryTokenStore());
- ((BindingProvider)transportPort).getRequestContext().put(
+ ((BindingProvider)bearerPort).getRequestContext().put(
"ws-security.username", "alice"
);
try {
- doubleIt(transportPort, 30);
+ doubleIt(bearerPort, 30);
fail("Failure expected");
} catch (Exception ex) {
//
@@ -294,35 +316,38 @@ public class UsernameActAsTest extends A
Service service = Service.create(wsdl, SERVICE_QNAME);
QName portQName = new QName(NAMESPACE, "DoubleItAsymmetricSAML2BearerPort");
- DoubleItPortType transportPort =
+ DoubleItPortType bearerPort =
service.getPort(portQName, DoubleItPortType.class);
- updateAddressPort(transportPort, PORT);
+ updateAddressPort(bearerPort, PORT);
+ if (standalone) {
+ TokenTestUtils.updateSTSPort((BindingProvider)bearerPort, STSPORT2);
+ }
// Disable storing tokens per-proxy
- ((BindingProvider)transportPort).getRequestContext().put(
+ ((BindingProvider)bearerPort).getRequestContext().put(
SecurityConstants.CACHE_ISSUED_TOKEN_IN_ENDPOINT, "false"
);
// Make a successful invocation
- ((BindingProvider)transportPort).getRequestContext().put(
+ ((BindingProvider)bearerPort).getRequestContext().put(
"ws-security.username", "alice"
);
- BindingProvider p = (BindingProvider)transportPort;
+ BindingProvider p = (BindingProvider)bearerPort;
p.getRequestContext().put(
SecurityConstants.STS_APPLIES_TO,
"http://localhost:" + PORT + "/doubleit/services/doubleitasymmetricnew"
);
- doubleIt(transportPort, 25);
+ doubleIt(bearerPort, 25);
// Make a successful invocation
- ((BindingProvider)transportPort).getRequestContext().put(
+ ((BindingProvider)bearerPort).getRequestContext().put(
"ws-security.username", "bob"
);
p.getRequestContext().put(
SecurityConstants.STS_APPLIES_TO,
"http://localhost:" + PORT + "/doubleit/services/doubleitasymmetricnew2"
);
- doubleIt(transportPort, 25);
+ doubleIt(bearerPort, 25);
// Change the STSClient so that it can no longer find the STS
STSClient stsClient = new STSClient(bus);
@@ -330,27 +355,27 @@ public class UsernameActAsTest extends A
p.getRequestContext().put(SecurityConstants.STS_CLIENT, stsClient);
// Make a successful invocation - should work as token is cached
- ((BindingProvider)transportPort).getRequestContext().put(
+ ((BindingProvider)bearerPort).getRequestContext().put(
"ws-security.username", "alice"
);
p.getRequestContext().put(
SecurityConstants.STS_APPLIES_TO,
"http://localhost:" + PORT + "/doubleit/services/doubleitasymmetricnew"
);
- doubleIt(transportPort, 25);
+ doubleIt(bearerPort, 25);
// Make a successful invocation - should work as token is cached
- ((BindingProvider)transportPort).getRequestContext().put(
+ ((BindingProvider)bearerPort).getRequestContext().put(
"ws-security.username", "bob"
);
p.getRequestContext().put(
SecurityConstants.STS_APPLIES_TO,
"http://localhost:" + PORT + "/doubleit/services/doubleitasymmetricnew2"
);
- doubleIt(transportPort, 25);
+ doubleIt(bearerPort, 25);
// Change appliesTo - should fail
- ((BindingProvider)transportPort).getRequestContext().put(
+ ((BindingProvider)bearerPort).getRequestContext().put(
"ws-security.username", "alice"
);
p.getRequestContext().put(
@@ -358,7 +383,7 @@ public class UsernameActAsTest extends A
"http://localhost:" + PORT + "/doubleit/services/doubleitasymmetricnew2"
);
try {
- doubleIt(transportPort, 30);
+ doubleIt(bearerPort, 30);
fail("Failure expected");
} catch (Exception ex) {
//
@@ -382,24 +407,27 @@ public class UsernameActAsTest extends A
Service service = Service.create(wsdl, SERVICE_QNAME);
QName portQName = new QName(NAMESPACE, "DoubleItAsymmetricSAML2BearerPort");
- DoubleItPortType transportPort =
+ DoubleItPortType bearerPort =
service.getPort(portQName, DoubleItPortType.class);
- updateAddressPort(transportPort, PORT);
+ updateAddressPort(bearerPort, PORT);
+ if (standalone) {
+ TokenTestUtils.updateSTSPort((BindingProvider)bearerPort, STSPORT2);
+ }
// Disable storing tokens per-proxy
- ((BindingProvider)transportPort).getRequestContext().put(
+ ((BindingProvider)bearerPort).getRequestContext().put(
SecurityConstants.CACHE_ISSUED_TOKEN_IN_ENDPOINT, "false"
);
// Make a successful invocation
- ((BindingProvider)transportPort).getRequestContext().put(
+ ((BindingProvider)bearerPort).getRequestContext().put(
"ws-security.username", "alice"
);
// Disable appliesTo
- BindingProvider p = (BindingProvider)transportPort;
+ BindingProvider p = (BindingProvider)bearerPort;
STSClient stsClient = (STSClient)p.getRequestContext().get(SecurityConstants.STS_CLIENT);
stsClient.setEnableAppliesTo(false);
- doubleIt(transportPort, 25);
+ doubleIt(bearerPort, 25);
// Change the STSClient so that it can no longer find the STS
stsClient = new STSClient(bus);
@@ -408,14 +436,14 @@ public class UsernameActAsTest extends A
p.getRequestContext().put(SecurityConstants.STS_CLIENT, stsClient);
// This should work
- doubleIt(transportPort, 25);
+ doubleIt(bearerPort, 25);
// Bob should fail
- ((BindingProvider)transportPort).getRequestContext().put(
+ ((BindingProvider)bearerPort).getRequestContext().put(
"ws-security.username", "bob"
);
try {
- doubleIt(transportPort, 30);
+ doubleIt(bearerPort, 30);
fail("Failure expected");
} catch (Exception ex) {
//
Modified: cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/username_onbehalfof/UsernameOnBehalfOfTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/username_onbehalfof/UsernameOnBehalfOfTest.java?rev=1187308&r1=1187307&r2=1187308&view=diff
==============================================================================
--- cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/username_onbehalfof/UsernameOnBehalfOfTest.java (original)
+++ cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/username_onbehalfof/UsernameOnBehalfOfTest.java Fri Oct 21 11:55:29 2011
@@ -26,6 +26,7 @@ import javax.xml.ws.Service;
import org.apache.cxf.Bus;
import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.systest.sts.common.TokenTestUtils;
import org.apache.cxf.systest.sts.deployment.STSServer;
import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
import org.apache.cxf.ws.security.SecurityConstants;
@@ -44,11 +45,16 @@ import org.junit.BeforeClass;
*/
public class UsernameOnBehalfOfTest extends AbstractBusClientServerTestBase {
+ static final String STSPORT = allocatePort(STSServer.class);
+ static final String STSPORT2 = allocatePort(STSServer.class, 2);
+
private static final String NAMESPACE = "http://www.example.org/contract/DoubleIt";
private static final QName SERVICE_QNAME = new QName(NAMESPACE, "DoubleItService");
private static final String PORT = allocatePort(Server.class);
+ private static boolean standalone;
+
@BeforeClass
public static void startServers() throws Exception {
assertTrue(
@@ -59,6 +65,7 @@ public class UsernameOnBehalfOfTest exte
);
String deployment = System.getProperty("sts.deployment");
if ("standalone".equals(deployment)) {
+ standalone = true;
assertTrue(
"Server failed to launch",
// run the server in the same process
@@ -81,25 +88,31 @@ public class UsernameOnBehalfOfTest exte
URL wsdl = UsernameOnBehalfOfTest.class.getResource("DoubleIt.wsdl");
Service service = Service.create(wsdl, SERVICE_QNAME);
QName portQName = new QName(NAMESPACE, "DoubleItAsymmetricSAML2BearerPort");
- DoubleItPortType transportPort =
+ DoubleItPortType bearerPort =
service.getPort(portQName, DoubleItPortType.class);
- updateAddressPort(transportPort, PORT);
+ updateAddressPort(bearerPort, PORT);
+ if (standalone) {
+ TokenTestUtils.updateSTSPort((BindingProvider)bearerPort, STSPORT2);
+ }
// Transport port
- ((BindingProvider)transportPort).getRequestContext().put(
+ ((BindingProvider)bearerPort).getRequestContext().put(
"ws-security.username", "alice"
);
- doubleIt(transportPort, 25);
+ doubleIt(bearerPort, 25);
- DoubleItPortType transportPort2 =
+ DoubleItPortType bearerPort2 =
service.getPort(portQName, DoubleItPortType.class);
- updateAddressPort(transportPort2, PORT);
- ((BindingProvider)transportPort2).getRequestContext().put(
+ updateAddressPort(bearerPort2, PORT);
+ if (standalone) {
+ TokenTestUtils.updateSTSPort((BindingProvider)bearerPort2, STSPORT2);
+ }
+ ((BindingProvider)bearerPort2).getRequestContext().put(
"ws-security.username", "eve"
);
// This time we expect a failure as the server validator doesn't accept "eve".
try {
- doubleIt(transportPort2, 30);
+ doubleIt(bearerPort2, 30);
fail("Failure expected on an unknown user");
} catch (Exception ex) {
// expected
@@ -126,46 +139,52 @@ public class UsernameOnBehalfOfTest exte
//
// Proxy no. 1
//
- DoubleItPortType transportPort =
+ DoubleItPortType bearerPort =
service.getPort(portQName, DoubleItPortType.class);
- updateAddressPort(transportPort, PORT);
+ updateAddressPort(bearerPort, PORT);
+ if (standalone) {
+ TokenTestUtils.updateSTSPort((BindingProvider)bearerPort, STSPORT2);
+ }
TokenStore tokenStore = new MemoryTokenStore();
- ((BindingProvider)transportPort).getRequestContext().put(
+ ((BindingProvider)bearerPort).getRequestContext().put(
TokenStore.class.getName(), tokenStore
);
// Make a successful invocation
- ((BindingProvider)transportPort).getRequestContext().put(
+ ((BindingProvider)bearerPort).getRequestContext().put(
"ws-security.username", "alice"
);
- doubleIt(transportPort, 25);
+ doubleIt(bearerPort, 25);
// Change the STSClient so that it can no longer find the STS
STSClient stsClient = new STSClient(bus);
stsClient.setOnBehalfOf(new WSSUsernameCallbackHandler());
- BindingProvider p = (BindingProvider)transportPort;
+ BindingProvider p = (BindingProvider)bearerPort;
p.getRequestContext().put(SecurityConstants.STS_CLIENT, stsClient);
// This invocation should be successful as the token is cached
- doubleIt(transportPort, 25);
+ doubleIt(bearerPort, 25);
//
// Proxy no. 2
//
- DoubleItPortType transportPort2 =
+ DoubleItPortType bearerPort2 =
service.getPort(portQName, DoubleItPortType.class);
- updateAddressPort(transportPort2, PORT);
+ updateAddressPort(bearerPort2, PORT);
+ if (standalone) {
+ TokenTestUtils.updateSTSPort((BindingProvider)bearerPort2, STSPORT2);
+ }
// Change the STSClient so that it can no longer find the STS
stsClient = new STSClient(bus);
stsClient.setOnBehalfOf(new WSSUsernameCallbackHandler());
- p = (BindingProvider)transportPort2;
+ p = (BindingProvider)bearerPort2;
p.getRequestContext().put(SecurityConstants.STS_CLIENT, stsClient);
// This should fail as the cache is not being used
try {
- doubleIt(transportPort2, 40);
+ doubleIt(bearerPort2, 40);
fail("Failure expected as the token is not stored in the cache");
} catch (Exception ex) {
// expected
@@ -176,12 +195,12 @@ public class UsernameOnBehalfOfTest exte
// Make another invocation - this should succeed as the token is cached
p.getRequestContext().put("ws-security.username", "alice");
- doubleIt(transportPort2, 40);
+ doubleIt(bearerPort2, 40);
// Reset the cache - this invocation should fail
p.getRequestContext().put(TokenStore.class.getName(), new MemoryTokenStore());
try {
- doubleIt(transportPort2, 40);
+ doubleIt(bearerPort2, 40);
fail("Failure expected as the cache is reset");
} catch (Exception ex) {
// expected
@@ -205,31 +224,34 @@ public class UsernameOnBehalfOfTest exte
Service service = Service.create(wsdl, SERVICE_QNAME);
QName portQName = new QName(NAMESPACE, "DoubleItAsymmetricSAML2BearerPort");
- DoubleItPortType transportPort =
+ DoubleItPortType bearerPort =
service.getPort(portQName, DoubleItPortType.class);
- updateAddressPort(transportPort, PORT);
+ updateAddressPort(bearerPort, PORT);
+ if (standalone) {
+ TokenTestUtils.updateSTSPort((BindingProvider)bearerPort, STSPORT2);
+ }
// Disable storing tokens per-proxy
- ((BindingProvider)transportPort).getRequestContext().put(
+ ((BindingProvider)bearerPort).getRequestContext().put(
SecurityConstants.CACHE_ISSUED_TOKEN_IN_ENDPOINT, "false"
);
// Make a successful invocation
- ((BindingProvider)transportPort).getRequestContext().put(
+ ((BindingProvider)bearerPort).getRequestContext().put(
"ws-security.username", "alice"
);
- doubleIt(transportPort, 25);
+ doubleIt(bearerPort, 25);
- ((BindingProvider)transportPort).getRequestContext().put(
+ ((BindingProvider)bearerPort).getRequestContext().put(
"ws-security.username", "bob"
);
- doubleIt(transportPort, 30);
+ doubleIt(bearerPort, 30);
- ((BindingProvider)transportPort).getRequestContext().put(
+ ((BindingProvider)bearerPort).getRequestContext().put(
"ws-security.username", "eve"
);
try {
- doubleIt(transportPort, 30);
+ doubleIt(bearerPort, 30);
fail("Failure expected on a bad user");
} catch (Exception ex) {
//
@@ -238,25 +260,25 @@ public class UsernameOnBehalfOfTest exte
// Change the STSClient so that it can no longer find the STS
STSClient stsClient = new STSClient(bus);
stsClient.setOnBehalfOf(new WSSUsernameCallbackHandler());
- BindingProvider p = (BindingProvider)transportPort;
+ BindingProvider p = (BindingProvider)bearerPort;
p.getRequestContext().put(SecurityConstants.STS_CLIENT, stsClient);
// Make a successful invocation
- ((BindingProvider)transportPort).getRequestContext().put(
+ ((BindingProvider)bearerPort).getRequestContext().put(
"ws-security.username", "alice"
);
- doubleIt(transportPort, 25);
+ doubleIt(bearerPort, 25);
- ((BindingProvider)transportPort).getRequestContext().put(
+ ((BindingProvider)bearerPort).getRequestContext().put(
"ws-security.username", "bob"
);
- doubleIt(transportPort, 30);
+ doubleIt(bearerPort, 30);
- ((BindingProvider)transportPort).getRequestContext().put(
+ ((BindingProvider)bearerPort).getRequestContext().put(
"ws-security.username", "eve2"
);
try {
- doubleIt(transportPort, 30);
+ doubleIt(bearerPort, 30);
fail("Failure expected on a bad user");
} catch (Exception ex) {
//
@@ -264,11 +286,11 @@ public class UsernameOnBehalfOfTest exte
// Reset the cache - this invocation should fail
p.getRequestContext().put(TokenStore.class.getName(), new MemoryTokenStore());
- ((BindingProvider)transportPort).getRequestContext().put(
+ ((BindingProvider)bearerPort).getRequestContext().put(
"ws-security.username", "alice"
);
try {
- doubleIt(transportPort, 30);
+ doubleIt(bearerPort, 30);
fail("Failure expected");
} catch (Exception ex) {
//
@@ -292,35 +314,38 @@ public class UsernameOnBehalfOfTest exte
Service service = Service.create(wsdl, SERVICE_QNAME);
QName portQName = new QName(NAMESPACE, "DoubleItAsymmetricSAML2BearerPort");
- DoubleItPortType transportPort =
+ DoubleItPortType bearerPort =
service.getPort(portQName, DoubleItPortType.class);
- updateAddressPort(transportPort, PORT);
+ updateAddressPort(bearerPort, PORT);
+ if (standalone) {
+ TokenTestUtils.updateSTSPort((BindingProvider)bearerPort, STSPORT2);
+ }
// Disable storing tokens per-proxy
- ((BindingProvider)transportPort).getRequestContext().put(
+ ((BindingProvider)bearerPort).getRequestContext().put(
SecurityConstants.CACHE_ISSUED_TOKEN_IN_ENDPOINT, "false"
);
// Make a successful invocation
- ((BindingProvider)transportPort).getRequestContext().put(
+ ((BindingProvider)bearerPort).getRequestContext().put(
"ws-security.username", "alice"
);
- BindingProvider p = (BindingProvider)transportPort;
+ BindingProvider p = (BindingProvider)bearerPort;
p.getRequestContext().put(
SecurityConstants.STS_APPLIES_TO,
"http://localhost:" + PORT + "/doubleit/services/doubleitasymmetricnew"
);
- doubleIt(transportPort, 25);
+ doubleIt(bearerPort, 25);
// Make a successful invocation
- ((BindingProvider)transportPort).getRequestContext().put(
+ ((BindingProvider)bearerPort).getRequestContext().put(
"ws-security.username", "bob"
);
p.getRequestContext().put(
SecurityConstants.STS_APPLIES_TO,
"http://localhost:" + PORT + "/doubleit/services/doubleitasymmetricnew2"
);
- doubleIt(transportPort, 25);
+ doubleIt(bearerPort, 25);
// Change the STSClient so that it can no longer find the STS
STSClient stsClient = new STSClient(bus);
@@ -328,27 +353,27 @@ public class UsernameOnBehalfOfTest exte
p.getRequestContext().put(SecurityConstants.STS_CLIENT, stsClient);
// Make a successful invocation - should work as token is cached
- ((BindingProvider)transportPort).getRequestContext().put(
+ ((BindingProvider)bearerPort).getRequestContext().put(
"ws-security.username", "alice"
);
p.getRequestContext().put(
SecurityConstants.STS_APPLIES_TO,
"http://localhost:" + PORT + "/doubleit/services/doubleitasymmetricnew"
);
- doubleIt(transportPort, 25);
+ doubleIt(bearerPort, 25);
// Make a successful invocation - should work as token is cached
- ((BindingProvider)transportPort).getRequestContext().put(
+ ((BindingProvider)bearerPort).getRequestContext().put(
"ws-security.username", "bob"
);
p.getRequestContext().put(
SecurityConstants.STS_APPLIES_TO,
"http://localhost:" + PORT + "/doubleit/services/doubleitasymmetricnew2"
);
- doubleIt(transportPort, 25);
+ doubleIt(bearerPort, 25);
// Change appliesTo - should fail
- ((BindingProvider)transportPort).getRequestContext().put(
+ ((BindingProvider)bearerPort).getRequestContext().put(
"ws-security.username", "alice"
);
p.getRequestContext().put(
@@ -356,7 +381,7 @@ public class UsernameOnBehalfOfTest exte
"http://localhost:" + PORT + "/doubleit/services/doubleitasymmetricnew2"
);
try {
- doubleIt(transportPort, 30);
+ doubleIt(bearerPort, 30);
fail("Failure expected");
} catch (Exception ex) {
//
@@ -380,24 +405,27 @@ public class UsernameOnBehalfOfTest exte
Service service = Service.create(wsdl, SERVICE_QNAME);
QName portQName = new QName(NAMESPACE, "DoubleItAsymmetricSAML2BearerPort");
- DoubleItPortType transportPort =
+ DoubleItPortType bearerPort =
service.getPort(portQName, DoubleItPortType.class);
- updateAddressPort(transportPort, PORT);
+ updateAddressPort(bearerPort, PORT);
+ if (standalone) {
+ TokenTestUtils.updateSTSPort((BindingProvider)bearerPort, STSPORT2);
+ }
// Disable storing tokens per-proxy
- ((BindingProvider)transportPort).getRequestContext().put(
+ ((BindingProvider)bearerPort).getRequestContext().put(
SecurityConstants.CACHE_ISSUED_TOKEN_IN_ENDPOINT, "false"
);
// Make a successful invocation
- ((BindingProvider)transportPort).getRequestContext().put(
+ ((BindingProvider)bearerPort).getRequestContext().put(
"ws-security.username", "alice"
);
// Disable appliesTo
- BindingProvider p = (BindingProvider)transportPort;
+ BindingProvider p = (BindingProvider)bearerPort;
STSClient stsClient = (STSClient)p.getRequestContext().get(SecurityConstants.STS_CLIENT);
stsClient.setEnableAppliesTo(false);
- doubleIt(transportPort, 25);
+ doubleIt(bearerPort, 25);
// Change the STSClient so that it can no longer find the STS
stsClient = new STSClient(bus);
@@ -406,14 +434,14 @@ public class UsernameOnBehalfOfTest exte
p.getRequestContext().put(SecurityConstants.STS_CLIENT, stsClient);
// This should work
- doubleIt(transportPort, 25);
+ doubleIt(bearerPort, 25);
// Bob should fail
- ((BindingProvider)transportPort).getRequestContext().put(
+ ((BindingProvider)bearerPort).getRequestContext().put(
"ws-security.username", "bob"
);
try {
- doubleIt(transportPort, 30);
+ doubleIt(bearerPort, 30);
fail("Failure expected");
} catch (Exception ex) {
//
Modified: cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/x509_symmetric/X509SymmetricBindingTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/x509_symmetric/X509SymmetricBindingTest.java?rev=1187308&r1=1187307&r2=1187308&view=diff
==============================================================================
--- cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/x509_symmetric/X509SymmetricBindingTest.java (original)
+++ cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/x509_symmetric/X509SymmetricBindingTest.java Fri Oct 21 11:55:29 2011
@@ -21,6 +21,7 @@ package org.apache.cxf.systest.sts.x509_
import java.net.URL;
import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
import javax.xml.ws.Service;
@@ -40,11 +41,16 @@ import org.junit.BeforeClass;
*/
public class X509SymmetricBindingTest extends AbstractBusClientServerTestBase {
+ static final String STSPORT = allocatePort(STSServer.class);
+ static final String STSPORT2 = allocatePort(STSServer.class, 2);
+
private static final String NAMESPACE = "http://www.example.org/contract/DoubleIt";
private static final QName SERVICE_QNAME = new QName(NAMESPACE, "DoubleItService");
private static final String PORT = allocatePort(Server.class);
+ private static boolean standalone;
+
@BeforeClass
public static void startServers() throws Exception {
assertTrue(
@@ -55,6 +61,7 @@ public class X509SymmetricBindingTest ex
);
String deployment = System.getProperty("sts.deployment");
if ("standalone".equals(deployment)) {
+ standalone = true;
assertTrue(
"Server failed to launch",
// run the server in the same process
@@ -80,6 +87,9 @@ public class X509SymmetricBindingTest ex
DoubleItPortType symmetricSaml1Port =
service.getPort(portQName, DoubleItPortType.class);
updateAddressPort(symmetricSaml1Port, PORT);
+ if (standalone) {
+ TokenTestUtils.updateSTSPort((BindingProvider)symmetricSaml1Port, STSPORT2);
+ }
doubleIt(symmetricSaml1Port, 25);
}
@@ -100,6 +110,9 @@ public class X509SymmetricBindingTest ex
DoubleItPortType symmetricSaml2Port =
service.getPort(portQName, DoubleItPortType.class);
updateAddressPort(symmetricSaml2Port, PORT);
+ if (standalone) {
+ TokenTestUtils.updateSTSPort((BindingProvider)symmetricSaml2Port, STSPORT2);
+ }
doubleIt(symmetricSaml2Port, 30);
Modified: cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/bearer/cxf-service.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/bearer/cxf-service.xml?rev=1187308&r1=1187307&r2=1187308&view=diff
==============================================================================
--- cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/bearer/cxf-service.xml (original)
+++ cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/bearer/cxf-service.xml Fri Oct 21 11:55:29 2011
@@ -77,12 +77,5 @@
</httpj:engine>
</httpj:engine-factory>
- <http:conduit name="https://localhost:8443/.*">
- <http:tlsClientParameters disableCNCheck="true">
- <sec:trustManagers>
- <sec:keyStore type="jks" password="sspass" resource="servicestore.jks"/>
- </sec:trustManagers>
- </http:tlsClientParameters>
- </http:conduit>
</beans>
Modified: cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-encrypted-ut.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-encrypted-ut.xml?rev=1187308&r1=1187307&r2=1187308&view=diff
==============================================================================
--- cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-encrypted-ut.xml (original)
+++ cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-encrypted-ut.xml Fri Oct 21 11:55:29 2011
@@ -33,6 +33,8 @@
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-2.0.xsd">
+ <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
+
<cxf:bus>
<cxf:features>
<cxf:logging/>
@@ -82,7 +84,7 @@
<jaxws:endpoint id="EncryptedUTSTS"
implementor="#encryptedUtSTSProviderBean"
- address="http://localhost:8080/SecurityTokenService/UTEncrypted"
+ address="http://localhost:${testutil.ports.STSServer.2}/SecurityTokenService/UTEncrypted"
wsdlLocation="src/test/resources/org/apache/cxf/systest/sts/deployment/ws-trust-1.4-service.wsdl"
xmlns:ns1="http://docs.oasis-open.org/ws-sx/ws-trust/200512/"
serviceName="ns1:SecurityTokenService"
Modified: cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-transport.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-transport.xml?rev=1187308&r1=1187307&r2=1187308&view=diff
==============================================================================
--- cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-transport.xml (original)
+++ cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-transport.xml Fri Oct 21 11:55:29 2011
@@ -38,6 +38,8 @@
http://cxf.apache.org/schemas/configuration/http-jetty.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-2.0.xsd">
+
+ <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
<cxf:bus>
<cxf:features>
@@ -112,7 +114,7 @@
<jaxws:endpoint id="transportSTS"
implementor="#transportSTSProviderBean"
- address="https://localhost:8443/SecurityTokenService/Transport"
+ address="https://localhost:${testutil.ports.STSServer}/SecurityTokenService/Transport"
wsdlLocation="src/test/resources/org/apache/cxf/systest/sts/deployment/ws-trust-1.4-service.wsdl"
xmlns:ns1="http://docs.oasis-open.org/ws-sx/ws-trust/200512/"
serviceName="ns1:SecurityTokenService"
@@ -124,7 +126,7 @@
</jaxws:endpoint>
<httpj:engine-factory id="ClientAuthHttpsSettings" bus="cxf">
- <httpj:engine port="8443">
+ <httpj:engine port="${testutil.ports.STSServer}">
<httpj:tlsServerParameters>
<sec:keyManagers keyPassword="skpass">
<sec:keyStore type="jks" password="sspass" resource="servicestore.jks"/>
Modified: cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-ut.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-ut.xml?rev=1187308&r1=1187307&r2=1187308&view=diff
==============================================================================
--- cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-ut.xml (original)
+++ cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-ut.xml Fri Oct 21 11:55:29 2011
@@ -33,6 +33,8 @@
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-2.0.xsd">
+ <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
+
<cxf:bus>
<cxf:features>
<cxf:logging/>
@@ -88,7 +90,7 @@
<jaxws:endpoint id="UTSTS"
implementor="#utSTSProviderBean"
- address="http://localhost:8080/SecurityTokenService/UT"
+ address="http://localhost:${testutil.ports.STSServer.2}/SecurityTokenService/UT"
wsdlLocation="src/test/resources/org/apache/cxf/systest/sts/deployment/ws-trust-1.4-service.wsdl"
xmlns:ns1="http://docs.oasis-open.org/ws-sx/ws-trust/200512/"
serviceName="ns1:SecurityTokenService"
Modified: cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-x509.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-x509.xml?rev=1187308&r1=1187307&r2=1187308&view=diff
==============================================================================
--- cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-x509.xml (original)
+++ cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-x509.xml Fri Oct 21 11:55:29 2011
@@ -33,6 +33,8 @@
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-2.0.xsd">
+ <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
+
<cxf:bus>
<cxf:features>
<cxf:logging/>
@@ -89,7 +91,7 @@
<jaxws:endpoint id="X509STS"
implementor="#x509STSProviderBean"
- address="http://localhost:8080/SecurityTokenService/X509"
+ address="http://localhost:${testutil.ports.STSServer.2}/SecurityTokenService/X509"
wsdlLocation="src/test/resources/org/apache/cxf/systest/sts/deployment/ws-trust-1.4-service.wsdl"
xmlns:ns1="http://docs.oasis-open.org/ws-sx/ws-trust/200512/"
serviceName="ns1:SecurityTokenService"
Modified: cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/issueunit/cxf-client.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/issueunit/cxf-client.xml?rev=1187308&r1=1187307&r2=1187308&view=diff
==============================================================================
--- cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/issueunit/cxf-client.xml (original)
+++ cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/issueunit/cxf-client.xml Fri Oct 21 11:55:29 2011
@@ -35,7 +35,7 @@ http://cxf.apache.org/configuration/secu
</cxf:features>
</cxf:bus>
- <http:conduit name="https://localhost:8443/.*">
+ <http:conduit name="https://localhost:.*">
<http:tlsClientParameters disableCNCheck="true">
<sec:trustManagers>
<sec:keyStore type="jks" password="cspass" resource="clientstore.jks"/>
Modified: cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/transport/cxf-service.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/transport/cxf-service.xml?rev=1187308&r1=1187307&r2=1187308&view=diff
==============================================================================
--- cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/transport/cxf-service.xml (original)
+++ cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/transport/cxf-service.xml Fri Oct 21 11:55:29 2011
@@ -56,28 +56,6 @@
<bean class="org.apache.cxf.ws.security.trust.STSTokenValidator"/>
</entry>
<entry key="ws-security.is-bsp-compliant" value="false"/>
- <entry key="ws-security.sts.client">
- <bean class="org.apache.cxf.ws.security.trust.STSClient">
- <constructor-arg ref="cxf"/>
- <property name="wsdlLocation"
- value="https://localhost:8443/SecurityTokenService/Transport?wsdl"/>
- <property name="serviceName"
- value="{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}SecurityTokenService"/>
- <property name="endpointName"
- value="{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}Transport_Port"/>
- <property name="properties">
- <map>
- <entry key="ws-security.username" value="alice"/>
- <entry key="ws-security.callback-handler"
- value="org.apache.cxf.systest.sts.common.CommonCallbackHandler"/>
- <entry key="ws-security.sts.token.username" value="myclientkey"/>
- <entry key="ws-security.sts.token.properties" value="clientKeystore.properties"/>
- <entry key="ws-security.sts.token.usecert" value="true"/>
- </map>
- </property>
- </bean>
- </entry>
-
</jaxws:properties>
</jaxws:endpoint>
@@ -95,31 +73,8 @@
value="org.apache.cxf.systest.sts.common.CommonCallbackHandler"/>
<entry key="ws-security.signature.properties" value="serviceKeystore.properties"/>
<entry key="ws-security.saml2.validator">
- <bean class="org.apache.cxf.ws.security.trust.STSTokenValidator">
- <constructor-arg value="true"/>
- </bean>
+ <bean class="org.apache.cxf.ws.security.trust.STSTokenValidator"/>
</entry>
- <entry key="ws-security.sts.client">
- <bean class="org.apache.cxf.ws.security.trust.STSClient">
- <constructor-arg ref="cxf"/>
- <property name="wsdlLocation"
- value="https://localhost:8443/SecurityTokenService/Transport?wsdl"/>
- <property name="serviceName"
- value="{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}SecurityTokenService"/>
- <property name="endpointName"
- value="{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}Transport_Port"/>
- <property name="properties">
- <map>
- <entry key="ws-security.username" value="alice"/>
- <entry key="ws-security.callback-handler"
- value="org.apache.cxf.systest.sts.common.CommonCallbackHandler"/>
- <entry key="ws-security.sts.token.username" value="myclientkey"/>
- <entry key="ws-security.sts.token.properties" value="clientKeystore.properties"/>
- <entry key="ws-security.sts.token.usecert" value="true"/>
- </map>
- </property>
- </bean>
- </entry>
</jaxws:properties>
</jaxws:endpoint>
@@ -161,12 +116,5 @@
</httpj:engine>
</httpj:engine-factory>
- <http:conduit name="https://localhost:8443/.*">
- <http:tlsClientParameters disableCNCheck="true">
- <sec:trustManagers>
- <sec:keyStore type="jks" password="sspass" resource="servicestore.jks"/>
- </sec:trustManagers>
- </http:tlsClientParameters>
- </http:conduit>
</beans>
Modified: cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/username_actas/cxf-client.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/username_actas/cxf-client.xml?rev=1187308&r1=1187307&r2=1187308&view=diff
==============================================================================
--- cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/username_actas/cxf-client.xml (original)
+++ cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/username_actas/cxf-client.xml Fri Oct 21 11:55:29 2011
@@ -73,7 +73,7 @@ http://cxf.apache.org/configuration/secu
</jaxws:properties>
</jaxws:client>
- <http:conduit name="https://localhost:8443/.*">
+ <http:conduit name="https://localhost:.*">
<http:tlsClientParameters disableCNCheck="true">
<sec:trustManagers>
<sec:keyStore type="jks" password="cspass" resource="clientstore.jks"/>
Modified: cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/username_onbehalfof/cxf-client.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/username_onbehalfof/cxf-client.xml?rev=1187308&r1=1187307&r2=1187308&view=diff
==============================================================================
--- cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/username_onbehalfof/cxf-client.xml (original)
+++ cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/username_onbehalfof/cxf-client.xml Fri Oct 21 11:55:29 2011
@@ -73,7 +73,7 @@ http://cxf.apache.org/configuration/secu
</jaxws:properties>
</jaxws:client>
- <http:conduit name="https://localhost:8443/.*">
+ <http:conduit name="https://localhost:.*">
<http:tlsClientParameters disableCNCheck="true">
<sec:trustManagers>
<sec:keyStore type="jks" password="cspass" resource="clientstore.jks"/>
Modified: cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/x509_symmetric/cxf-service.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/x509_symmetric/cxf-service.xml?rev=1187308&r1=1187307&r2=1187308&view=diff
==============================================================================
--- cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/x509_symmetric/cxf-service.xml (original)
+++ cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/x509_symmetric/cxf-service.xml Fri Oct 21 11:55:29 2011
@@ -55,27 +55,6 @@
<entry key="ws-security.saml1.validator">
<bean class="org.apache.cxf.ws.security.trust.STSTokenValidator"/>
</entry>
- <entry key="ws-security.sts.client">
- <bean class="org.apache.cxf.ws.security.trust.STSClient">
- <constructor-arg ref="cxf"/>
- <property name="wsdlLocation"
- value="http://localhost:8080/SecurityTokenService/X509?wsdl"/>
- <property name="serviceName"
- value="{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}SecurityTokenService"/>
- <property name="endpointName"
- value="{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}X509_Port"/>
- <property name="properties">
- <map>
- <entry key="ws-security.signature.username" value="myclientkey"/>
- <entry key="ws-security.callback-handler"
- value="org.apache.cxf.systest.sts.common.CommonCallbackHandler"/>
- <entry key="ws-security.signature.properties" value="clientKeystore.properties"/>
- <entry key="ws-security.encryption.properties" value="clientKeystore.properties"/>
- <entry key="ws-security.encryption.username" value="mystskey"/>
- </map>
- </property>
- </bean>
- </entry>
</jaxws:properties>
</jaxws:endpoint>
@@ -95,27 +74,6 @@
<entry key="ws-security.saml2.validator">
<bean class="org.apache.cxf.ws.security.trust.STSTokenValidator"/>
</entry>
- <entry key="ws-security.sts.client">
- <bean class="org.apache.cxf.ws.security.trust.STSClient">
- <constructor-arg ref="cxf"/>
- <property name="wsdlLocation"
- value="http://localhost:8080/SecurityTokenService/X509?wsdl"/>
- <property name="serviceName"
- value="{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}SecurityTokenService"/>
- <property name="endpointName"
- value="{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}X509_Port"/>
- <property name="properties">
- <map>
- <entry key="ws-security.signature.username" value="myclientkey"/>
- <entry key="ws-security.callback-handler"
- value="org.apache.cxf.systest.sts.common.CommonCallbackHandler"/>
- <entry key="ws-security.signature.properties" value="clientKeystore.properties"/>
- <entry key="ws-security.encryption.properties" value="clientKeystore.properties"/>
- <entry key="ws-security.encryption.username" value="mystskey"/>
- </map>
- </property>
- </bean>
- </entry>
</jaxws:properties>
</jaxws:endpoint>