Author: jim.ma
Date: 2015-01-27 04:42:15 -0500 (Tue, 27 Jan 2015)
New Revision: 19430
Modified:
stack/cxf/branches/arquillian/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/SignTestCase.java
stack/cxf/branches/arquillian/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wssePolicy/SignTestCase.java
Log:
Fix SignTestCase
Modified:
stack/cxf/branches/arquillian/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/SignTestCase.java
===================================================================
---
stack/cxf/branches/arquillian/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/SignTestCase.java 2015-01-27
09:16:08 UTC (rev 19429)
+++
stack/cxf/branches/arquillian/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/SignTestCase.java 2015-01-27
09:42:15 UTC (rev 19430)
@@ -24,24 +24,11 @@
import java.io.File;
import java.net.URL;
import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
import java.util.Map;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
-import org.jboss.arquillian.container.test.api.Deployment;
-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.spec.WebArchive;
-import org.jboss.shrinkwrap.api.spec.JavaArchive;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.jboss.wsf.test.WrapThreadContextClassLoader;
-
import org.apache.cxf.binding.soap.saaj.SAAJInInterceptor;
import org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor;
import org.apache.cxf.endpoint.Client;
@@ -49,11 +36,17 @@
import org.apache.cxf.frontend.ClientProxy;
import org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor;
import org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.StringAsset;
-import org.jboss.wsf.test.JBossWSCXFTestSetup;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestHelper;
-import org.jboss.wsf.test.JBossWSTestHelper.BaseDeployment;
+import org.jboss.wsf.test.WrapThreadContextClassLoader;
+import org.junit.Test;
+import org.junit.runner.RunWith;
/**
* WS-Security sign test case
@@ -66,17 +59,7 @@
{
private final String serviceURL = "http://" + getServerHost() +
":" + getServerPort() + "/jaxws-samples-wsse-sign";
- @Deployment(name = "jaxws-samples-wsse-sign-client", order = 1, testable =
false)
- public static JavaArchive createJarDeployment() {
- JavaArchive archive = ShrinkWrap.create(JavaArchive.class,
"jaxws-samples-wsse-sign-client.jar");
- archive
- .addManifest()
- .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/sign/META-INF/alice.jks"), "alice.jks")
- .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/sign/META-INF/alice.properties"),
"alice.properties");
- return archive;
- }
-
- @Deployment(name="jaxws-samples-wsse-sign", order=2, testable = false)
+ @Deployment(name="jaxws-samples-wsse-sign", testable = false)
public static WebArchive createDeployment2() {
WebArchive archive =
ShrinkWrap.create(WebArchive.class,"jaxws-samples-wsse-sign.war");
archive
@@ -136,4 +119,15 @@
cxfEndpoint.getInInterceptors().add(wssIn);
cxfEndpoint.getInInterceptors().add(new SAAJInInterceptor());
}
+
+ @Override
+ protected String getClientJarPaths() {
+ return JBossWSTestHelper.writeToFile(new
JBossWSTestHelper.JarDeployment("jaxws-samples-wsse-sign-client.jar") { {
+ archive
+ .addManifest()
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/sign/META-INF/alice.jks"), "alice.jks")
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wsse/sign/META-INF/alice.properties"),
"alice.properties");
+ }
+ });
+ }
}
Modified:
stack/cxf/branches/arquillian/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wssePolicy/SignTestCase.java
===================================================================
---
stack/cxf/branches/arquillian/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wssePolicy/SignTestCase.java 2015-01-27
09:16:08 UTC (rev 19429)
+++
stack/cxf/branches/arquillian/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wssePolicy/SignTestCase.java 2015-01-27
09:42:15 UTC (rev 19430)
@@ -23,30 +23,24 @@
import java.io.File;
import java.net.URL;
-import java.util.LinkedList;
-import java.util.List;
import javax.xml.namespace.QName;
import javax.xml.ws.BindingProvider;
import javax.xml.ws.Service;
+import org.apache.cxf.ws.security.SecurityConstants;
import org.jboss.arquillian.container.test.api.Deployment;
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.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestHelper;
+import org.jboss.wsf.test.WrapThreadContextClassLoader;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.apache.cxf.ws.security.SecurityConstants;
-import org.jboss.shrinkwrap.api.asset.StringAsset;
-import org.jboss.wsf.test.JBossWSCXFTestSetup;
-import org.jboss.wsf.test.JBossWSTest;
-import org.jboss.wsf.test.JBossWSTestHelper;
-import org.jboss.wsf.test.JBossWSTestHelper.BaseDeployment;
-
/**
* WS-Security Policy sign test case
*
@@ -58,7 +52,7 @@
{
private final String serviceURL = "http://" + getServerHost() +
":" + getServerPort() + "/jaxws-samples-wssePolicy-sign";
- @Deployment(name="jaxws-samples-wssePolicy-sign", order=1, testable =
false)
+ @Deployment(name="jaxws-samples-wssePolicy-sign", testable = false)
public static WebArchive createDeployment1() {
WebArchive archive = ShrinkWrap.create(WebArchive.class,
"jaxws-samples-wssePolicy-sign.war");
archive
@@ -77,18 +71,10 @@
.setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wssePolicy/sign/WEB-INF/web.xml"));
return archive;
}
- @Deployment(name="jaxws-samples-wssePolicy-sign-client", order=2, testable =
false)
- public static JavaArchive createDeployment2() {
- JavaArchive archive = ShrinkWrap.create(JavaArchive.class,
"jaxws-samples-wssePolicy-sign-client.jar");
- archive
- .addManifest()
- .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wssePolicy/sign/META-INF/alice.jks"), "alice.jks")
- .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wssePolicy/sign/META-INF/alice.properties"),
"alice.properties");
- return archive;
- }
@Test
@RunAsClient
+ @WrapThreadContextClassLoader
public void test() throws Exception
{
QName serviceName = new
QName("http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy",
"SecurityService");
@@ -106,4 +92,16 @@
//workaround CXF requiring this even if no encryption is configured
((BindingProvider)proxy).getRequestContext().put(SecurityConstants.ENCRYPT_PROPERTIES,
Thread.currentThread().getContextClassLoader().getResource("META-INF/alice.properties"));
}
+
+ @Override
+ protected String getClientJarPaths() {
+ return JBossWSTestHelper.writeToFile(new
JBossWSTestHelper.JarDeployment("jaxws-samples-wssePolicy-sign-client.jar") { {
+ archive
+ .addManifest()
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wssePolicy/sign/META-INF/alice.jks"), "alice.jks")
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/samples/wssePolicy/sign/META-INF/alice.properties"),
"alice.properties");
+ }
+ });
+ }
+
}