cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1477153 - in /cxf/branches/wss4j2.0-port/systests/ws-security/src/test: java/org/apache/cxf/systest/ws/coverage_checker/ resources/org/apache/cxf/systest/ws/coverage_checker/ resources/org/apache/cxf/systest/ws/coverage_checker/client/ res...
Date Mon, 29 Apr 2013 15:33:01 GMT
Author: coheigea
Date: Mon Apr 29 15:32:57 2013
New Revision: 1477153

URL: http://svn.apache.org/r1477153
Log:
Adding some tests for a secured SOAP Fault

Modified:
    cxf/branches/wss4j2.0-port/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/coverage_checker/DefaultCryptoCoverageCheckerTest.java
    cxf/branches/wss4j2.0-port/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/coverage_checker/DoubleItCoverageChecker.wsdl
    cxf/branches/wss4j2.0-port/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/coverage_checker/client/client.xml
    cxf/branches/wss4j2.0-port/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/coverage_checker/server/server.xml

Modified: cxf/branches/wss4j2.0-port/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/coverage_checker/DefaultCryptoCoverageCheckerTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/wss4j2.0-port/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/coverage_checker/DefaultCryptoCoverageCheckerTest.java?rev=1477153&r1=1477152&r2=1477153&view=diff
==============================================================================
--- cxf/branches/wss4j2.0-port/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/coverage_checker/DefaultCryptoCoverageCheckerTest.java
(original)
+++ cxf/branches/wss4j2.0-port/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/coverage_checker/DefaultCryptoCoverageCheckerTest.java
Mon Apr 29 15:32:57 2013
@@ -462,4 +462,37 @@ public class DefaultCryptoCoverageChecke
         ((java.io.Closeable)port).close();
         bus.shutdown(true);
     }
+    
+    // Here the service is sending an secured message back to the client. For a server Fault

+    // message it should return a secured Fault message as well
+    @org.junit.Test
+    public void testClientChecker2() throws Exception {
+        SpringBusFactory bf = new SpringBusFactory();
+        URL busFile = DefaultCryptoCoverageCheckerTest.class.getResource("client/client.xml");
+
+        Bus bus = bf.createBus(busFile.toString());
+        SpringBusFactory.setDefaultBus(bus);
+        SpringBusFactory.setThreadDefaultBus(bus);
+        
+        URL wsdl = DefaultCryptoCoverageCheckerTest.class.getResource("DoubleItCoverageChecker.wsdl");
+        Service service = Service.create(wsdl, SERVICE_QNAME);
+        QName portQName = new QName(NAMESPACE, "DoubleItClientCheckerPort2");
+        DoubleItPortType port = 
+                service.getPort(portQName, DoubleItPortType.class);
+        updateAddressPort(port, PORT);
+        
+        port.doubleIt(25);
+        
+        // Now try with a message that will create a Fault in the SEI
+        try {
+            port.doubleIt(0);
+            fail("Failure expected on trying to double 0");
+        } catch (Exception ex) {
+            assertTrue(ex.getMessage().contains("0 can't be doubled"));
+        }
+        
+        ((java.io.Closeable)port).close();
+        bus.shutdown(true);
+    }
+    
 }

Modified: cxf/branches/wss4j2.0-port/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/coverage_checker/DoubleItCoverageChecker.wsdl
URL: http://svn.apache.org/viewvc/cxf/branches/wss4j2.0-port/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/coverage_checker/DoubleItCoverageChecker.wsdl?rev=1477153&r1=1477152&r2=1477153&view=diff
==============================================================================
--- cxf/branches/wss4j2.0-port/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/coverage_checker/DoubleItCoverageChecker.wsdl
(original)
+++ cxf/branches/wss4j2.0-port/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/coverage_checker/DoubleItCoverageChecker.wsdl
Mon Apr 29 15:32:57 2013
@@ -80,6 +80,9 @@
         <wsdl:port name="DoubleItClientCheckerPort" binding="tns:DoubleItSoapBinding">
             <soap:address location="http://localhost:9001/DoubleItClientChecker" />
         </wsdl:port>
+        <wsdl:port name="DoubleItClientCheckerPort2" binding="tns:DoubleItSoapBinding">
+            <soap:address location="http://localhost:9001/DoubleItClientChecker2" />
+        </wsdl:port>
     </wsdl:service>
     
 </wsdl:definitions>

