You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2013/07/30 11:51:17 UTC

svn commit: r1508365 - in /cxf/trunk/systests/ws-security/src/test: java/org/apache/cxf/systest/ws/parts/ resources/org/apache/cxf/systest/ws/parts/

Author: coheigea
Date: Tue Jul 30 09:51:16 2013
New Revision: 1508365

URL: http://svn.apache.org/r1508365
Log:
Adding SignedParts policies to various policies to get some tests to pass

Modified:
    cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/parts/StaxPartsTest.java
    cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/addr-policy.xml
    cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/bad-req-elements-policy.xml
    cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/bad-req-parts-policy.xml
    cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/content-encrypted-elements-policy.xml
    cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/encrypted-addr-policy.xml
    cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/encrypted-body-policy.xml
    cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/encrypted-elements-policy.xml
    cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/encrypted-parts-policy.xml
    cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/req-elements-policy.xml
    cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/req-parts-policy.xml

Modified: cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/parts/StaxPartsTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/parts/StaxPartsTest.java?rev=1508365&r1=1508364&r2=1508365&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/parts/StaxPartsTest.java (original)
+++ cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/parts/StaxPartsTest.java Tue Jul 30 09:51:16 2013
@@ -59,9 +59,7 @@ public class StaxPartsTest extends Abstr
         stopAllServers();
     }
     
-    // TODO See WSS-471
     @org.junit.Test
-    @org.junit.Ignore
     public void testRequiredParts() throws Exception {
 
         SpringBusFactory bf = new SpringBusFactory();
@@ -96,8 +94,8 @@ public class StaxPartsTest extends Abstr
             port.doubleIt(25);
             fail("Failure expected on a required header which isn't present");
         } catch (javax.xml.ws.soap.SOAPFaultException ex) {
-            // String error = "RequiredParts: No header element";
-            // assertTrue(ex.getMessage().contains(error));
+            String error = "must be present";
+            assertTrue(ex.getMessage().contains(error));
         }
 
         // Streaming
@@ -106,7 +104,7 @@ public class StaxPartsTest extends Abstr
             port.doubleIt(25);
             fail("Failure expected on a required header which isn't present");
         } catch (javax.xml.ws.soap.SOAPFaultException ex) {
-            // String error = "RequiredParts: No header element";
+            // String error = "must be present";
             // assertTrue(ex.getMessage().contains(error));
         }
         
@@ -191,9 +189,7 @@ public class StaxPartsTest extends Abstr
         bus.shutdown(true);
     }
     
-    // TODO See WSS-471
     @org.junit.Test
-    @org.junit.Ignore
     public void testEncryptedParts() throws Exception {
 
         SpringBusFactory bf = new SpringBusFactory();
@@ -228,8 +224,8 @@ public class StaxPartsTest extends Abstr
             port.doubleIt(25);
             fail("Failure expected on a body which isn't encrypted");
         } catch (javax.xml.ws.soap.SOAPFaultException ex) {
-            // String error = "EncryptedParts";
-            // assertTrue(ex.getMessage().contains(error));
+            String error = "Body must be encrypted";
+            assertTrue(ex.getMessage().contains(error));
         }
         
         // Streaming
@@ -238,7 +234,7 @@ public class StaxPartsTest extends Abstr
             port.doubleIt(25);
             fail("Failure expected on a body which isn't encrypted");
         } catch (javax.xml.ws.soap.SOAPFaultException ex) {
-            // String error = "EncryptedParts";
+            // String error = "Body must be encrypted";
             // assertTrue(ex.getMessage().contains(error));
         }
         
@@ -252,8 +248,8 @@ public class StaxPartsTest extends Abstr
             port.doubleIt(25);
             fail("Failure expected on a header which isn't encrypted");
         } catch (javax.xml.ws.soap.SOAPFaultException ex) {
-            // String error = "EncryptedParts";
-            // (ex.getMessage().contains(error));
+            String error = "To must be encrypted";
+            assertTrue(ex.getMessage().contains(error));
         }
         
         // Streaming
