cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [29/48] cxf git commit: Adding a signature + encryption SWA test
Date Wed, 29 Jun 2016 22:44:27 GMT
Adding a signature + encryption SWA test


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/0eafb7f8
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/0eafb7f8
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/0eafb7f8

Branch: refs/heads/master-jaxrs-2.1
Commit: 0eafb7f8867f3780fa9356a50aaee6f2e99d362e
Parents: 7e55d08
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Mon Jun 27 11:06:44 2016 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Mon Jun 27 11:06:44 2016 +0100

----------------------------------------------------------------------
 .../cxf/systest/ws/swa/SWAActionTest.java       | 24 ++++++++++++++
 .../apache/cxf/systest/ws/swa/DoubleItSwa.wsdl  |  3 ++
 .../org/apache/cxf/systest/ws/swa/client.xml    | 34 ++++++++++++++++++++
 .../org/apache/cxf/systest/ws/swa/server.xml    | 34 ++++++++++++++++++++
 4 files changed, 95 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/0eafb7f8/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/swa/SWAActionTest.java
----------------------------------------------------------------------
diff --git a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/swa/SWAActionTest.java
b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/swa/SWAActionTest.java
index 1f10762..fbccbb7 100644
--- a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/swa/SWAActionTest.java
+++ b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/swa/SWAActionTest.java
@@ -157,4 +157,28 @@ public class SWAActionTest extends AbstractBusClientServerTestBase {
         bus.shutdown(true);
     }
     
+    @org.junit.Test
+    public void testSWASignatureEncryptionContentAction() throws Exception {
+
+        SpringBusFactory bf = new SpringBusFactory();
+        URL busFile = SWAActionTest.class.getResource("client.xml");
+
+        Bus bus = bf.createBus(busFile.toString());
+        SpringBusFactory.setDefaultBus(bus);
+        SpringBusFactory.setThreadDefaultBus(bus);
+        
+        URL wsdl = SWAActionTest.class.getResource("DoubleItSwa.wsdl");
+        Service service = Service.create(wsdl, SERVICE_QNAME);
+        QName portQName = new QName(NAMESPACE, "DoubleItSWASignatureEncryptionContentActionPort");
+        DoubleItSwaPortType port = 
+                service.getPort(portQName, DoubleItSwaPortType.class);
+        updateAddressPort(port, PORT);
+        
+        DoubleIt3 doubleIt = new DoubleIt3();
+        doubleIt.setNumberToDouble(25);
+        port.doubleIt3(doubleIt, "12345".getBytes());
+        
+        ((java.io.Closeable)port).close();
+        bus.shutdown(true);
+    }
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/0eafb7f8/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/swa/DoubleItSwa.wsdl
----------------------------------------------------------------------
diff --git a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/swa/DoubleItSwa.wsdl
b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/swa/DoubleItSwa.wsdl
index 204bcc2..1a6885c 100644
--- a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/swa/DoubleItSwa.wsdl
+++ b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/swa/DoubleItSwa.wsdl
@@ -205,6 +205,9 @@
         <wsdl:port name="DoubleItSWAEncryptionCompleteActionPort" binding="tns:DoubleItNoSecurityBinding">
             <soap:address location="http://localhost:9001/DoubleItSWAEncryptionCompleteAction"/>
         </wsdl:port>
+        <wsdl:port name="DoubleItSWASignatureEncryptionContentActionPort" binding="tns:DoubleItNoSecurityBinding">
+            <soap:address location="http://localhost:9001/DoubleItSWASignatureEncryptionContentAction"/>
+        </wsdl:port>
         <wsdl:port name="DoubleItSWASignatureContentPolicyPort" binding="tns:DoubleItSignatureContentBinding">
             <soap:address location="http://localhost:9001/DoubleItSWASignatureContentPolicy"/>
         </wsdl:port>

http://git-wip-us.apache.org/repos/asf/cxf/blob/0eafb7f8/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/swa/client.xml
----------------------------------------------------------------------
diff --git a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/swa/client.xml
b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/swa/client.xml
index 79dbcaa..2eb7bd6 100644
--- a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/swa/client.xml
+++ b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/swa/client.xml
@@ -136,4 +136,38 @@
         </jaxws:inInterceptors>
     </jaxws:client>
     
