cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1535746 - in /cxf/trunk/systests/ws-security/src/test: java/org/apache/cxf/systest/ws/wssc/ resources/org/apache/cxf/systest/ws/wssc/
Date Fri, 25 Oct 2013 14:13:22 GMT
Author: coheigea
Date: Fri Oct 25 14:13:21 2013
New Revision: 1535746

URL: http://svn.apache.org/r1535746
Log:
Adding more SecureConversation tests

Modified:
    cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssc/WSSCUnitTest.java
    cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/wssc/DoubleItWSSC.wsdl
    cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/wssc/client.xml
    cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/wssc/unit-server.xml

Modified: cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssc/WSSCUnitTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssc/WSSCUnitTest.java?rev=1535746&r1=1535745&r2=1535746&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssc/WSSCUnitTest.java
(original)
+++ cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssc/WSSCUnitTest.java
Fri Oct 25 14:13:21 2013
@@ -104,6 +104,52 @@ public class WSSCUnitTest extends Abstra
 
         ((java.io.Closeable)port).close();
     }
+    
+    @Test
+    public void testEndorsingSecureConverationDOMSP12() throws Exception {
+        
+        SpringBusFactory bf = new SpringBusFactory();
+        URL busFile = WSSCUnitTest.class.getResource("client.xml");
+
+        Bus bus = bf.createBus(busFile.toString());
+        SpringBusFactory.setDefaultBus(bus);
+        SpringBusFactory.setThreadDefaultBus(bus);
+        
+        URL wsdl = WSSCUnitTest.class.getResource("DoubleItWSSC.wsdl");
+        Service service = Service.create(wsdl, SERVICE_QNAME);
+        QName portQName = new QName(NAMESPACE, "DoubleItTransportSP12Port");
+        DoubleItPortType port = 
+                service.getPort(portQName, DoubleItPortType.class);
+        updateAddressPort(port, PORT);
+        
+        port.doubleIt(25);
+        
+        ((java.io.Closeable)port).close();
+    }
+    
+    @Test
+    public void testEndorsingSecureConverationStreamingSP12() throws Exception {
+        
+        SpringBusFactory bf = new SpringBusFactory();
+        URL busFile = WSSCUnitTest.class.getResource("client.xml");
+
+        Bus bus = bf.createBus(busFile.toString());
+        SpringBusFactory.setDefaultBus(bus);
+        SpringBusFactory.setThreadDefaultBus(bus);
+        
+        URL wsdl = WSSCUnitTest.class.getResource("DoubleItWSSC.wsdl");
+        Service service = Service.create(wsdl, SERVICE_QNAME);
+        QName portQName = new QName(NAMESPACE, "DoubleItTransportSP12Port");
+        DoubleItPortType port = 
+                service.getPort(portQName, DoubleItPortType.class);
+        updateAddressPort(port, PORT);
+        
+        // Streaming
+        SecurityTestUtil.enableStreaming(port);
+        port.doubleIt(30);
+
+        ((java.io.Closeable)port).close();
+    }
 
 
 }

Modified: cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/wssc/DoubleItWSSC.wsdl
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/wssc/DoubleItWSSC.wsdl?rev=1535746&r1=1535745&r2=1535746&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/wssc/DoubleItWSSC.wsdl
(original)
+++ cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/wssc/DoubleItWSSC.wsdl
Fri Oct 25 14:13:21 2013
@@ -23,9 +23,7 @@
     targetNamespace="http://www.example.org/contract/DoubleIt" 
     xmlns:wsp="http://www.w3.org/ns/ws-policy"
     xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
-    xmlns:wsaws="http://www.w3.org/2005/08/addressing" 
-    xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"
-    xmlns:sp13="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200802">
+    xmlns:wsaws="http://www.w3.org/2005/08/addressing">
     
     <wsdl:import location="src/test/resources/DoubleItLogical.wsdl" 
                  namespace="http://www.example.org/contract/DoubleIt"/>
@@ -50,13 +48,37 @@
         </wsdl:operation>
     </wsdl:binding>
     
+    <wsdl:binding name="DoubleItTransportSP12Binding" type="tns:DoubleItPortType">
+        <wsp:PolicyReference URI="#DoubleItTransportSP12Policy" />
+        <soap:binding style="document"
+            transport="http://schemas.xmlsoap.org/soap/http" />
+        <wsdl:operation name="DoubleIt">
+            <soap:operation soapAction="" />
+            <wsdl:input>
+                <soap:body use="literal" />
+                <wsp:PolicyReference URI="#DoubleItBinding_DoubleIt_Input_Policy"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal" />
+                <wsp:PolicyReference URI="#DoubleItBinding_DoubleIt_Output_Policy"/>
+            </wsdl:output>
+            <wsdl:fault name="DoubleItFault">
+                <soap:body use="literal" name="DoubleItFault" />
+            </wsdl:fault>
+        </wsdl:operation>
+    </wsdl:binding>
+    
     <wsdl:service name="DoubleItService">
         <wsdl:port name="DoubleItTransportPort" binding="tns:DoubleItTransportBinding">
             <soap:address location="https://localhost:9001/DoubleItTransport" />
         </wsdl:port>
+        <wsdl:port name="DoubleItTransportSP12Port" binding="tns:DoubleItTransportSP12Binding">
+            <soap:address location="https://localhost:9001/DoubleItTransportSP12" />
+        </wsdl:port>
     </wsdl:service>
 
-    <wsp:Policy wsu:Id="DoubleItTransportPolicy">
+    <wsp:Policy wsu:Id="DoubleItTransportPolicy" 
+        xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
         <wsp:ExactlyOne>
             <wsp:All>
                 <sp:TransportBinding>
