Author: coheigea
Date: Thu Jul 23 10:20:57 2009
New Revision: 797004
URL: http://svn.apache.org/viewvc?rev=797004&view=rev
Log:
Backmerged a test for inclusive prefixes from trunk.
Modified:
webservices/wss4j/branches/1_5_x-fixes/test/wssec/TestWSSecurityNew3.java
Modified:
webservices/wss4j/branches/1_5_x-fixes/test/wssec/TestWSSecurityNew3.java
URL:
http://svn.apache.org/viewvc/webservices/wss4j/branches/1_5_x-fixes/test/wssec/TestWSSecurityNew3.java?rev=797004&r1=797003&r2=797004&view=diff
==============================================================================
--- webservices/wss4j/branches/1_5_x-fixes/test/wssec/TestWSSecurityNew3.java
(original)
+++ webservices/wss4j/branches/1_5_x-fixes/test/wssec/TestWSSecurityNew3.java
Thu Jul 23 10:20:57 2009
@@ -29,6 +29,7 @@
import org.apache.commons.logging.LogFactory;
import org.apache.ws.security.WSConstants;
import org.apache.ws.security.WSPasswordCallback;
+import org.apache.ws.security.WSSConfig;
import org.apache.ws.security.WSSecurityEngine;
import org.apache.ws.security.components.crypto.Crypto;
import org.apache.ws.security.components.crypto.CryptoFactory;
@@ -165,6 +166,34 @@
verify(signedDoc);
}
+
+ /**
+ * Test that signs and verifies a WS-Security envelope
+ * <p/>
+ *
+ * @throws java.lang.Exception Thrown when there is any problem in signing
or verification
+ */
+ public void testSignatureInclusivePrefixes() throws Exception {
+ WSSConfig wssConfig = WSSConfig.getNewInstance();
+ wssConfig.setWsiBSPCompliant(true);
+ WSSecSignature builder = new WSSecSignature();
+ builder.setWsConfig(wssConfig);
+ builder.setUserInfo("16c73ab6-b892-458f-abf5-2f875f74882e",
"security");
+ LOG.info("Before Signing....");
+ Document doc = unsignedEnvelope.getAsDocument();
+ WSSecHeader secHeader = new WSSecHeader();
+ secHeader.insertSecurityHeader(doc);
+ Document signedDoc = builder.build(doc, crypto, secHeader);
+
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("After Signing....");
+ String outputString =
+
org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(signedDoc);
+ LOG.debug(outputString);
+ }
+
+ verify(signedDoc);
+ }
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]