@@ -262,7 +258,7 @@ public class StaxPartsTest extends Abstr
             port.doubleIt(25);
             fail("Failure expected on a header which isn't encrypted");
         } catch (javax.xml.ws.soap.SOAPFaultException ex) {
-            // String error = "EncryptedParts";
+            // String error = "To must be encrypted";
             // assertTrue(ex.getMessage().contains(error));
         }
         

Modified: cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/addr-policy.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/addr-policy.xml?rev=1508365&r1=1508364&r2=1508365&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/addr-policy.xml (original)
+++ cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/addr-policy.xml Tue Jul 30 09:51:16 2013
@@ -39,6 +39,10 @@
                         </sp:AlgorithmSuite>
                     </wsp:Policy>
                 </sp:AsymmetricBinding>
+                <sp:SignedParts
+                    xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+                    <sp:Body />
+                </sp:SignedParts>
                 <wsaws:UsingAddressing xmlns:wsaws="http://www.w3.org/2006/05/addressing/wsdl" />
             </wsp:All>
         </wsp:ExactlyOne>

Modified: cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/bad-req-elements-policy.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/bad-req-elements-policy.xml?rev=1508365&r1=1508364&r2=1508365&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/bad-req-elements-policy.xml (original)
+++ cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/bad-req-elements-policy.xml Tue Jul 30 09:51:16 2013
@@ -43,6 +43,10 @@
                       xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
                     <sp:XPath xmlns:wsa="http://www.w3.org/2005/08/addressing">wsa:ToTo</sp:XPath>
                 </sp:RequiredElements>
+                <sp:SignedParts
+                    xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+                    <sp:Body />
+                </sp:SignedParts>
                 <wsaws:UsingAddressing xmlns:wsaws="http://www.w3.org/2006/05/addressing/wsdl" />
             </wsp:All>
         </wsp:ExactlyOne>

Modified: cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/bad-req-parts-policy.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/bad-req-parts-policy.xml?rev=1508365&r1=1508364&r2=1508365&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/bad-req-parts-policy.xml (original)
+++ cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/bad-req-parts-policy.xml Tue Jul 30 09:51:16 2013
@@ -43,6 +43,10 @@
                     xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
                     <sp:Header Name="ToTo" Namespace="http://www.w3.org/2005/08/addressing"/>
                 </sp:RequiredParts>
+                <sp:SignedParts
+                    xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+                    <sp:Body />
+                </sp:SignedParts>
                 <wsaws:UsingAddressing xmlns:wsaws="http://www.w3.org/2006/05/addressing/wsdl" />
             </wsp:All>
         </wsp:ExactlyOne>

Modified: cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/content-encrypted-elements-policy.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/content-encrypted-elements-policy.xml?rev=1508365&r1=1508364&r2=1508365&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/content-encrypted-elements-policy.xml (original)
+++ cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/content-encrypted-elements-policy.xml Tue Jul 30 09:51:16 2013
@@ -43,6 +43,10 @@
                       xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
                     <sp:XPath xmlns:wsa="http://www.w3.org/2005/08/addressing">//wsa:To</sp:XPath>
                 </sp:ContentEncryptedElements>
+                <sp:SignedParts
+                    xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+                    <sp:Body />
+                </sp:SignedParts>
                 <wsaws:UsingAddressing xmlns:wsaws="http://www.w3.org/2006/05/addressing/wsdl" />
             </wsp:All>
         </wsp:ExactlyOne>

Modified: cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/encrypted-addr-policy.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/encrypted-addr-policy.xml?rev=1508365&r1=1508364&r2=1508365&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/encrypted-addr-policy.xml (original)
+++ cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/encrypted-addr-policy.xml Tue Jul 30 09:51:16 2013
@@ -43,6 +43,10 @@
                     xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
                     <sp:Header Name="To" Namespace="http://www.w3.org/2005/08/addressing"/>
                 </sp:EncryptedParts>
