Author: alessio.soldano(a)jboss.com
Date: 2012-02-28 05:01:38 -0500 (Tue, 28 Feb 2012)
New Revision: 15767
Added:
stack/cxf/branches/jbossws-cxf-4.0.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/SignEncryptGCMTestCase.java
Modified:
stack/cxf/branches/jbossws-cxf-4.0.x/
stack/cxf/branches/jbossws-cxf-4.0.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/MultipleClientsServiceImpl.java
stack/cxf/branches/jbossws-cxf-4.0.x/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/basic/sign-encrypt/WEB-INF/jaxws-endpoint-config.xml
Log:
Merged revisions 15765-15766 via svnmerge from
https://svn.jboss.org/repos/jbossws/stack/cxf/trunk
.......
r15765 | alessio.soldano(a)jboss.com | 2012-02-28 10:44:57 +0100 (Tue, 28 Feb 2012) | 2
lines
[JBWS-3439] Actually adding the testcase class (previously forgotten)
.......
r15766 | alessio.soldano(a)jboss.com | 2012-02-28 10:55:30 +0100 (Tue, 28 Feb 2012) | 2
lines
[JBWS_3439] Testing new wss4j features
.......
Property changes on: stack/cxf/branches/jbossws-cxf-4.0.x
___________________________________________________________________
Modified: svnmerge-integrated
-
https://svn.jboss.org/repos/jbossws/stack/cxf/trunk:1-15635,15658,15668,1...
+
https://svn.jboss.org/repos/jbossws/stack/cxf/trunk:1-15635,15658,15668,1...
Modified: svn:mergeinfo
- /stack/cxf/branches/asoldano:14032-14050,14068
/stack/cxf/trunk:15658,15668,15674-15675,15682,15695-15697,15708,15711,15713,15719,15723-15730,15738,15743,15748,15750-15751,15754-15757
+ /stack/cxf/branches/asoldano:14032-14050,14068
/stack/cxf/trunk:15658,15668,15674-15675,15682,15695-15697,15708,15711,15713,15719,15723-15730,15738,15743,15748,15750-15751,15754-15757,15765-15766
Modified:
stack/cxf/branches/jbossws-cxf-4.0.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/MultipleClientsServiceImpl.java
===================================================================
---
stack/cxf/branches/jbossws-cxf-4.0.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/MultipleClientsServiceImpl.java 2012-02-28
09:55:30 UTC (rev 15766)
+++
stack/cxf/branches/jbossws-cxf-4.0.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/MultipleClientsServiceImpl.java 2012-02-28
10:01:38 UTC (rev 15767)
@@ -40,6 +40,7 @@
@EndpointProperty(key = "ws-security.encryption.properties", value =
"bob2.properties"),
@EndpointProperty(key = "ws-security.signature.username", value =
"bob"),
@EndpointProperty(key = "ws-security.encryption.username", value =
"useReqSigCert"),
+ @EndpointProperty(key = "requireSignedEncryptedDataElements", value =
"true"),
@EndpointProperty(key = "ws-security.callback-handler", value =
"org.jboss.test.ws.jaxws.samples.wsse.policy.basic.KeystorePasswordCallback")
}
)
Copied:
stack/cxf/branches/jbossws-cxf-4.0.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/SignEncryptGCMTestCase.java
(from rev 15766,
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/SignEncryptGCMTestCase.java)
===================================================================
---
stack/cxf/branches/jbossws-cxf-4.0.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/SignEncryptGCMTestCase.java
(rev 0)
+++
stack/cxf/branches/jbossws-cxf-4.0.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/SignEncryptGCMTestCase.java 2012-02-28
10:01:38 UTC (rev 15767)
@@ -0,0 +1,78 @@
+/*
+ * 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.basic;
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+import javax.xml.ws.soap.SOAPFaultException;
+
+import junit.framework.Test;
+
+import org.apache.cxf.ws.security.SecurityConstants;
+import org.jboss.wsf.test.JBossWSCXFTestSetup;
+import org.jboss.wsf.test.JBossWSTest;
+
+/**
+ * WS-Security Policy sign & encrypt test case
+ * using GCM algorithm suite
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 27-Feb-2012
+ */
+public final class SignEncryptGCMTestCase extends JBossWSTest
+{
+ private final String serviceURL = "http://" + getServerHost() +
":8080/jaxws-samples-wsse-policy-sign-encrypt-gcm";
+
+ public static Test suite()
+ {
+ return new JBossWSCXFTestSetup(SignEncryptGCMTestCase.class,
"jaxws-samples-wsse-policy-sign-encrypt-client.jar
jaxws-samples-wsse-policy-sign-encrypt-gcm.war");
+ }
+
+ public void test() throws Exception
+ {
+ QName serviceName = new
QName("http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy",
"SecurityService");
+ URL wsdlURL = new URL(serviceURL + "?wsdl");
+ Service service = Service.create(wsdlURL, serviceName);
+ ServiceIface proxy = (ServiceIface)service.getPort(ServiceIface.class);
+ setupWsse(proxy);
+ try
+ {
+ assertEquals("Secure Hello World!", proxy.sayHello());
+ }
+ catch (SOAPFaultException e)
+ {
+ throw new Exception("Please check that the Bouncy Castle provider is
installed.", e);
+ }
+ }
+
+ private void setupWsse(ServiceIface proxy)
+ {
+
((BindingProvider)proxy).getRequestContext().put(SecurityConstants.CALLBACK_HANDLER, new
KeystorePasswordCallback());
+
((BindingProvider)proxy).getRequestContext().put(SecurityConstants.SIGNATURE_PROPERTIES,
Thread.currentThread().getContextClassLoader().getResource("META-INF/alice.properties"));
+
((BindingProvider)proxy).getRequestContext().put(SecurityConstants.ENCRYPT_PROPERTIES,
Thread.currentThread().getContextClassLoader().getResource("META-INF/alice.properties"));
+
((BindingProvider)proxy).getRequestContext().put(SecurityConstants.SIGNATURE_USERNAME,
"alice");
+
((BindingProvider)proxy).getRequestContext().put(SecurityConstants.ENCRYPT_USERNAME,
"bob");
+ }
+}
Modified:
stack/cxf/branches/jbossws-cxf-4.0.x/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/basic/sign-encrypt/WEB-INF/jaxws-endpoint-config.xml
===================================================================
---
stack/cxf/branches/jbossws-cxf-4.0.x/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/basic/sign-encrypt/WEB-INF/jaxws-endpoint-config.xml 2012-02-28
09:55:30 UTC (rev 15766)
+++
stack/cxf/branches/jbossws-cxf-4.0.x/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/basic/sign-encrypt/WEB-INF/jaxws-endpoint-config.xml 2012-02-28
10:01:38 UTC (rev 15767)
@@ -22,6 +22,10 @@
<property-value>alice</property-value>
</property>
<property>
+ <property-name>requireSignedEncryptedDataElements</property-name>
+ <property-value>true</property-value>
+ </property>
+ <property>
<property-name>ws-security.callback-handler</property-name>
<property-value>org.jboss.test.ws.jaxws.samples.wsse.policy.basic.KeystorePasswordCallback</property-value>
</property>