Modified: cxf/branches/wss4j2.0-port/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/coverage_checker/client/client.xml
URL: http://svn.apache.org/viewvc/cxf/branches/wss4j2.0-port/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/coverage_checker/client/client.xml?rev=1477153&r1=1477152&r2=1477153&view=diff
==============================================================================
--- cxf/branches/wss4j2.0-port/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/coverage_checker/client/client.xml
(original)
+++ cxf/branches/wss4j2.0-port/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/coverage_checker/client/client.xml
Mon Apr 29 15:32:57 2013
@@ -77,4 +77,33 @@
        </jaxws:inInterceptors>
     </jaxws:client>
     
+    <jaxws:client name="{http://www.example.org/contract/DoubleIt}DoubleItClientCheckerPort2"

+                  createdFromAPI="true">
+        <jaxws:inInterceptors>
+        <bean class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
+           <constructor-arg>
+            <map>
+               <entry key="action" value="Signature"/>
+               <entry key="signaturePropFile" value="org/apache/cxf/systest/ws/wssec10/client/alice.properties"/>
+               <entry key="passwordCallbackClass" 
+                  value="org.apache.cxf.systest.ws.wssec10.client.KeystorePasswordCallback"/>
+            </map>
+           </constructor-arg>
+        </bean>
+        <bean class="org.apache.cxf.ws.security.wss4j.DefaultCryptoCoverageChecker" />
+       </jaxws:inInterceptors>
+       <jaxws:inFaultInterceptors>
+        <bean class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
+           <constructor-arg>
+            <map>
+               <entry key="action" value="Signature"/>
+               <entry key="signaturePropFile" value="org/apache/cxf/systest/ws/wssec10/client/alice.properties"/>
+               <entry key="passwordCallbackClass" 
+                  value="org.apache.cxf.systest.ws.wssec10.client.KeystorePasswordCallback"/>
+            </map>
+           </constructor-arg>
+        </bean>
+       </jaxws:inFaultInterceptors>
+    </jaxws:client>
+    
 </beans>

Modified: cxf/branches/wss4j2.0-port/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/coverage_checker/server/server.xml
URL: http://svn.apache.org/viewvc/cxf/branches/wss4j2.0-port/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/coverage_checker/server/server.xml?rev=1477153&r1=1477152&r2=1477153&view=diff
==============================================================================
--- cxf/branches/wss4j2.0-port/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/coverage_checker/server/server.xml
(original)
+++ cxf/branches/wss4j2.0-port/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/coverage_checker/server/server.xml
Mon Apr 29 15:32:57 2013
@@ -172,5 +172,41 @@
         </bean>
        </jaxws:outInterceptors>
     </jaxws:endpoint> 
+     
+    <jaxws:endpoint 
+       id="ClientChecker2"
+       address="http://localhost:${testutil.ports.Server}/DoubleItClientChecker2" 
+       serviceName="s:DoubleItService"
+       endpointName="s:DoubleItClientCheckerPort2"
+       xmlns:s="http://www.example.org/contract/DoubleIt"
+       implementor="org.apache.cxf.systest.ws.common.DoubleItImpl"
+       wsdlLocation="org/apache/cxf/systest/ws/coverage_checker/DoubleItCoverageChecker.wsdl">
+       <jaxws:outInterceptors>
+         <bean class="org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor">
+           <constructor-arg>
+            <map>
+               <entry key="action" value="Signature"/>
+               <entry key="signaturePropFile" value="org/apache/cxf/systest/ws/wssec10/client/alice.properties"/>
+               <entry key="passwordCallbackClass" 
+                  value="org.apache.cxf.systest.ws.wssec10.client.KeystorePasswordCallback"/>
+               <entry key="user" value="alice"/>
+            </map>
+           </constructor-arg>
+        </bean>
+       </jaxws:outInterceptors>
+       <jaxws:outFaultInterceptors>
+         <bean class="org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor">
+           <constructor-arg>
+            <map>
+               <entry key="action" value="Signature"/>
+               <entry key="signaturePropFile" value="org/apache/cxf/systest/ws/wssec10/client/alice.properties"/>
+               <entry key="passwordCallbackClass" 
+                  value="org.apache.cxf.systest.ws.wssec10.client.KeystorePasswordCallback"/>
+               <entry key="user" value="alice"/>
+            </map>
+           </constructor-arg>
+        </bean>
+       </jaxws:outFaultInterceptors>
+    </jaxws:endpoint> 
    
 </beans>



Mime
View raw message