+                <sp:SignedParts
+                    xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+                    <sp:Body />
+                </sp:SignedParts>
                 <wsaws:UsingAddressing xmlns:wsaws="http://www.w3.org/2006/05/addressing/wsdl" />
             </wsp:All>
         </wsp:ExactlyOne>

Modified: cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/encrypted-body-policy.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/encrypted-body-policy.xml?rev=1508365&r1=1508364&r2=1508365&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/encrypted-body-policy.xml (original)
+++ cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/encrypted-body-policy.xml Tue Jul 30 09:51:16 2013
@@ -43,6 +43,10 @@
                     xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
                     <sp:Body />
                 </sp:EncryptedParts>
+                <sp:SignedParts
+                    xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+                    <sp:Body />
+                </sp:SignedParts>
                 <wsaws:UsingAddressing xmlns:wsaws="http://www.w3.org/2006/05/addressing/wsdl" />
             </wsp:All>
         </wsp:ExactlyOne>

Modified: cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/encrypted-elements-policy.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/encrypted-elements-policy.xml?rev=1508365&r1=1508364&r2=1508365&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/encrypted-elements-policy.xml (original)
+++ cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/encrypted-elements-policy.xml Tue Jul 30 09:51:16 2013
@@ -43,6 +43,10 @@
                       xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
                     <sp:XPath xmlns:wsa="http://www.w3.org/2005/08/addressing">//wsa:To</sp:XPath>
                 </sp:EncryptedElements>
+                <sp:SignedParts
+                    xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+                    <sp:Body />
+                </sp:SignedParts>
                 <wsaws:UsingAddressing xmlns:wsaws="http://www.w3.org/2006/05/addressing/wsdl" />
             </wsp:All>
         </wsp:ExactlyOne>

Modified: cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/encrypted-parts-policy.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/encrypted-parts-policy.xml?rev=1508365&r1=1508364&r2=1508365&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/encrypted-parts-policy.xml (original)
+++ cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/encrypted-parts-policy.xml Tue Jul 30 09:51:16 2013
@@ -44,6 +44,10 @@
                     <sp:Header Name="To" Namespace="http://www.w3.org/2005/08/addressing"/>
                     <sp:Body />
                 </sp:EncryptedParts>
+                <sp:SignedParts
+                    xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+                    <sp:Body />
+                </sp:SignedParts>
                 <wsaws:UsingAddressing xmlns:wsaws="http://www.w3.org/2006/05/addressing/wsdl" />
             </wsp:All>
         </wsp:ExactlyOne>

Modified: cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/req-elements-policy.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/req-elements-policy.xml?rev=1508365&r1=1508364&r2=1508365&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/req-elements-policy.xml (original)
+++ cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/req-elements-policy.xml Tue Jul 30 09:51:16 2013
@@ -43,6 +43,10 @@
                       xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
                     <sp:XPath xmlns:wsa="http://www.w3.org/2005/08/addressing">//wsa:To</sp:XPath>
                 </sp:RequiredElements>
+                <sp:SignedParts
+                    xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+                    <sp:Body />
+                </sp:SignedParts>
                 <wsaws:UsingAddressing xmlns:wsaws="http://www.w3.org/2006/05/addressing/wsdl" />
             </wsp:All>
         </wsp:ExactlyOne>

Modified: cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/req-parts-policy.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/req-parts-policy.xml?rev=1508365&r1=1508364&r2=1508365&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/req-parts-policy.xml (original)
+++ cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/parts/req-parts-policy.xml Tue Jul 30 09:51:16 2013
@@ -43,6 +43,10 @@
                     xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
                     <sp:Header Name="To" Namespace="http://www.w3.org/2005/08/addressing"/>
                 </sp:RequiredParts>
+                <sp:SignedParts
+                    xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+                    <sp:Body />
+                </sp:SignedParts>
                 <wsaws:UsingAddressing xmlns:wsaws="http://www.w3.org/2006/05/addressing/wsdl" />
             </wsp:All>
         </wsp:ExactlyOne>