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 2011/07/05 12:13:29 UTC
svn commit: r1142963 -
/cxf/branches/2.4.x-fixes/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/WSS4JInOutTest.java
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();