cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1142963 - /cxf/branches/2.4.x-fixes/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/WSS4JInOutTest.java
Date Tue, 05 Jul 2011 10:13:29 GMT
Author: coheigea
Date: Tue Jul  5 10:13:29 2011
New Revision: 1142963

URL: http://svn.apache.org/viewvc?rev=1142963&view=rev
Log:
Adding a unit test for a UsernameToken and a Signature.

Modified:
    cxf/branches/2.4.x-fixes/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/WSS4JInOutTest.java

Modified: cxf/branches/2.4.x-fixes/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/WSS4JInOutTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/WSS4JInOutTest.java?rev=1142963&r1=1142962&r2=1142963&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/WSS4JInOutTest.java
(original)
+++ cxf/branches/2.4.x-fixes/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/WSS4JInOutTest.java
Tue Jul  5 10:13:29 2011
@@ -461,6 +461,42 @@ public class WSS4JInOutTest extends Abst
         assertEquals(certificates.length, 2);
     }
     
+    @Test
+    public void testUsernameTokenSignature() throws Exception {
+        Map<String, String> outProperties = new HashMap<String, String>();
+        outProperties.put(
+            WSHandlerConstants.ACTION, 
+            WSHandlerConstants.USERNAME_TOKEN + " " + WSHandlerConstants.SIGNATURE);
+        outProperties.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PW_TEXT);
+        outProperties.put(WSHandlerConstants.USER, "alice");
+        
+        outProperties.put(WSHandlerConstants.SIG_PROP_FILE, "outsecurity.properties");
+        outProperties.put(WSHandlerConstants.SIGNATURE_USER, "myalias");
+        outProperties.put(
+            WSHandlerConstants.PW_CALLBACK_CLASS, 
+            "org.apache.cxf.ws.security.wss4j.TestPwdCallback"
+        );
+        
+        Map<String, String> inProperties = new HashMap<String, String>();
+        inProperties.put(
+            WSHandlerConstants.ACTION, 
+            WSHandlerConstants.USERNAME_TOKEN + " " + WSHandlerConstants.SIGNATURE
+        );
+        inProperties.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PW_TEXT);
+        inProperties.put(
+            WSHandlerConstants.PW_CALLBACK_CLASS, 
+            "org.apache.cxf.ws.security.wss4j.TestPwdCallback"
+        );
+        inProperties.put(WSHandlerConstants.SIG_PROP_FILE, "insecurity.properties");
+        
+        List<String> xpaths = new ArrayList<String>();
+        xpaths.add("//wsse:Security");
+        xpaths.add("//wsse:Security/ds:Signature");
+        xpaths.add("//wsse:Security/wsse:UsernameToken");
+
+        makeInvocation(outProperties, xpaths, inProperties);
+    }
+    
     
     private byte[] getMessageBytes(Document doc) throws Exception {
         ByteArrayOutputStream outputStream = new ByteArrayOutputStream();



Mime
View raw message