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/12/19 15:41:36 UTC
svn commit: r1220777 - in
/cxf/branches/2.4.x-fixes/systests/ws-security-examples: pom.xml
src/test/java/org/apache/cxf/systest/wssec/examples/saml/SamlTokenTest.java
Author: coheigea
Date: Mon Dec 19 14:41:36 2011
New Revision: 1220777
URL: http://svn.apache.org/viewvc?rev=1220777&view=rev
Log:
Removing previous test from the 2.4.x-fixes branch due to not having an STS
Modified:
cxf/branches/2.4.x-fixes/systests/ws-security-examples/pom.xml
cxf/branches/2.4.x-fixes/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/saml/SamlTokenTest.java
Modified: cxf/branches/2.4.x-fixes/systests/ws-security-examples/pom.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/systests/ws-security-examples/pom.xml?rev=1220777&r1=1220776&r2=1220777&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/systests/ws-security-examples/pom.xml (original)
+++ cxf/branches/2.4.x-fixes/systests/ws-security-examples/pom.xml Mon Dec 19 14:41:36 2011
@@ -155,11 +155,6 @@
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>org.apache.cxf.services.sts</groupId>
- <artifactId>cxf-services-sts-core</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-testutils</artifactId>
<version>${project.version}</version>
Modified: cxf/branches/2.4.x-fixes/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/saml/SamlTokenTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/saml/SamlTokenTest.java?rev=1220777&r1=1220776&r2=1220777&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/saml/SamlTokenTest.java (original)
+++ cxf/branches/2.4.x-fixes/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/saml/SamlTokenTest.java Mon Dec 19 14:41:36 2011
@@ -22,19 +22,13 @@ package org.apache.cxf.systest.wssec.exa
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.wssec.examples.saml.server.Server;
-import org.apache.cxf.systest.wssec.examples.sts.STSServer;
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.BeforeClass;
/**
@@ -44,7 +38,6 @@ import org.junit.BeforeClass;
public class SamlTokenTest extends AbstractBusClientServerTestBase {
static final String PORT = allocatePort(Server.class);
static final String PORT2 = allocatePort(Server.class, 2);
- static final String STS_PORT = allocatePort(STSServer.class);
private static final String NAMESPACE = "http://www.example.org/contract/DoubleIt";
private static final QName SERVICE_QNAME = new QName(NAMESPACE, "DoubleItService");
@@ -57,12 +50,6 @@ public class SamlTokenTest extends Abstr
// set this to false to fork
launchServer(Server.class, true)
);
- assertTrue(
- "Server failed to launch",
- // run the server in the same process
- // set this to false to fork
- launchServer(STSServer.class, true)
- );
}
/**
@@ -274,39 +261,4 @@ public class SamlTokenTest extends Abstr
samlPort.doubleIt(25);
}
- /**
- * 2.3.2.5 (WSS1.1) SAML1.1/2.0 Holder of Key, Sign, Encrypt
- */
- @org.junit.Test
- public void testSymmetricIssuedToken() throws Exception {
-
- SpringBusFactory bf = new SpringBusFactory();
- URL busFile = SamlTokenTest.class.getResource("client/client.xml");
-
- Bus bus = bf.createBus(busFile.toString());
- SpringBusFactory.setDefaultBus(bus);
- SpringBusFactory.setThreadDefaultBus(bus);
-
- URL wsdl = SamlTokenTest.class.getResource("DoubleItSaml.wsdl");
- Service service = Service.create(wsdl, SERVICE_QNAME);
- QName portQName = new QName(NAMESPACE, "DoubleItSymmetricIssuedTokenPort");
- DoubleItPortType samlPort =
- service.getPort(portQName, DoubleItPortType.class);
- updateAddressPort(samlPort, PORT);
- updateSTSPort((BindingProvider)samlPort, STS_PORT);
-
- samlPort.doubleIt(25);
- }
-
- private 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));
- }
- }
- }
}