cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1501312 - in /cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws: parts/StaxPartsTest.java saml/StaxSamlTokenTest.java x509/StaxX509TokenTest.java
Date Tue, 09 Jul 2013 15:05:58 GMT
Author: coheigea
Date: Tue Jul  9 15:05:57 2013
New Revision: 1501312

URL: http://svn.apache.org/r1501312
Log:
Some better security error checking

Modified:
    cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/parts/StaxPartsTest.java
    cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/saml/StaxSamlTokenTest.java
    cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/x509/StaxX509TokenTest.java

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=1501312&r1=1501311&r2=1501312&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  9 15:05:57 2013
@@ -149,8 +149,8 @@ public class StaxPartsTest extends Abstr
             port.doubleIt(25);
             fail("Failure expected on a body which isn't signed");
         } catch (javax.xml.ws.soap.SOAPFaultException ex) {
-            // String error = "SignedParts";
-            // assertTrue(ex.getMessage().contains(error));
+            String error = "Body must be signed";
+            assertTrue(ex.getMessage().contains(error));
         }
         
         // Streaming
@@ -173,8 +173,8 @@ public class StaxPartsTest extends Abstr
             port.doubleIt(25);
             fail("Failure expected on a header which isn't signed");
         } catch (javax.xml.ws.soap.SOAPFaultException ex) {
-            // String error = "SignedParts";
-            // assertTrue(ex.getMessage().contains(error));
+            String error = "To must be signed";
+            assertTrue(ex.getMessage().contains(error));
         }
         
         // Streaming

Modified: cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/saml/StaxSamlTokenTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/saml/StaxSamlTokenTest.java?rev=1501312&r1=1501311&r2=1501312&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/saml/StaxSamlTokenTest.java
(original)
+++ cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/saml/StaxSamlTokenTest.java
Tue Jul  9 15:05:57 2013
@@ -324,7 +324,8 @@ public class StaxSamlTokenTest extends A
             saml2Port.doubleIt(25);
             fail("Expected failure on an invocation with a SAML1 Assertion");
         } catch (javax.xml.ws.soap.SOAPFaultException ex) {
-            // assertTrue(ex.getMessage().contains("Wrong SAML Version"));
+            String error = "Policy enforces SamlVersion20Profile11 but we got 1.1";
+            assertTrue(ex.getMessage().contains(error));
         }
         
         ((BindingProvider)saml2Port).getRequestContext().put(
@@ -410,7 +411,7 @@ public class StaxSamlTokenTest extends A
             saml2Port.doubleIt(25);
             fail("Expected failure on an invocation with an unsigned SAML SV Assertion");
         } catch (javax.xml.ws.soap.SOAPFaultException ex) {
-            // assertTrue(ex.getMessage().contains("SamlToken not satisfied"));
+            assertTrue(ex.getMessage().contains("SamlToken not satisfied"));
         }
         
         ((java.io.Closeable)saml2Port).close();
@@ -448,7 +449,8 @@ public class StaxSamlTokenTest extends A
             saml2Port.doubleIt(25);
             fail("Expected failure on an invocation with a SAML1 Assertion");
         } catch (javax.xml.ws.soap.SOAPFaultException ex) {
-            // assertTrue(ex.getMessage().contains("Wrong SAML Version"));
+            String error = "Policy enforces SamlVersion20Profile11 but we got 1.1";
+            assertTrue(ex.getMessage().contains(error));
         }
         
         ((BindingProvider)saml2Port).getRequestContext().put(
@@ -470,8 +472,8 @@ public class StaxSamlTokenTest extends A
             saml2Port.doubleIt(25);
             fail("Failure expected on no token");
         } catch (javax.xml.ws.soap.SOAPFaultException ex) {
-            // String error = "SamlToken not satisfied";
-            // assertTrue(ex.getMessage().contains(error));
+            String error = "SamlToken not satisfied";
+            assertTrue(ex.getMessage().contains(error));
         }
         
         ((java.io.Closeable)saml2Port).close();

Modified: cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/x509/StaxX509TokenTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/x509/StaxX509TokenTest.java?rev=1501312&r1=1501311&r2=1501312&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/x509/StaxX509TokenTest.java
(original)
+++ cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/x509/StaxX509TokenTest.java
Tue Jul  9 15:05:57 2013
@@ -796,8 +796,8 @@ public class StaxX509TokenTest extends A
             port.doubleIt(25);
             fail("Failure expected on not sending an X.509 Supporting Token");
         } catch (javax.xml.ws.soap.SOAPFaultException ex) {
-            // String error = "These policy alternatives can not be satisfied";
-            // assertTrue(ex.getMessage().contains(error));
+            String error = "X509Token not satisfied";
+            assertTrue(ex.getMessage().contains(error));
         }
         
         // This should fail, as the client is not sending a PKI Token
@@ -809,8 +809,8 @@ public class StaxX509TokenTest extends A
             port.doubleIt(25);
             fail("Failure expected on not sending a PKI token");
         } catch (javax.xml.ws.soap.SOAPFaultException ex) {
-            // String error = "These policy alternatives can not be satisfied";
-            // assertTrue(ex.getMessage().contains(error));
+            String error = "WssX509PkiPathV1Token11";
+            assertTrue(ex.getMessage().contains(error));
         }
         
         ((java.io.Closeable)port).close();
@@ -852,8 +852,8 @@ public class StaxX509TokenTest extends A
             port.doubleIt(25);
             fail("Failure expected on not endorsing the token");
         } catch (javax.xml.ws.soap.SOAPFaultException ex) {
-            // String error = "These policy alternatives can not be satisfied";
-            // assertTrue(ex.getMessage().contains(error));
+            String error = "X509Token not satisfied";
+            assertTrue(ex.getMessage().contains(error));
         }
         
         try {
@@ -862,8 +862,7 @@ public class StaxX509TokenTest extends A
             port.doubleIt(25);
             fail("Failure expected on not endorsing the token");
         } catch (javax.xml.ws.soap.SOAPFaultException ex) {
-            // String error = "These policy alternatives can not be satisfied";
-            // assertTrue(ex.getMessage().contains(error));
+            // expected
         }
         
         ((java.io.Closeable)port).close();



Mime
View raw message