+    <jaxws:client name="{http://www.example.org/contract/DoubleIt}DoubleItSWASignatureEncryptionContentActionPort"
createdFromAPI="true">
+        <jaxws:outInterceptors>
+            <bean class="org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor">
+                <constructor-arg>
+                    <map>
+                        <entry key="action" value="Timestamp Signature Encrypt"/>
+                        <entry key="signatureUser" value="alice"/>
+                        <entry key="signaturePropFile" value="alice.properties"/>
+                        <entry key="signatureKeyIdentifier" value="DirectReference"/>
+                        <entry key="signatureParts" 
+                               value="{}cid:Attachments;{}{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Timestamp;{}{http://schemas.xmlsoap.org/soap/envelope/}Body;"/>
+                        <entry key="passwordCallbackClass" value="org.apache.cxf.systest.ws.common.KeystorePasswordCallback"/>
+                        <entry key="encryptionUser" value="bob"/>
+                        <entry key="encryptionPropFile" value="bob.properties"/>
+                        <entry key="encryptionParts" 
+                               value="{}{http://schemas.xmlsoap.org/soap/envelope/}Body;{Element}cid:Attachments;"/>
+                    </map>
+                </constructor-arg>
+            </bean>
+        </jaxws:outInterceptors>
+        <jaxws:inInterceptors>
+            <bean class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
+                <constructor-arg>
+                    <map>
+                        <entry key="action" value="Signature Encrypt"/>
+                        <entry key="signatureVerificationPropFile" value="alice.properties"/>
+                        <entry key="decryptionPropFile" value="alice.properties"/>
+                        <entry key="passwordCallbackClass" value="org.apache.cxf.systest.ws.common.KeystorePasswordCallback"/>
+                    </map>
+                </constructor-arg>
+            </bean>
+        </jaxws:inInterceptors>
+    </jaxws:client>
+    
 </beans>

http://git-wip-us.apache.org/repos/asf/cxf/blob/0eafb7f8/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/swa/server.xml
----------------------------------------------------------------------
diff --git a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/swa/server.xml
b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/swa/server.xml
index 11a636d..b6c87cd 100644
--- a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/swa/server.xml
+++ b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/swa/server.xml
@@ -146,4 +146,38 @@
         </jaxws:inInterceptors>
     </jaxws:endpoint>
     
+     <jaxws:endpoint xmlns:s="http://www.example.org/contract/DoubleIt" id="SignatureEncryptionContentAction"

+        address="http://localhost:${testutil.ports.swa.Server}/DoubleItSWASignatureEncryptionContentAction"

+        serviceName="s:DoubleItService" endpointName="s:DoubleItSWASignatureEncryptionContentActionPort"

+        implementor="org.apache.cxf.systest.ws.swa.DoubleIt3Impl" 
+        wsdlLocation="org/apache/cxf/systest/ws/swa/DoubleItSwa.wsdl">
+        <jaxws:outInterceptors>
+            <bean class="org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor">
+                <constructor-arg>
+                    <map>
+                        <entry key="action" value="Signature Encrypt"/>
+                        <entry key="signatureUser" value="bob"/>
+                        <entry key="signaturePropFile" value="bob.properties"/>
+                        <entry key="signatureKeyIdentifier" value="DirectReference"/>
+                        <entry key="passwordCallbackClass" value="org.apache.cxf.systest.ws.common.KeystorePasswordCallback"/>
+                        <entry key="encryptionUser" value="alice"/>
+                        <entry key="encryptionPropFile" value="alice.properties"/>
+                    </map>
+                </constructor-arg>
+            </bean>
+        </jaxws:outInterceptors>
+        <jaxws:inInterceptors>
+            <bean class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
+                <constructor-arg>
+                    <map>
+                        <entry key="action" value="Signature Timestamp Encrypt"/>
+                        <entry key="signatureVerificationPropFile" value="bob.properties"/>
+                        <entry key="decryptionPropFile" value="bob.properties"/>
+                        <entry key="passwordCallbackClass" value="org.apache.cxf.systest.ws.common.KeystorePasswordCallback"/>
+                    </map>
+                </constructor-arg>
+            </bean>
+        </jaxws:inInterceptors>
+    </jaxws:endpoint>
+    
 </beans>


Mime
View raw message