@@ -134,8 +156,87 @@
         </wsp:ExactlyOne>
     </wsp:Policy>
     
+    <wsp:Policy wsu:Id="DoubleItTransportSP12Policy" 
+        xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+        <wsp:ExactlyOne>
+            <wsp:All>
+                <sp:TransportBinding>
+                    <wsp:Policy>
+                        <sp:TransportToken>
+                            <wsp:Policy>
+                                <sp:HttpsToken>
+                                    <wsp:Policy/>
+                                </sp:HttpsToken>
+                            </wsp:Policy>
+                        </sp:TransportToken>
+                        <sp:Layout>
+                            <wsp:Policy>
+                                <sp:Lax />
+                            </wsp:Policy>
+                        </sp:Layout>
+                        <sp:IncludeTimestamp />
+                        <sp:AlgorithmSuite>
+                            <wsp:Policy>
+                                <sp:Basic128 />
+                            </wsp:Policy>
+                        </sp:AlgorithmSuite>
+                    </wsp:Policy>
+                </sp:TransportBinding>
+                <sp:EndorsingSupportingTokens>
+                   <wsp:Policy>
+                        <sp:SecureConversationToken
+							sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient">
+							<wsp:Policy>
+								<sp:BootstrapPolicy>
+									<wsp:Policy>
+										<sp:TransportBinding>
+											<wsp:Policy>
+												<sp:TransportToken>
+													<wsp:Policy>
+														<sp:HttpsToken>
+														    <wsp:Policy />
+														</sp:HttpsToken>
+													</wsp:Policy>
+												</sp:TransportToken>
+												<sp:AlgorithmSuite>
+													<wsp:Policy>
+														<sp:Basic128 />
+													</wsp:Policy>
+												</sp:AlgorithmSuite>
+												<sp:Layout>
+													<wsp:Policy>
+														<sp:Lax />
+													</wsp:Policy>
+												</sp:Layout>
+											</wsp:Policy>
+										</sp:TransportBinding>
+										<sp:Wss11>
+											<wsp:Policy>
+												<sp:MustSupportRefKeyIdentifier />
+												<sp:MustSupportRefIssuerSerial />
+												<sp:MustSupportRefThumbprint />
+												<sp:MustSupportRefEncryptedKey />
+											</wsp:Policy>
+										</sp:Wss11>
+										<sp:Trust13>
+											<wsp:Policy>
+												<sp:MustSupportIssuedTokens />
+												<sp:RequireClientEntropy />
+												<sp:RequireServerEntropy />
+											</wsp:Policy>
+										</sp:Trust13>
+									</wsp:Policy>
+								</sp:BootstrapPolicy>
+							</wsp:Policy>
+						</sp:SecureConversationToken>
+                    </wsp:Policy>
+                </sp:EndorsingSupportingTokens>
+            </wsp:All>
+        </wsp:ExactlyOne>
+    </wsp:Policy>
+    
     <wsp:Policy wsu:Id="DoubleItBinding_DoubleIt_Input_Policy">
-      <wsp:ExactlyOne>
+      <wsp:ExactlyOne xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
          <wsp:All>
             <sp:EncryptedParts>
                <sp:Body/>
@@ -147,7 +248,7 @@
       </wsp:ExactlyOne>
    </wsp:Policy>
    <wsp:Policy wsu:Id="DoubleItBinding_DoubleIt_Output_Policy">
-      <wsp:ExactlyOne>
+      <wsp:ExactlyOne xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
          <wsp:All>
             <sp:EncryptedParts>
                <sp:Body/>

Modified: cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/wssc/client.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/wssc/client.xml?rev=1535746&r1=1535745&r2=1535746&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/wssc/client.xml
(original)
+++ cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/wssc/client.xml
Fri Oct 25 14:13:21 2013
@@ -39,14 +39,6 @@
         </cxf:features>
     </cxf:bus>
     
-    <jaxws:client name="{http://www.example.org/contract/DoubleIt}DoubleItKeyIdentifierPort"

-                  createdFromAPI="true">
-       <jaxws:properties>
-           <entry key="ws-security.username.sct" value="Alice"/>
-           <entry key="ws-security.callback-handler.sct" value="org.apache.cxf.systest.ws.common.UTPasswordCallback"/>
-       </jaxws:properties>
-    </jaxws:client>
-    
     <jaxws:client name="{http://WSSec/wssc}SecureConversation_UserNameOverTransport_IPingService"
createdFromAPI="true">
         <jaxws:properties>
             <entry key="ws-security.username.sct" value="Alice"/>

Modified: cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/wssc/unit-server.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/wssc/unit-server.xml?rev=1535746&r1=1535745&r2=1535746&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/wssc/unit-server.xml
(original)
+++ cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/wssc/unit-server.xml
Fri Oct 25 14:13:21 2013
@@ -79,4 +79,20 @@
      
     </jaxws:endpoint> 
     
+    <jaxws:endpoint 
+       id="TransportSP12"
+       address="https://localhost:${testutil.ports.UnitServer}/DoubleItTransportSP12" 
+       serviceName="s:DoubleItService"
+       endpointName="s:DoubleItTransportSP12Port"
+       xmlns:s="http://www.example.org/contract/DoubleIt"
+       implementor="org.apache.cxf.systest.ws.common.DoubleItImpl"
+       wsdlLocation="org/apache/cxf/systest/ws/wssc/DoubleItWSSC.wsdl"
+       depends-on="tls-settings">
+        
+       <jaxws:properties>
+           <entry key="ws-security.callback-handler.sct" value="org.apache.cxf.systest.ws.common.UTPasswordCallback"/>
+       </jaxws:properties> 
+     
+    </jaxws:endpoint> 
+    
 </beans>



Mime
View raw message