Author: asoldano
Date: 2014-11-24 11:22:05 -0500 (Mon, 24 Nov 2014)
New Revision: 19111
Removed:
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/DeploymentArchives.java
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustActAsTestCase.java
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustBearerTestCase.java
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustHolderOfKeyTestCase.java
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustOnBehalfOfTestCase.java
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustPicketLinkTestCase.java
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/scripts/jbws-testsuite-default.groovy
Log:
Converting WS-Trust tests...
Deleted:
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/DeploymentArchives.java
===================================================================
---
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/DeploymentArchives.java 2014-11-21
16:35:25 UTC (rev 19110)
+++
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/DeploymentArchives.java 2014-11-24
16:22:05 UTC (rev 19111)
@@ -1,187 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2014, 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;
-
-import java.io.File;
-
-import org.jboss.shrinkwrap.api.asset.StringAsset;
-import org.jboss.wsf.test.JBossWSTestHelper;
-
-public final class DeploymentArchives
-{
- public static final String STS_WAR = JBossWSTestHelper.writeToFile(new
JBossWSTestHelper.WarDeployment("jaxws-samples-wsse-policy-trust-sts.war") { {
- archive
- .setManifest(new StringAsset("Manifest-Version: 1.0\n"
- + "Dependencies:
org.jboss.ws.cxf.jbossws-cxf-client,org.apache.cxf.impl annotations\n")) //cxf impl
required to extend STS impl
-
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.sts.STSCallbackHandler.class)
-
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.sts.SampleSTS.class)
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/jboss-web.xml"),
"jboss-web.xml")
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/ws-trust-1.4-service.wsdl"),
"wsdl/ws-trust-1.4-service.wsdl")
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/stsstore.jks"),
"classes/stsstore.jks")
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/stsKeystore.properties"),
"classes/stsKeystore.properties")
- .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/web.xml"));
- }
- });
-
- public static final String SERVER_WAR = JBossWSTestHelper.writeToFile(new
JBossWSTestHelper.WarDeployment("jaxws-samples-wsse-policy-trust.war") { {
- archive
- .setManifest(new StringAsset("Manifest-Version: 1.0\n"
- + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client\n"))
- .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHello.class)
-
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHelloResponse.class)
-
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.service.ServerCallbackHandler.class)
-
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.service.ServiceIface.class)
-
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.service.ServiceImpl.class)
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/SecurityService.wsdl"),
"wsdl/SecurityService.wsdl")
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/SecurityService_schema1.xsd"),
"wsdl/SecurityService_schema1.xsd")
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/servicestore.jks"),
"classes/servicestore.jks")
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/serviceKeystore.properties"),
"classes/serviceKeystore.properties");
- }
- });
-
- public static final String CLIENT_JAR = JBossWSTestHelper.writeToFile(new
JBossWSTestHelper.JarDeployment("jaxws-samples-wsse-policy-trust-client.jar") {
{
- archive
- .addManifest()
- .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/META-INF/clientKeystore.properties"),
"clientKeystore.properties")
- .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/META-INF/clientstore.jks"),
"clientstore.jks");
- }
- });
-
- public static final String SERVER_ACTAS_WAR = JBossWSTestHelper.writeToFile(new
JBossWSTestHelper.WarDeployment("jaxws-samples-wsse-policy-trust-actas.war") {
{
- archive
- .setManifest(new StringAsset("Manifest-Version: 1.0\n"
- + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client,
org.apache.cxf.impl\n"))
- .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHello.class)
-
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHelloResponse.class)
-
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.actas.ActAsCallbackHandler.class)
-
.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")
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/actasKeystore.properties"),
"classes/actasKeystore.properties")
- .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/META-INF/clientstore.jks"),
"clientstore.jks")
- .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/META-INF/clientKeystore.properties"),
"clientKeystore.properties")
- .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/META-INF/permissions.xml"),
"permissions.xml");
- }
- });
-
- public static final String SERVER_ONBEHALFOF_WAR = JBossWSTestHelper.writeToFile(new
JBossWSTestHelper.WarDeployment("jaxws-samples-wsse-policy-trust-onbehalfof.war")
{ {
- archive
- .setManifest(new StringAsset("Manifest-Version: 1.0\n"
- + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client,
org.apache.cxf.impl\n"))
- .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHello.class)
-
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHelloResponse.class)
-
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.onbehalfof.OnBehalfOfCallbackHandler.class)
-
.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")
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/actasKeystore.properties"),
"classes/actasKeystore.properties")
- .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/META-INF/clientstore.jks"),
"clientstore.jks")
- .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/META-INF/clientKeystore.properties"),
"clientKeystore.properties")
- .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/META-INF/permissions.xml"),
"permissions.xml");
- }
- });
-
- public static final String STS_HOLDEROFKEY_WAR = JBossWSTestHelper.writeToFile(new
JBossWSTestHelper.WarDeployment("jaxws-samples-wsse-policy-trust-sts-holderofkey.war")
{ {
- archive
- .setManifest(new StringAsset("Manifest-Version: 1.0\n"
- + "Dependencies:
org.jboss.ws.cxf.jbossws-cxf-client,org.apache.cxf.impl annotations\n")) //cxf impl
required to extend STS impl
-
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.stsholderofkey.STSHolderOfKeyCallbackHandler.class)
-
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.stsholderofkey.SampleSTSHolderOfKey.class)
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/jboss-web.xml"),
"jboss-web.xml")
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/holderofkey-ws-trust-1.4-service.wsdl"),
"wsdl/holderofkey-ws-trust-1.4-service.wsdl")
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/stsstore.jks"),
"classes/stsstore.jks")
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/stsKeystore.properties"),
"classes/stsKeystore.properties")
- .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/holderofkey/web.xml"));
- }
- });
-
- public static final String SERVER_HOLDEROFKEY_WAR = JBossWSTestHelper.writeToFile(new
JBossWSTestHelper.WarDeployment("jaxws-samples-wsse-policy-trust-holderofkey.war")
{ {
- archive
- .setManifest(new StringAsset("Manifest-Version: 1.0\n"
- + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client\n"))
- .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHello.class)
-
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHelloResponse.class)
-
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.holderofkey.HolderOfKeyCallbackHandler.class)
-
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.holderofkey.HolderOfKeyIface.class)
-
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.holderofkey.HolderOfKeyImpl.class)
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/HolderOfKeyService.wsdl"),
"wsdl/HolderOfKeyService.wsdl")
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/HolderOfKeyService_schema1.xsd"),
"wsdl/HolderOfKeyService_schema1.xsd")
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/servicestore.jks"),
"classes/servicestore.jks")
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/serviceKeystore.properties"),
"classes/serviceKeystore.properties");
- }
- });
-
- public static final String STS_PICKETLINK_WAR = JBossWSTestHelper.writeToFile(new
JBossWSTestHelper.WarDeployment("jaxws-samples-wsse-policy-trustPicketLink-sts.war")
{ {
- archive
- .setManifest(new StringAsset("Manifest-Version: 1.0\n"
- + "Dependencies:
org.jboss.ws.cxf.jbossws-cxf-client,org.picketlink\n"))
-
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.picketlink.PicketLinkSTService.class)
-
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.sts.STSCallbackHandler.class)
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/jboss-web.xml"),
"jboss-web.xml")
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/PicketLinkSTS.wsdl"),
"wsdl/PicketLinkSTS.wsdl")
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/stsstore.jks"),
"classes/stsstore.jks")
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/picketlink-sts.xml"),
"classes/picketlink-sts.xml")
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/stsKeystore.properties"),
"classes/stsKeystore.properties");
- }
- });
-
- public static final String STS_BEARER_WAR = JBossWSTestHelper.writeToFile(new
JBossWSTestHelper.WarDeployment("jaxws-samples-wsse-policy-trust-sts-bearer.war")
{ {
- archive
- .setManifest(new StringAsset("Manifest-Version: 1.0\n"
- + "Dependencies:
org.jboss.ws.cxf.jbossws-cxf-client,org.apache.cxf.impl annotations\n")) //cxf impl
required to extend STS impl
-
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.stsbearer.STSBearerCallbackHandler.class)
-
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.stsbearer.SampleSTSBearer.class)
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/jboss-web.xml"),
"jboss-web.xml")
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/bearer-ws-trust-1.4-service.wsdl"),
"wsdl/bearer-ws-trust-1.4-service.wsdl")
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/stsstore.jks"),
"classes/stsstore.jks")
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/stsKeystore.properties"),
"classes/stsKeystore.properties")
- .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/bearer/web.xml"));
- }
- });
-
- public static final String SERVER_BEARER_WAR = JBossWSTestHelper.writeToFile(new
JBossWSTestHelper.WarDeployment("jaxws-samples-wsse-policy-trust-bearer.war") {
{
- archive
- .setManifest(new StringAsset("Manifest-Version: 1.0\n"
- + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client\n"))
- .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHello.class)
-
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHelloResponse.class)
-
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.bearer.BearerIface.class)
-
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.bearer.BearerImpl.class)
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/BearerService.wsdl"),
"wsdl/BearerService.wsdl")
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/BearerService_schema1.xsd"),
"wsdl/BearerService_schema1.xsd")
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/servicestore.jks"),
"classes/servicestore.jks")
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/serviceKeystore.properties"),
"classes/serviceKeystore.properties");
- }
- });
-
- private DeploymentArchives() {
- //NOOP
- }
-}
Deleted:
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustActAsTestCase.java
===================================================================
---
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustActAsTestCase.java 2014-11-21
16:35:25 UTC (rev 19110)
+++
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustActAsTestCase.java 2014-11-24
16:22:05 UTC (rev 19111)
@@ -1,79 +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;
-
-import junit.framework.Test;
-import org.apache.cxf.Bus;
-import org.apache.cxf.BusFactory;
-import org.jboss.test.ws.jaxws.samples.wsse.policy.trust.actas.ActAsServiceIface;
-import org.jboss.wsf.test.JBossWSTest;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.BindingProvider;
-import javax.xml.ws.Service;
-import java.net.URL;
-
-/**
- * A demo of using WS-Trust ActAs extension.
- *
- * User: rsearls(a)redhat.com
- * Date: 1/26/14
- */
-public class WSTrustActAsTestCase extends JBossWSTest
-{
- private final String serviceURL = "http://" + getServerHost() +
":8080/jaxws-samples-wsse-policy-trust-actas/ActAsService";
-
- public static Test suite()
- {
- //deploy client, STS and service; start a security domain to be used by the STS for
authenticating client
- return WSTrustTestUtils.getTestSetup(WSTrustActAsTestCase.class,
- DeploymentArchives.CLIENT_JAR + " " + DeploymentArchives.STS_WAR +
" " + DeploymentArchives.SERVER_WAR + " " +
DeploymentArchives.SERVER_ACTAS_WAR);
- }
-
- /**
- * Request a security token that allows it to act as if it were somebody else.
- *
- * @throws Exception
- */
- public void testActAs() throws Exception
- {
- Bus bus = BusFactory.newInstance().createBus();
- try
- {
- BusFactory.setThreadDefaultBus(bus);
-
- final QName serviceName = new
QName("http://www.jboss.org/jbossws/ws-extensions/actaswssecuritypol...;,
"ActAsService");
- final URL wsdlURL = new URL(serviceURL + "?wsdl");
- Service service = Service.create(wsdlURL, serviceName);
- ActAsServiceIface proxy = (ActAsServiceIface)
service.getPort(ActAsServiceIface.class);
-
- WSTrustTestUtils.setupWsseAndSTSClientActAs((BindingProvider) proxy, bus);
-
- assertEquals("ActAs WS-Trust Hello World!", proxy.sayHello());
- }
- finally
- {
- bus.shutdown(true);
- }
- }
-
-}
Deleted:
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustBearerTestCase.java
===================================================================
---
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustBearerTestCase.java 2014-11-21
16:35:25 UTC (rev 19110)
+++
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustBearerTestCase.java 2014-11-24
16:22:05 UTC (rev 19111)
@@ -1,86 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2014, 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;
-
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.BindingProvider;
-import javax.xml.ws.Service;
-
-import junit.framework.Test;
-
-import org.apache.cxf.Bus;
-import org.apache.cxf.BusFactory;
-import org.jboss.test.ws.jaxws.samples.wsse.policy.trust.bearer.BearerIface;
-import org.jboss.wsf.test.JBossWSCXFTestSetup;
-import org.jboss.wsf.test.JBossWSTest;
-
-/**
- * A demo of using SAML Bearer key type
- *
- * User: rsearls(a)redhat.com
- * Date: 2/24/14
- */
-public class WSTrustBearerTestCase extends JBossWSTest
-{
- private final String serviceURL = "https://" + getServerHost() +
":8443/jaxws-samples-wsse-policy-trust-bearer/BearerService";
-
- public static Test suite()
- {
- //deploy client, STS and service; start a security domain to be used by the STS for
authenticating client
- JBossWSCXFTestSetup testSetup =
WSTrustTestUtils.getTestSetup(WSTrustBearerTestCase.class,
- DeploymentArchives.CLIENT_JAR + " " +
DeploymentArchives.STS_BEARER_WAR + " " +
DeploymentArchives.SERVER_BEARER_WAR);
-
- // setup the https connector in the server config file.
- Map<String, String> sslOptions = new HashMap<String, String>();
- sslOptions.put("server-identity.ssl.keystore-path",
System.getProperty("org.jboss.ws.testsuite.server.keystore"));
- sslOptions.put("server-identity.ssl.keystore-password",
"changeit");
- sslOptions.put("server-identity.ssl.alias", "tomcat");
- testSetup.setHttpsConnectorRequirement(sslOptions);
- return testSetup;
- }
-
- public void testBearer() throws Exception
- {
- Bus bus = BusFactory.newInstance().createBus();
- try
- {
- BusFactory.setThreadDefaultBus(bus);
-
- final QName serviceName = new
QName("http://www.jboss.org/jbossws/ws-extensions/bearerwssecuritypo...;,
"BearerService");
- Service service = Service.create(new URL(serviceURL + "?wsdl"),
serviceName);
- BearerIface proxy = (BearerIface) service.getPort(BearerIface.class);
-
- WSTrustTestUtils.setupWsseAndSTSClientBearer((BindingProvider) proxy, bus);
- assertEquals("Bearer WS-Trust Hello World!", proxy.sayHello());
-
- }
- finally
- {
- bus.shutdown(true);
- }
- }
-
-}
Deleted:
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustHolderOfKeyTestCase.java
===================================================================
---
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustHolderOfKeyTestCase.java 2014-11-21
16:35:25 UTC (rev 19110)
+++
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustHolderOfKeyTestCase.java 2014-11-24
16:22:05 UTC (rev 19111)
@@ -1,88 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2014, 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;
-
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.BindingProvider;
-import javax.xml.ws.Service;
-
-import junit.framework.Test;
-
-import org.apache.cxf.Bus;
-import org.apache.cxf.BusFactory;
-import org.jboss.test.ws.jaxws.samples.wsse.policy.trust.holderofkey.HolderOfKeyIface;
-import org.jboss.wsf.test.JBossWSCXFTestSetup;
-import org.jboss.wsf.test.JBossWSTest;
-
-/**
- * A demo of using SAML Holder-of-key
- *
- * User: rsearls(a)redhat.com
- * Date: 3/14/14
- */
-public class WSTrustHolderOfKeyTestCase extends JBossWSTest
-{
- public static Test suite()
- {
- //deploy client, STS and service; start a security domain to be used by the STS for
authenticating client
- JBossWSCXFTestSetup testSetup =
WSTrustTestUtils.getTestSetup(WSTrustHolderOfKeyTestCase.class,
- DeploymentArchives.CLIENT_JAR + " " +
DeploymentArchives.STS_HOLDEROFKEY_WAR + " " +
DeploymentArchives.SERVER_HOLDEROFKEY_WAR);
-
- // setup the https connector in the server config file.
- Map<String, String> sslOptions = new HashMap<String, String>();
- sslOptions.put("server-identity.ssl.keystore-path",
System.getProperty("org.jboss.ws.testsuite.server.keystore"));
- sslOptions.put("server-identity.ssl.keystore-password",
"changeit");
- sslOptions.put("server-identity.ssl.alias", "tomcat");
-
- testSetup.setHttpsConnectorRequirement(sslOptions);
- return testSetup;
-
- }
-
- public void testBearer() throws Exception
- {
-
- Bus bus = BusFactory.newInstance().createBus();
- try
- {
-
- BusFactory.setThreadDefaultBus(bus);
-
- final QName serviceName = new
QName("http://www.jboss.org/jbossws/ws-extensions/holderofkeywssecur...;,
"HolderOfKeyService");
- final URL wsdlURL = new URL("https://" + getServerHost() +
":8443/jaxws-samples-wsse-policy-trust-holderofkey/HolderOfKeyService?wsdl");
- Service service = Service.create(wsdlURL, serviceName);
- HolderOfKeyIface proxy = (HolderOfKeyIface)
service.getPort(HolderOfKeyIface.class);
-
- WSTrustTestUtils.setupWsseAndSTSClientHolderOfKey((BindingProvider) proxy,
bus);
- assertEquals("Holder-Of-Key WS-Trust Hello World!",
proxy.sayHello());
-
- } finally
- {
- bus.shutdown(true);
- }
- }
-
-}
Deleted:
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustOnBehalfOfTestCase.java
===================================================================
---
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustOnBehalfOfTestCase.java 2014-11-21
16:35:25 UTC (rev 19110)
+++
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustOnBehalfOfTestCase.java 2014-11-24
16:22:05 UTC (rev 19111)
@@ -1,83 +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;
-
-import junit.framework.Test;
-import org.apache.cxf.Bus;
-import org.apache.cxf.BusFactory;
-import
org.jboss.test.ws.jaxws.samples.wsse.policy.trust.onbehalfof.OnBehalfOfServiceIface;
-import org.jboss.wsf.test.JBossWSTest;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.BindingProvider;
-import javax.xml.ws.Service;
-import java.net.URL;
-
-/**
- * A demo of using WS-Trust ActAs extension.
- *
- * User: rsearls(a)redhat.com
- * Date: 1/26/14
- */
-public class WSTrustOnBehalfOfTestCase extends JBossWSTest
-{
- private final String serviceURL = "http://" + getServerHost() +
":8080/jaxws-samples-wsse-policy-trust-onbehalfof/OnBehalfOfService";
-
- public static Test suite()
- {
- //deploy client, STS and service; start a security domain to be used by the STS for
authenticating client
- return WSTrustTestUtils.getTestSetup(WSTrustOnBehalfOfTestCase.class,
- DeploymentArchives.CLIENT_JAR + " " + DeploymentArchives.STS_WAR +
" " + DeploymentArchives.SERVER_WAR + " " +
DeploymentArchives.SERVER_ONBEHALFOF_WAR);
- }
-
- /**
- * Request a security token that allows it to act on behalf of somebody else.
- *
- * @throws Exception
- */
- public void testOnBehalfOf() throws Exception
- {
- Bus bus = BusFactory.newInstance().createBus();
- try
- {
- BusFactory.setThreadDefaultBus(bus);
-
- final QName serviceName = new
QName("http://www.jboss.org/jbossws/ws-extensions/onbehalfofwssecuri...;,
"OnBehalfOfService");
- final URL wsdlURL = new URL(serviceURL + "?wsdl");
- Service service = Service.create(wsdlURL, serviceName);
- OnBehalfOfServiceIface proxy = (OnBehalfOfServiceIface)
service.getPort(OnBehalfOfServiceIface.class);
-
- /* TODO explain why this is not needed for setup and then remove
- final QName stsServiceName = new
QName("http://docs.oasis-open.org/ws-sx/ws-trust/200512/",
"SecurityTokenService");
- final QName stsPortName = new
QName("http://docs.oasis-open.org/ws-sx/ws-trust/200512/",
"UT_Port");
- */
- WSTrustTestUtils.setupWsseAndSTSClientOnBehalfOf((BindingProvider) proxy, bus);
-
- assertEquals("OnBehalfOf WS-Trust Hello World!", proxy.sayHello());
- }
- finally
- {
- bus.shutdown(true);
- }
- }
-
-}
Deleted:
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustPicketLinkTestCase.java
===================================================================
---
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustPicketLinkTestCase.java 2014-11-21
16:35:25 UTC (rev 19110)
+++
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustPicketLinkTestCase.java 2014-11-24
16:22:05 UTC (rev 19111)
@@ -1,80 +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;
-
-import java.net.URL;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.Service;
-
-import junit.framework.Test;
-
-import org.apache.cxf.Bus;
-import org.apache.cxf.BusFactory;
-import org.jboss.wsf.test.CryptoHelper;
-import org.jboss.wsf.test.JBossWSTest;
-import org.jboss.test.ws.jaxws.samples.wsse.policy.trust.service.ServiceIface;
-
-/**
- * WS-Trust test case using PicketLink implementation of STS
- *
- * @author alessio.soldano(a)jboss.com
- * @since 30-Apr-2012
- */
-public final class WSTrustPicketLinkTestCase extends JBossWSTest
-{
- public static Test suite()
- {
- //deploy client, STS and service; start a security domain to be used by the STS for
authenticating client
- return WSTrustTestUtils.getTestSetup(WSTrustPicketLinkTestCase.class,
- DeploymentArchives.CLIENT_JAR + " " +
DeploymentArchives.STS_PICKETLINK_WAR + " " + DeploymentArchives.SERVER_WAR);
- }
-
- public void test() throws Exception
- {
- Bus bus = BusFactory.newInstance().createBus();
- try
- {
- BusFactory.setThreadDefaultBus(bus);
-
- final QName serviceName = new
QName("http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy",
"SecurityService");
- final URL wsdlURL = new URL("http://" + getServerHost() +
":8080/jaxws-samples-wsse-policy-trust/SecurityService?wsdl");
- Service service = Service.create(wsdlURL, serviceName);
- ServiceIface proxy = (ServiceIface) service.getPort(ServiceIface.class);
-
- final QName stsServiceName = new
QName("urn:picketlink:identity-federation:sts", "PicketLinkSTS");
- final QName stsPortName = new
QName("urn:picketlink:identity-federation:sts", "PicketLinkSTSPort");
- WSTrustTestUtils.setupWsseAndSTSClient(proxy, bus, "http://" +
getServerHost() +
":8080/jaxws-samples-wsse-policy-trustPicketLink-sts/PicketLinkSTS?wsdl",
- stsServiceName, stsPortName);
-
- try {
- assertEquals("WS-Trust Hello World!", proxy.sayHello());
- } catch (Exception e) {
- throw CryptoHelper.checkAndWrapException(e);
- }
- }
- finally
- {
- bus.shutdown(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 2014-11-21
16:35:25 UTC (rev 19110)
+++
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustTestCase.java 2014-11-24
16:22:05 UTC (rev 19111)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2014, 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.
*
@@ -21,18 +21,34 @@
*/
package org.jboss.test.ws.jaxws.samples.wsse.policy.trust;
+import java.io.File;
import java.net.URL;
import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
import javax.xml.ws.Service;
-import junit.framework.Test;
-
import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OperateOnDeployment;
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.arquillian.test.api.ArquillianResource;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.jboss.test.ws.jaxws.samples.wsse.policy.trust.actas.ActAsServiceIface;
+import org.jboss.test.ws.jaxws.samples.wsse.policy.trust.bearer.BearerIface;
+import org.jboss.test.ws.jaxws.samples.wsse.policy.trust.holderofkey.HolderOfKeyIface;
+import
org.jboss.test.ws.jaxws.samples.wsse.policy.trust.onbehalfof.OnBehalfOfServiceIface;
+import org.jboss.test.ws.jaxws.samples.wsse.policy.trust.service.ServiceIface;
import org.jboss.wsf.test.CryptoHelper;
import org.jboss.wsf.test.JBossWSTest;
-import org.jboss.test.ws.jaxws.samples.wsse.policy.trust.service.ServiceIface;
+import org.jboss.wsf.test.JBossWSTestHelper;
+import org.jboss.wsf.test.WrapThreadContextClassLoader;
+import org.junit.Test;
+import org.junit.runner.RunWith;
/**
* WS-Trust test case
@@ -40,25 +56,209 @@
* ported to jbossws-cxf for running over JBoss Application Server.
*
* @author alessio.soldano(a)jboss.com
+ * @author rsearls(a)redhat.com
* @since 08-Feb-2012
*/
+(a)RunWith(Arquillian.class)
public class WSTrustTestCase extends JBossWSTest
{
- private final String serviceURL = "http://" + getServerHost() +
":8080/jaxws-samples-wsse-policy-trust/SecurityService";
- private final String stsURL = "http://" + getServerHost() +
":8080/jaxws-samples-wsse-policy-trust-sts/SecurityTokenService";
+ private static final String STS_DEP =
"jaxws-samples-wsse-policy-trust-sts";
+ private static final String SERVER_DEP = "jaxws-samples-wsse-policy-trust";
+ private static final String ACT_AS_SERVER_DEP =
"jaxws-samples-wsse-policy-trust-actas";
+ private static final String ON_BEHALF_OF_SERVER_DEP =
"jaxws-samples-wsse-policy-trust-onbehalfof";
+ private static final String HOLDER_OF_KEY_STS_DEP =
"jaxws-samples-wsse-policy-trust-sts-holderofkey";
+ private static final String HOLDER_OF_KEY_SERVER_DEP =
"jaxws-samples-wsse-policy-trust-holderofkey";
+ private static final String PL_STS_DEP =
"jaxws-samples-wsse-policy-trustPicketLink-sts";
+ private static final String BEARER_STS_DEP =
"jaxws-samples-wsse-policy-trust-sts-bearer";
+ private static final String BEARER_SERVER_DEP =
"jaxws-samples-wsse-policy-trust-bearer";
- public static Test suite()
- {
- //deploy client, STS and service; start a security domain to be used by the STS for
authenticating client
- return WSTrustTestUtils.getTestSetup(WSTrustTestCase.class,
- DeploymentArchives.CLIENT_JAR + " " + DeploymentArchives.STS_WAR +
" " + DeploymentArchives.SERVER_WAR);
+ @ArquillianResource
+ private URL serviceURL;
+
+ @Deployment(name = STS_DEP, testable = false)
+ public static WebArchive createSTSDeployment() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class, STS_DEP +
".war");
+ archive
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies:
org.jboss.ws.cxf.jbossws-cxf-client,org.apache.cxf.impl annotations\n")) //cxf impl
required to extend STS impl
+
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.sts.STSCallbackHandler.class)
+
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.sts.SampleSTS.class)
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/jboss-web.xml"),
"jboss-web.xml")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/ws-trust-1.4-service.wsdl"),
"wsdl/ws-trust-1.4-service.wsdl")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/stsstore.jks"),
"classes/stsstore.jks")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/stsKeystore.properties"),
"classes/stsKeystore.properties")
+ .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/web.xml"));
+ return archive;
}
+
+ @Deployment(name = SERVER_DEP, testable = false)
+ public static WebArchive createServerDeployment() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class, SERVER_DEP +
".war");
+ archive
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client\n"))
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHello.class)
+
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHelloResponse.class)
+
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.service.ServerCallbackHandler.class)
+
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.service.ServiceIface.class)
+
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.service.ServiceImpl.class)
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/SecurityService.wsdl"),
"wsdl/SecurityService.wsdl")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/SecurityService_schema1.xsd"),
"wsdl/SecurityService_schema1.xsd")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/servicestore.jks"),
"classes/servicestore.jks")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/serviceKeystore.properties"),
"classes/serviceKeystore.properties");
+ return archive;
+ }
+
+ @Override
+ protected String getClientJarPaths() {
+ return JBossWSTestHelper.writeToFile(new
JBossWSTestHelper.JarDeployment("jaxws-samples-wsse-policy-trust-client.jar") {
{
+ archive
+ .addManifest()
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/META-INF/clientKeystore.properties"),
"clientKeystore.properties")
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/META-INF/clientstore.jks"),
"clientstore.jks");
+ }
+ });
+ }
+
+ @Deployment(name = ACT_AS_SERVER_DEP, testable = false)
+ public static WebArchive createActAsServerDeployment() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class, ACT_AS_SERVER_DEP +
".war");
+ archive
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client,
org.apache.cxf.impl\n"))
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHello.class)
+
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHelloResponse.class)
+
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.actas.ActAsCallbackHandler.class)
+
.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")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/actasKeystore.properties"),
"classes/actasKeystore.properties")
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/META-INF/clientstore.jks"),
"clientstore.jks")
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/META-INF/clientKeystore.properties"),
"clientKeystore.properties")
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/META-INF/permissions.xml"),
"permissions.xml");
+ return archive;
+ }
+
+ @Deployment(name = ON_BEHALF_OF_SERVER_DEP, testable = false)
+ public static WebArchive createOnBehalfOfServerDeployment() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class, ON_BEHALF_OF_SERVER_DEP +
".war");
+ archive
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client,
org.apache.cxf.impl\n"))
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHello.class)
+
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHelloResponse.class)
+
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.onbehalfof.OnBehalfOfCallbackHandler.class)
+
.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")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/actasKeystore.properties"),
"classes/actasKeystore.properties")
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/META-INF/clientstore.jks"),
"clientstore.jks")
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/META-INF/clientKeystore.properties"),
"clientKeystore.properties")
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/META-INF/permissions.xml"),
"permissions.xml");
+ return archive;
+ }
+
+ @Deployment(name = HOLDER_OF_KEY_STS_DEP, testable = false)
+ public static WebArchive createHolderOfKeySTSDeployment() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class, HOLDER_OF_KEY_STS_DEP +
".war");
+ archive
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies:
org.jboss.ws.cxf.jbossws-cxf-client,org.apache.cxf.impl annotations\n")) //cxf impl
required to extend STS impl
+
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.stsholderofkey.STSHolderOfKeyCallbackHandler.class)
+
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.stsholderofkey.SampleSTSHolderOfKey.class)
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/jboss-web.xml"),
"jboss-web.xml")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/holderofkey-ws-trust-1.4-service.wsdl"),
"wsdl/holderofkey-ws-trust-1.4-service.wsdl")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/stsstore.jks"),
"classes/stsstore.jks")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/stsKeystore.properties"),
"classes/stsKeystore.properties")
+ .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/holderofkey/web.xml"));
+ return archive;
+ }
+
+ @Deployment(name = HOLDER_OF_KEY_SERVER_DEP, testable = false)
+ public static WebArchive createHolderOfKeyServerDeployment() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class, HOLDER_OF_KEY_SERVER_DEP +
".war");
+ archive
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client\n"))
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHello.class)
+
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHelloResponse.class)
+
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.holderofkey.HolderOfKeyCallbackHandler.class)
+
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.holderofkey.HolderOfKeyIface.class)
+
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.holderofkey.HolderOfKeyImpl.class)
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/HolderOfKeyService.wsdl"),
"wsdl/HolderOfKeyService.wsdl")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/HolderOfKeyService_schema1.xsd"),
"wsdl/HolderOfKeyService_schema1.xsd")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/servicestore.jks"),
"classes/servicestore.jks")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/serviceKeystore.properties"),
"classes/serviceKeystore.properties");
+ return archive;
+ }
+
+ @Deployment(name = PL_STS_DEP, testable = false)
+ public static WebArchive createPicketLinkSTSDeployment() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class, PL_STS_DEP +
".war");
+ archive
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies:
org.jboss.ws.cxf.jbossws-cxf-client,org.picketlink\n"))
+
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.picketlink.PicketLinkSTService.class)
+
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.sts.STSCallbackHandler.class)
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/jboss-web.xml"),
"jboss-web.xml")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/PicketLinkSTS.wsdl"),
"wsdl/PicketLinkSTS.wsdl")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/stsstore.jks"),
"classes/stsstore.jks")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/picketlink-sts.xml"),
"classes/picketlink-sts.xml")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/stsKeystore.properties"),
"classes/stsKeystore.properties");
+ return archive;
+ }
+
+ @Deployment(name = BEARER_STS_DEP, testable = false)
+ public static WebArchive createBearerSTSDeployment() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class, BEARER_STS_DEP +
".war");
+ archive
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies:
org.jboss.ws.cxf.jbossws-cxf-client,org.apache.cxf.impl annotations\n")) //cxf impl
required to extend STS impl
+
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.stsbearer.STSBearerCallbackHandler.class)
+
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.stsbearer.SampleSTSBearer.class)
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/jboss-web.xml"),
"jboss-web.xml")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/bearer-ws-trust-1.4-service.wsdl"),
"wsdl/bearer-ws-trust-1.4-service.wsdl")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/stsstore.jks"),
"classes/stsstore.jks")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/stsKeystore.properties"),
"classes/stsKeystore.properties")
+ .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/bearer/web.xml"));
+ return archive;
+ }
+
+ @Deployment(name = BEARER_SERVER_DEP, testable = false)
+ public static WebArchive createBearerServerDeployment() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class, BEARER_SERVER_DEP +
".war");
+ archive
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client\n"))
+ .addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHello.class)
+
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.jaxws.SayHelloResponse.class)
+
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.bearer.BearerIface.class)
+
.addClass(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.bearer.BearerImpl.class)
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/BearerService.wsdl"),
"wsdl/BearerService.wsdl")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/BearerService_schema1.xsd"),
"wsdl/BearerService_schema1.xsd")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/servicestore.jks"),
"classes/servicestore.jks")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/policy/trust/WEB-INF/serviceKeystore.properties"),
"classes/serviceKeystore.properties");
+ return archive;
+ }
+
/**
* WS-Trust test with the STS information programmatically provided
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
+ @OperateOnDeployment(SERVER_DEP)
+ @WrapThreadContextClassLoader
public void test() throws Exception
{
Bus bus = BusFactory.newInstance().createBus();
@@ -67,13 +267,14 @@
BusFactory.setThreadDefaultBus(bus);
final QName serviceName = new
QName("http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy",
"SecurityService");
- final URL wsdlURL = new URL(serviceURL + "?wsdl");
+ final URL wsdlURL = new URL(serviceURL + "SecurityService?wsdl");
Service service = Service.create(wsdlURL, serviceName);
ServiceIface proxy = (ServiceIface) service.getPort(ServiceIface.class);
final QName stsServiceName = new
QName("http://docs.oasis-open.org/ws-sx/ws-trust/200512/",
"SecurityTokenService");
final QName stsPortName = new
QName("http://docs.oasis-open.org/ws-sx/ws-trust/200512/",
"UT_Port");
- WSTrustTestUtils.setupWsseAndSTSClient(proxy, bus, stsURL + "?wsdl",
stsServiceName, stsPortName);
+ URL stsURL = new URL(serviceURL.getProtocol(), serviceURL.getHost(),
serviceURL.getPort(),
"/jaxws-samples-wsse-policy-trust-sts/SecurityTokenService?wsdl");
+ WSTrustTestUtils.setupWsseAndSTSClient(proxy, bus, stsURL.toString(),
stsServiceName, stsPortName);
try {
assertEquals("WS-Trust Hello World!", proxy.sayHello());
@@ -92,6 +293,10 @@
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
+ @OperateOnDeployment(SERVER_DEP)
+ @WrapThreadContextClassLoader
public void testUsingEPR() throws Exception
{
Bus bus = BusFactory.newInstance().createBus();
@@ -100,7 +305,7 @@
BusFactory.setThreadDefaultBus(bus);
final QName serviceName = new
QName("http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy",
"SecurityService");
- final URL wsdlURL = new URL(serviceURL + "?wsdl");
+ final URL wsdlURL = new URL(serviceURL + "SecurityService?wsdl");
Service service = Service.create(wsdlURL, serviceName);
ServiceIface proxy = (ServiceIface) service.getPort(ServiceIface.class);
@@ -123,19 +328,24 @@
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
+ @OperateOnDeployment(SERVER_DEP)
+ @WrapThreadContextClassLoader
public void testNoClientCallback() throws Exception {
Bus bus = BusFactory.newInstance().createBus();
try {
BusFactory.setThreadDefaultBus(bus);
final QName serviceName = new
QName("http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy",
"SecurityService");
- final URL wsdlURL = new URL(serviceURL + "?wsdl");
+ final URL wsdlURL = new URL(serviceURL + "SecurityService?wsdl");
Service service = Service.create(wsdlURL, serviceName);
ServiceIface proxy = (ServiceIface) service.getPort(ServiceIface.class);
final QName stsServiceName = new
QName("http://docs.oasis-open.org/ws-sx/ws-trust/200512/",
"SecurityTokenService");
final QName stsPortName = new
QName("http://docs.oasis-open.org/ws-sx/ws-trust/200512/",
"UT_Port");
- WSTrustTestUtils.setupWsseAndSTSClientNoCallbackHandler(proxy, bus, stsURL +
"?wsdl", stsServiceName, stsPortName);
+ URL stsURL = new URL(serviceURL.getProtocol(), serviceURL.getHost(),
serviceURL.getPort(),
"/jaxws-samples-wsse-policy-trust-sts/SecurityTokenService?wsdl");
+ WSTrustTestUtils.setupWsseAndSTSClientNoCallbackHandler(proxy, bus,
stsURL.toString(), stsServiceName, stsPortName);
assertEquals("WS-Trust Hello World!", proxy.sayHello());
} finally {
@@ -149,6 +359,10 @@
*
* @throws Exception
*/
+ @Test
+ @RunAsClient
+ @OperateOnDeployment(SERVER_DEP)
+ @WrapThreadContextClassLoader
public void testNoSignatureUsername() throws Exception
{
Bus bus = BusFactory.newInstance().createBus();
@@ -157,13 +371,14 @@
BusFactory.setThreadDefaultBus(bus);
final QName serviceName = new
QName("http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy",
"SecurityService");
- final URL wsdlURL = new URL(serviceURL + "?wsdl");
+ final URL wsdlURL = new URL(serviceURL + "SecurityService?wsdl");
Service service = Service.create(wsdlURL, serviceName);
ServiceIface proxy = (ServiceIface) service.getPort(ServiceIface.class);
final QName stsServiceName = new
QName("http://docs.oasis-open.org/ws-sx/ws-trust/200512/",
"SecurityTokenService");
final QName stsPortName = new
QName("http://docs.oasis-open.org/ws-sx/ws-trust/200512/",
"UT_Port");
- WSTrustTestUtils.setupWsseAndSTSClientNoSignatureUsername(proxy, bus, stsURL +
"?wsdl", stsServiceName, stsPortName);
+ URL stsURL = new URL(serviceURL.getProtocol(), serviceURL.getHost(),
serviceURL.getPort(),
"/jaxws-samples-wsse-policy-trust-sts/SecurityTokenService?wsdl");
+ WSTrustTestUtils.setupWsseAndSTSClientNoSignatureUsername(proxy, bus,
stsURL.toString(), stsServiceName, stsPortName);
assertEquals("WS-Trust Hello World!", proxy.sayHello());
}
@@ -173,4 +388,157 @@
}
}
+
+ /**
+ * Request a security token that allows it to act as if it were somebody else.
+ *
+ * @throws Exception
+ */
+ @Test
+ @RunAsClient
+ @OperateOnDeployment(ACT_AS_SERVER_DEP)
+ @WrapThreadContextClassLoader
+ public void testActAs() throws Exception
+ {
+ Bus bus = BusFactory.newInstance().createBus();
+ try
+ {
+ BusFactory.setThreadDefaultBus(bus);
+
+ final QName serviceName = new
QName("http://www.jboss.org/jbossws/ws-extensions/actaswssecuritypol...;,
"ActAsService");
+ final URL wsdlURL = new URL(serviceURL + "ActAsService?wsdl");
+ Service service = Service.create(wsdlURL, serviceName);
+ ActAsServiceIface proxy = (ActAsServiceIface)
service.getPort(ActAsServiceIface.class);
+
+ WSTrustTestUtils.setupWsseAndSTSClientActAs((BindingProvider) proxy, bus);
+
+ assertEquals("ActAs WS-Trust Hello World!", proxy.sayHello());
+ }
+ finally
+ {
+ bus.shutdown(true);
+ }
+ }
+
+ /**
+ * Request a security token that allows it to act on behalf of somebody else.
+ *
+ * @throws Exception
+ */
+ @Test
+ @RunAsClient
+ @OperateOnDeployment(ON_BEHALF_OF_SERVER_DEP)
+ @WrapThreadContextClassLoader
+ public void testOnBehalfOf() throws Exception
+ {
+ Bus bus = BusFactory.newInstance().createBus();
+ try
+ {
+ BusFactory.setThreadDefaultBus(bus);
+
+ final QName serviceName = new
QName("http://www.jboss.org/jbossws/ws-extensions/onbehalfofwssecuri...;,
"OnBehalfOfService");
+ final URL wsdlURL = new URL(serviceURL + "OnBehalfOfService?wsdl");
+ Service service = Service.create(wsdlURL, serviceName);
+ OnBehalfOfServiceIface proxy = (OnBehalfOfServiceIface)
service.getPort(OnBehalfOfServiceIface.class);
+
+ /* TODO explain why this is not needed for setup and then remove
+ final QName stsServiceName = new
QName("http://docs.oasis-open.org/ws-sx/ws-trust/200512/",
"SecurityTokenService");
+ final QName stsPortName = new
QName("http://docs.oasis-open.org/ws-sx/ws-trust/200512/",
"UT_Port");
+ */
+ WSTrustTestUtils.setupWsseAndSTSClientOnBehalfOf((BindingProvider) proxy, bus);
+
+ assertEquals("OnBehalfOf WS-Trust Hello World!", proxy.sayHello());
+ }
+ finally
+ {
+ bus.shutdown(true);
+ }
+ }
+
+ @Test
+ @RunAsClient
+ @OperateOnDeployment(HOLDER_OF_KEY_SERVER_DEP)
+ @WrapThreadContextClassLoader
+ public void testHolderOfKey() throws Exception
+ {
+
+ Bus bus = BusFactory.newInstance().createBus();
+ try
+ {
+
+ BusFactory.setThreadDefaultBus(bus);
+
+ final QName serviceName = new
QName("http://www.jboss.org/jbossws/ws-extensions/holderofkeywssecur...;,
"HolderOfKeyService");
+ final URL wsdlURL = new URL("https", serviceURL.getHost(),
serviceURL.getPort() - 8080 + 8443,
"/jaxws-samples-wsse-policy-trust-holderofkey/HolderOfKeyService?wsdl");
+ Service service = Service.create(wsdlURL, serviceName);
+ HolderOfKeyIface proxy = (HolderOfKeyIface)
service.getPort(HolderOfKeyIface.class);
+
+ WSTrustTestUtils.setupWsseAndSTSClientHolderOfKey((BindingProvider) proxy,
bus);
+ assertEquals("Holder-Of-Key WS-Trust Hello World!",
proxy.sayHello());
+
+ } finally
+ {
+ bus.shutdown(true);
+ }
+ }
+
+ @Test
+ @RunAsClient
+ @OperateOnDeployment(SERVER_DEP)
+ @WrapThreadContextClassLoader
+ public void testPicketLink() throws Exception
+ {
+ Bus bus = BusFactory.newInstance().createBus();
+ try
+ {
+ BusFactory.setThreadDefaultBus(bus);
+
+ final QName serviceName = new
QName("http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy",
"SecurityService");
+ final URL wsdlURL = new URL(serviceURL + "SecurityService?wsdl");
+ Service service = Service.create(wsdlURL, serviceName);
+ ServiceIface proxy = (ServiceIface) service.getPort(ServiceIface.class);
+
+ final QName stsServiceName = new
QName("urn:picketlink:identity-federation:sts", "PicketLinkSTS");
+ final QName stsPortName = new
QName("urn:picketlink:identity-federation:sts", "PicketLinkSTSPort");
+ final URL stsURL = new URL(serviceURL.getProtocol(), serviceURL.getHost(),
serviceURL.getPort(),
"/jaxws-samples-wsse-policy-trustPicketLink-sts/PicketLinkSTS?wsdl");
+ WSTrustTestUtils.setupWsseAndSTSClient(proxy, bus, stsURL.toString(),
stsServiceName, stsPortName);
+
+ try {
+ assertEquals("WS-Trust Hello World!", proxy.sayHello());
+ } catch (Exception e) {
+ throw CryptoHelper.checkAndWrapException(e);
+ }
+ }
+ finally
+ {
+ bus.shutdown(true);
+ }
+ }
+
+ @Test
+ @RunAsClient
+ @OperateOnDeployment(BEARER_SERVER_DEP)
+ @WrapThreadContextClassLoader
+ public void testBearer() throws Exception
+ {
+ Bus bus = BusFactory.newInstance().createBus();
+ try
+ {
+ BusFactory.setThreadDefaultBus(bus);
+
+ final QName serviceName = new
QName("http://www.jboss.org/jbossws/ws-extensions/bearerwssecuritypo...;,
"BearerService");
+ Service service = Service.create(new URL(serviceURL +
"BearerService?wsdl"), serviceName);
+ BearerIface proxy = (BearerIface) service.getPort(BearerIface.class);
+
+ WSTrustTestUtils.setupWsseAndSTSClientBearer((BindingProvider) proxy, bus);
+ assertEquals("Bearer WS-Trust Hello World!", proxy.sayHello());
+
+ }
+ finally
+ {
+ bus.shutdown(true);
+ }
+ }
+
+
}
Modified:
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/scripts/jbws-testsuite-default.groovy
===================================================================
---
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/scripts/jbws-testsuite-default.groovy 2014-11-21
16:35:25 UTC (rev 19110)
+++
stack/cxf/branches/arquillian/modules/testsuite/cxf-tests/src/test/scripts/jbws-testsuite-default.groovy 2014-11-24
16:22:05 UTC (rev 19111)
@@ -26,6 +26,28 @@
/**
* Add a security-domain block like this:
*
+ * <security-domain name="JBossWS-trust-sts"
cache-type="default">
+ * <authentication>
+ * <login-module code="UsersRoles" flag="required">
+ * <module-option name="usersProperties"
value="/mnt/ssd/jbossws/stack/cxf/trunk/modules/testsuite/cxf-tests/target/test-resources/jaxws/samples/wsse/policy/trust/WEB-INF/jbossws-users.properties"/>
+ * <module-option name="unauthenticatedIdentity"
value="anonymous"/>
+ * <module-option name="rolesProperties"
value="/mnt/ssd/jbossws/stack/cxf/trunk/modules/testsuite/cxf-tests/target/test-resources/jaxws/samples/wsse/policy/trust/WEB-INF/jbossws-roles.properties"/>
+ * </login-module>
+ * </authentication>
+ * </security-domain>
+ *
+ */
+
+def securityDomainSts = securityDomains.appendNode('security-domain',
['name':'JBossWS-trust-sts','cache-type':'default'])
+def authenticationSts = securityDomainSts.appendNode('authentication')
+def loginModuleSts = authenticationSts.appendNode('login-module',
['code':'UsersRoles','flag':'required'])
+loginModuleSts.appendNode('module-option',
['name':'unauthenticatedIdentity','value':'anonymous'])
+loginModuleSts.appendNode('module-option',
['name':'usersProperties','value':project.properties['testResourcesDir']
+ '/jaxws/samples/wsse/policy/trust/WEB-INF/jbossws-users.properties'])
+loginModuleSts.appendNode('module-option',
['name':'rolesProperties','value':project.properties['testResourcesDir']
+ '/jaxws/samples/wsse/policy/trust/WEB-INF/jbossws-roles.properties'])
+
+/**
+ * Add a security-domain block like this:
+ *
* <security-domain name="JBossWSDigest" cache-type="default">
* <authentication>
* <login-module code="UsersRoles" flag="required">