ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1720192 [18/33] - in /webservices/wss4j/trunk: bindings/src/main/java/org/apache/wss4j/binding/wss10/ bindings/src/main/java/org/apache/wss4j/binding/wss11/ bindings/src/main/java/org/apache/wss4j/binding/wssc13/ bindings/src/main/java/org...
Date Tue, 15 Dec 2015 16:40:42 GMT
Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/SignatureConfirmationTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/SignatureConfirmationTest.java?rev=1720192&r1=1720191&r2=1720192&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/SignatureConfirmationTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/SignatureConfirmationTest.java Tue Dec 15 16:40:37 2015
@@ -48,17 +48,17 @@ import org.w3c.dom.Element;
  * A set of test-cases for SignatureConfirmation.
  */
 public class SignatureConfirmationTest extends org.junit.Assert {
-    private static final org.slf4j.Logger LOG = 
+    private static final org.slf4j.Logger LOG =
         org.slf4j.LoggerFactory.getLogger(SignatureConfirmationTest.class);
     private WSSecurityEngine secEngine = new WSSecurityEngine();
     private CallbackHandler callbackHandler = new KeystoreCallbackHandler();
     private Crypto crypto = null;
-    
+
     @org.junit.AfterClass
     public static void cleanup() throws Exception {
         SecurityTestUtil.cleanup();
     }
-    
+
     public SignatureConfirmationTest() throws Exception {
         crypto = CryptoFactory.getInstance();
     }
@@ -77,32 +77,32 @@ public class SignatureConfirmationTest e
         msgContext.put("password", "security");
         reqData.setMsgContext(msgContext);
         reqData.setUsername("16c73ab6-b892-458f-abf5-2f875f74882e");
-        
+
         final Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
         CustomHandler handler = new CustomHandler();
         HandlerAction action = new HandlerAction(WSConstants.SIGN);
         handler.send(
-            doc, 
-            reqData, 
+            doc,
+            reqData,
             Collections.singletonList(action),
             true
         );
         if (LOG.isDebugEnabled()) {
             LOG.debug("After Signing....");
-            String outputString = 
+            String outputString =
                 XMLUtils.PrettyDocumentToString(doc);
             LOG.debug(outputString);
         }
 
         msgContext = (java.util.Map<String, Object>)reqData.getMsgContext();
-        Set<Integer> savedSignatures = 
+        Set<Integer> savedSignatures =
             (Set<Integer>)msgContext.get(WSHandlerConstants.SEND_SIGV);
         assertTrue(savedSignatures != null && savedSignatures.size() == 1);
         Integer signatureValue = savedSignatures.iterator().next();
         assertTrue(signatureValue != null && signatureValue != 0);
     }
-    
-    
+
+
     /**
      * Test to see that a signature is not saved on the outbound request if
      * enable signature confirmation is false.
@@ -118,30 +118,30 @@ public class SignatureConfirmationTest e
         msgContext.put("password", "security");
         reqData.setMsgContext(msgContext);
         reqData.setUsername("16c73ab6-b892-458f-abf5-2f875f74882e");
-        
+
         final Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
         CustomHandler handler = new CustomHandler();
         HandlerAction action = new HandlerAction(WSConstants.SIGN);
         handler.send(
-            doc, 
-            reqData, 
+            doc,
+            reqData,
             Collections.singletonList(action),
             true
         );
         if (LOG.isDebugEnabled()) {
             LOG.debug("After Signing....");
-            String outputString = 
+            String outputString =
                 XMLUtils.PrettyDocumentToString(doc);
             LOG.debug(outputString);
         }
 
         msgContext = (java.util.Map<String, Object>)reqData.getMsgContext();
-        Set<Integer> savedSignatures = 
+        Set<Integer> savedSignatures =
             (Set<Integer>)msgContext.get(WSHandlerConstants.SEND_SIGV);
         assertTrue(savedSignatures == null);
     }
-    
-    
+
+
     /**
      * Test to see that a signature confirmation response is correctly sent on receiving
      * a signed message.
@@ -157,30 +157,30 @@ public class SignatureConfirmationTest e
         msgContext.put("password", "security");
         reqData.setMsgContext(msgContext);
         reqData.setUsername("16c73ab6-b892-458f-abf5-2f875f74882e");
-        
+
         Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
         CustomHandler handler = new CustomHandler();
         HandlerAction action = new HandlerAction(WSConstants.SIGN);
         handler.send(
-            doc, 
-            reqData, 
+            doc,
+            reqData,
             Collections.singletonList(action),
             true
         );
         if (LOG.isDebugEnabled()) {
             LOG.debug("After Signing....");
-            String outputString = 
+            String outputString =
                 XMLUtils.PrettyDocumentToString(doc);
             LOG.debug(outputString);
         }
 
         msgContext = (java.util.Map<String, Object>)reqData.getMsgContext();
-        Set<Integer> savedSignatures = 
+        Set<Integer> savedSignatures =
             (Set<Integer>)msgContext.get(WSHandlerConstants.SEND_SIGV);
         assertTrue(savedSignatures != null && savedSignatures.size() == 1);
         Integer signatureValue = savedSignatures.iterator().next();
         assertTrue(signatureValue != null && signatureValue != 0);
-        
+
         //
         // Verify the inbound request, and create a response with a Signature Confirmation
         //
@@ -192,12 +192,12 @@ public class SignatureConfirmationTest e
         msgContext.put(WSHandlerConstants.RECV_RESULTS, receivedResults);
         action = new HandlerAction(WSConstants.NO_SECURITY);
         handler.send(
-            doc, 
-            reqData, 
+            doc,
+            reqData,
             Collections.singletonList(action),
             false
         );
-        String outputString = 
+        String outputString =
             XMLUtils.PrettyDocumentToString(doc);
         if (LOG.isDebugEnabled()) {
             LOG.debug("Signature Confirmation response....");
@@ -205,8 +205,8 @@ public class SignatureConfirmationTest e
         }
         assertTrue(outputString.contains("SignatureConfirmation"));
     }
-    
-    
+
+
     /**
      * Test to see that a signature confirmation response is correctly processed.
      */
@@ -221,19 +221,19 @@ public class SignatureConfirmationTest e
         msgContext.put("password", "security");
         reqData.setMsgContext(msgContext);
         reqData.setUsername("16c73ab6-b892-458f-abf5-2f875f74882e");
-        
+
         Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
         CustomHandler handler = new CustomHandler();
         HandlerAction action = new HandlerAction(WSConstants.SIGN);
         handler.send(
-            doc, 
-            reqData, 
+            doc,
+            reqData,
             Collections.singletonList(action),
             true
         );
         if (LOG.isDebugEnabled()) {
             LOG.debug("After Signing....");
-            String outputString = 
+            String outputString =
                 XMLUtils.PrettyDocumentToString(doc);
             LOG.debug(outputString);
         }
@@ -248,30 +248,30 @@ public class SignatureConfirmationTest e
         receivedResults.add(results);
         msgContext.put(WSHandlerConstants.RECV_RESULTS, receivedResults);
         handler.send(
-            doc, 
-            reqData, 
+            doc,
+            reqData,
             Collections.singletonList(action),
             false
         );
-        String outputString = 
+        String outputString =
             XMLUtils.PrettyDocumentToString(doc);
         if (LOG.isDebugEnabled()) {
             LOG.debug("Signature Confirmation response....");
             LOG.debug(outputString);
         }
-        
+
         //
         // Verify the SignatureConfirmation response
         //
         results = verify(doc);
-        WSSecurityEngineResult scResult = 
+        WSSecurityEngineResult scResult =
             results.getActionResults().get(WSConstants.SC).get(0);
         assertTrue(scResult != null);
         assertTrue(scResult.get(WSSecurityEngineResult.TAG_SIGNATURE_CONFIRMATION) != null);
         handler.signatureConfirmation(reqData, results);
     }
-    
-    
+
+
     /**
      * Test to see that a signature confirmation response that does not contain a wsu:Id fails
      * the BSP compliance is enabled.
@@ -281,52 +281,52 @@ public class SignatureConfirmationTest e
         Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
         WSSecHeader secHeader = new WSSecHeader(doc);
         secHeader.insertSecurityHeader();
-        
+
         byte[] randomBytes = WSSecurityUtil.generateNonce(20);
         SignatureConfirmation sigConf = new SignatureConfirmation(doc, randomBytes);
         Element sigConfElement = sigConf.getElement();
         secHeader.getSecurityHeader().appendChild(sigConfElement);
-        
+
         if (LOG.isDebugEnabled()) {
-            String outputString = 
+            String outputString =
                 XMLUtils.PrettyDocumentToString(doc);
             LOG.debug(outputString);
         }
-        
+
         // Verify the results
         WSSecurityEngine newEngine = new WSSecurityEngine();
         try {
             newEngine.processSecurityHeader(doc, null, callbackHandler, crypto);
             fail("Failure expected on a request with no wsu:Id");
         } catch (WSSecurityException ex) {
-            assertTrue(ex.getErrorCode() == WSSecurityException.ErrorCode.INVALID_SECURITY); 
+            assertTrue(ex.getErrorCode() == WSSecurityException.ErrorCode.INVALID_SECURITY);
         }
-        
+
         RequestData data = new RequestData();
         data.setCallbackHandler(callbackHandler);
         data.setSigVerCrypto(crypto);
         data.setIgnoredBSPRules(Collections.singletonList(BSPRule.R5441));
         newEngine.processSecurityHeader(doc, data);
     }
-    
-    
+
+
     /**
      * Verifies the soap envelope
      * <p/>
-     * 
-     * @param doc 
+     *
+     * @param doc
      * @throws Exception Thrown when there is a problem in verification
      */
     private WSHandlerResult verify(Document doc) throws Exception {
-        WSHandlerResult results = 
+        WSHandlerResult results =
             secEngine.processSecurityHeader(doc, null, callbackHandler, crypto);
         if (LOG.isDebugEnabled()) {
             LOG.debug("Verfied and decrypted message:");
-            String outputString = 
+            String outputString =
                 XMLUtils.PrettyDocumentToString(doc);
             LOG.debug(outputString);
         }
         return results;
     }
-    
+
 }

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/SignatureUTAliasTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/SignatureUTAliasTest.java?rev=1720192&r1=1720191&r2=1720192&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/SignatureUTAliasTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/SignatureUTAliasTest.java Tue Dec 15 16:40:37 2015
@@ -44,7 +44,7 @@ import org.w3c.dom.Document;
  * be different than user name used for UsernameToken".
  */
 public class SignatureUTAliasTest extends org.junit.Assert implements CallbackHandler {
-    private static final org.slf4j.Logger LOG = 
+    private static final org.slf4j.Logger LOG =
         org.slf4j.LoggerFactory.getLogger(SignatureUTAliasTest.class);
     private WSSecurityEngine secEngine = new WSSecurityEngine();
 
@@ -52,14 +52,14 @@ public class SignatureUTAliasTest extend
     public static void cleanup() throws Exception {
         SecurityTestUtil.cleanup();
     }
-    
+
     /**
      * Test involving adding a Username Token to a SOAP message and signing it, where the
      * private key for signature is extracted from the KeyStore using a different username/alias
-     * to the UsernameToken. 
+     * to the UsernameToken.
      */
     @org.junit.Test
-    public void 
+    public void
     testUsernameTokenSignatureHandler() throws Exception {
         final WSSConfig cfg = WSSConfig.getNewInstance();
         final RequestData reqData = new RequestData();
@@ -68,64 +68,64 @@ public class SignatureUTAliasTest extend
         reqData.setPwType(WSConstants.PASSWORD_TEXT);
         java.util.Map<String, Object> messageContext = new java.util.TreeMap<String, Object>();
         messageContext.put(
-            WSHandlerConstants.PW_CALLBACK_REF, 
+            WSHandlerConstants.PW_CALLBACK_REF,
             this
         );
         messageContext.put(WSHandlerConstants.SIGNATURE_USER, "wss40");
         messageContext.put(WSHandlerConstants.SIG_PROP_FILE, "wss40.properties");
         messageContext.put(
-            WSHandlerConstants.SIGNATURE_PARTS, 
+            WSHandlerConstants.SIGNATURE_PARTS,
             "{}{" + WSConstants.WSSE_NS + "}" + "UsernameToken"
         );
         messageContext.put(WSHandlerConstants.SIG_KEY_ID, "DirectReference");
         reqData.setMsgContext(messageContext);
-        
+
         final Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
         CustomHandler handler = new CustomHandler();
         List<HandlerAction> actions = new ArrayList<>();
         actions.add(new HandlerAction(WSConstants.UT));
         actions.add(new HandlerAction(WSConstants.SIGN));
         handler.send(
-            doc, 
-            reqData, 
+            doc,
+            reqData,
             actions,
             true
         );
-        
+
         if (LOG.isDebugEnabled()) {
             LOG.debug("After Signing....");
-            String outputString = 
+            String outputString =
                 XMLUtils.PrettyDocumentToString(doc);
             LOG.debug(outputString);
         }
-        
+
         verify(doc);
-        
+
     }
-    
+
 
     /**
      * Verifies the soap envelope
      * <p/>
-     * 
-     * @param doc 
+     *
+     * @param doc
      * @throws Exception Thrown when there is a problem in verification
      */
     private WSHandlerResult verify(Document doc) throws Exception {
-        WSHandlerResult results = 
+        WSHandlerResult results =
             secEngine.processSecurityHeader(
                 doc, null, this, CryptoFactory.getInstance("wss40CA.properties")
             );
         if (LOG.isDebugEnabled()) {
             LOG.debug("Verfied and decrypted message:");
-            String outputString = 
+            String outputString =
                 XMLUtils.PrettyDocumentToString(doc);
             LOG.debug(outputString);
         }
         return results;
     }
 
-    
+
     public void handle(Callback[] callbacks)
         throws IOException, UnsupportedCallbackException {
         for (int i = 0; i < callbacks.length; i++) {
@@ -146,5 +146,5 @@ public class SignatureUTAliasTest extend
         }
     }
 
-    
+
 }

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/UseReqSigCertTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/UseReqSigCertTest.java?rev=1720192&r1=1720191&r2=1720192&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/UseReqSigCertTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/UseReqSigCertTest.java Tue Dec 15 16:40:37 2015
@@ -40,14 +40,14 @@ import org.w3c.dom.Document;
  * encrypt the response.
  */
 public class UseReqSigCertTest extends org.junit.Assert {
-    private static final org.slf4j.Logger LOG = 
+    private static final org.slf4j.Logger LOG =
         org.slf4j.LoggerFactory.getLogger(UseReqSigCertTest.class);
-    
+
     @org.junit.AfterClass
     public static void cleanup() throws Exception {
         SecurityTestUtil.cleanup();
     }
-    
+
     public UseReqSigCertTest() throws Exception {
         WSSConfig.init();
     }
@@ -58,7 +58,7 @@ public class UseReqSigCertTest extends o
         final RequestData reqData = new RequestData();
         reqData.setWssConfig(cfg);
         reqData.setUsername("wss40");
-        
+
         java.util.Map<String, Object> config = new java.util.TreeMap<String, Object>();
         config.put(WSHandlerConstants.SIG_PROP_FILE, "wss40.properties");
         config.put(WSHandlerConstants.SIG_KEY_ID, "DirectReference");
@@ -67,43 +67,43 @@ public class UseReqSigCertTest extends o
             WSHandlerConstants.SIGNATURE_PARTS, "{}{" + WSConstants.WSU_NS + "}Timestamp"
         );
         reqData.setMsgContext(config);
-        
+
         final Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
-        
+
         // Send the request
         CustomHandler handler = new CustomHandler();
         List<HandlerAction> actions = new ArrayList<>();
         actions.add(new HandlerAction(WSConstants.SIGN));
         actions.add(new HandlerAction(WSConstants.TS));
         handler.send(
-            doc, 
-            reqData, 
+            doc,
+            reqData,
             actions,
             true
         );
-        String outputString = 
+        String outputString =
             XMLUtils.PrettyDocumentToString(doc);
         if (LOG.isDebugEnabled()) {
             LOG.debug("Signed message:");
             LOG.debug(outputString);
         }
-        
+
         // Process the request
         WSHandlerResult results = processRequest(doc);
         List<WSHandlerResult> handlerResults = new ArrayList<>();
         handlerResults.add(0, results);
-        
+
         // Send the response
         sendResponse(handlerResults);
     }
-    
+
     @org.junit.Test
     public void testIssuerSerial() throws Exception {
         final WSSConfig cfg = WSSConfig.getNewInstance();
         final RequestData reqData = new RequestData();
         reqData.setWssConfig(cfg);
         reqData.setUsername("wss40");
-        
+
         java.util.Map<String, Object> config = new java.util.TreeMap<String, Object>();
         config.put(WSHandlerConstants.SIG_PROP_FILE, "wss40.properties");
         config.put(WSHandlerConstants.SIG_KEY_ID, "IssuerSerial");
@@ -112,43 +112,43 @@ public class UseReqSigCertTest extends o
             WSHandlerConstants.SIGNATURE_PARTS, "{}{" + WSConstants.WSU_NS + "}Timestamp"
         );
         reqData.setMsgContext(config);
-        
+
         final Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
-        
+
         // Send the request
         CustomHandler handler = new CustomHandler();
         List<HandlerAction> actions = new ArrayList<>();
         actions.add(new HandlerAction(WSConstants.SIGN));
         actions.add(new HandlerAction(WSConstants.TS));
         handler.send(
-            doc, 
-            reqData, 
+            doc,
+            reqData,
             actions,
             true
         );
-        String outputString = 
+        String outputString =
             XMLUtils.PrettyDocumentToString(doc);
         if (LOG.isDebugEnabled()) {
             LOG.debug("Signed message:");
             LOG.debug(outputString);
         }
-        
+
         // Process the request
         WSHandlerResult results = processRequest(doc);
         List<WSHandlerResult> handlerResults = new ArrayList<>();
         handlerResults.add(0, results);
-        
+
         // Send the response
         sendResponse(handlerResults);
     }
-    
+
     @org.junit.Test
     public void testSKIKeyIdentifier() throws Exception {
         final WSSConfig cfg = WSSConfig.getNewInstance();
         final RequestData reqData = new RequestData();
         reqData.setWssConfig(cfg);
         reqData.setUsername("wss40");
-        
+
         java.util.Map<String, Object> config = new java.util.TreeMap<String, Object>();
         config.put(WSHandlerConstants.SIG_PROP_FILE, "wss40.properties");
         config.put(WSHandlerConstants.SIG_KEY_ID, "SKIKeyIdentifier");
@@ -157,73 +157,73 @@ public class UseReqSigCertTest extends o
             WSHandlerConstants.SIGNATURE_PARTS, "{}{" + WSConstants.WSU_NS + "}Timestamp"
         );
         reqData.setMsgContext(config);
-        
+
         final Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
-        
+
         // Send the request
         CustomHandler handler = new CustomHandler();
         List<HandlerAction> actions = new ArrayList<>();
         actions.add(new HandlerAction(WSConstants.SIGN));
         actions.add(new HandlerAction(WSConstants.TS));
         handler.send(
-            doc, 
-            reqData, 
+            doc,
+            reqData,
             actions,
             true
         );
-        String outputString = 
+        String outputString =
             XMLUtils.PrettyDocumentToString(doc);
         if (LOG.isDebugEnabled()) {
             LOG.debug("Signed message:");
             LOG.debug(outputString);
         }
-        
+
         // Process the request
         WSHandlerResult results = processRequest(doc);
         List<WSHandlerResult> handlerResults = new ArrayList<>();
         handlerResults.add(0, results);
-        
+
         // Send the response
         sendResponse(handlerResults);
     }
-    
+
     private WSHandlerResult processRequest(Document doc) throws WSSecurityException {
         final WSSConfig cfg = WSSConfig.getNewInstance();
         final RequestData reqData = new RequestData();
         reqData.setWssConfig(cfg);
-        
+
         java.util.Map<String, Object> config = new java.util.TreeMap<String, Object>();
         config.put(WSHandlerConstants.SIG_VER_PROP_FILE, "wss40.properties");
         reqData.setMsgContext(config);
-        
+
         CustomHandler handler = new CustomHandler();
         List<Integer> receivedActions = new ArrayList<>();
         receivedActions.add(WSConstants.SIGN);
         receivedActions.add(WSConstants.TS);
         handler.receive(receivedActions, reqData);
-        
+
         WSSecurityEngine securityEngine = new WSSecurityEngine();
         return securityEngine.processSecurityHeader(doc, reqData);
     }
-    
+
     private void sendResponse(List<WSHandlerResult> handlerResults) throws Exception {
         final RequestData reqData = new RequestData();
-        
+
         java.util.Map<String, Object> config = new java.util.TreeMap<String, Object>();
         config.put(WSHandlerConstants.ENCRYPTION_USER, "useReqSigCert");
         config.put(WSHandlerConstants.RECV_RESULTS, handlerResults);
         reqData.setMsgContext(config);
-        
+
         final List<Integer> actions = new ArrayList<Integer>();
         actions.add(WSConstants.ENCR);
         final Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
-        
+
         // Send message
         CustomHandler handler = new CustomHandler();
         HandlerAction action = new HandlerAction(WSConstants.ENCR);
         handler.send(
-            doc, 
-            reqData, 
+            doc,
+            reqData,
             Collections.singletonList(action),
             true
         );

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/WSHandlerGetPasswordTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/WSHandlerGetPasswordTest.java?rev=1720192&r1=1720191&r2=1720192&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/WSHandlerGetPasswordTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/WSHandlerGetPasswordTest.java Tue Dec 15 16:40:37 2015
@@ -38,7 +38,7 @@ import javax.security.auth.callback.Call
  * <p/>
  */
 public class WSHandlerGetPasswordTest extends org.junit.Assert {
-    private static final org.slf4j.Logger LOG = 
+    private static final org.slf4j.Logger LOG =
         org.slf4j.LoggerFactory.getLogger(WSHandlerGetPasswordTest.class);
     private CallbackHandler callbackHandler = new UsernamePasswordCallbackHandler();
 
@@ -46,40 +46,40 @@ public class WSHandlerGetPasswordTest ex
     public static void cleanup() throws Exception {
         SecurityTestUtil.cleanup();
     }
-    
+
     /**
-     * A unit test for WSHandler.getPassword(...), where the password is obtained 
+     * A unit test for WSHandler.getPassword(...), where the password is obtained
      * from the Message Context.
      */
     @org.junit.Test
     public void
     testGetPasswordRequestContextUnit() throws Exception {
-        
+
         final WSSConfig cfg = WSSConfig.getNewInstance();
         final RequestData reqData = new RequestData();
         reqData.setWssConfig(cfg);
         java.util.Map<String, Object> messageContext = new java.util.TreeMap<String, Object>();
         messageContext.put("password", "securityPassword");
         reqData.setMsgContext(messageContext);
-        
+
         WSHandler handler = new CustomHandler();
-        CallbackHandler callbackHandler = 
+        CallbackHandler callbackHandler =
             handler.getCallbackHandler("SomeCallbackTag", "SomeCallbackRef", reqData);
-        WSPasswordCallback callback = 
+        WSPasswordCallback callback =
             handler.getPasswordCB("alice", WSConstants.UT, callbackHandler, reqData);
         assertTrue("alice".equals(callback.getIdentifier()));
         assertTrue("securityPassword".equals(callback.getPassword()));
         assertTrue(WSPasswordCallback.USERNAME_TOKEN == callback.getUsage());
     }
-    
+
     /**
-     * A WSHandler test for WSHandler.getPassword(...), where the password is obtained 
+     * A WSHandler test for WSHandler.getPassword(...), where the password is obtained
      * from the Message Context.
      */
     @org.junit.Test
     public void
     testGetPasswordRequestContext() throws Exception {
-        
+
         final WSSConfig cfg = WSSConfig.getNewInstance();
         final RequestData reqData = new RequestData();
         reqData.setWssConfig(cfg);
@@ -88,20 +88,20 @@ public class WSHandlerGetPasswordTest ex
         java.util.Map<String, Object> messageContext = new java.util.TreeMap<String, Object>();
         messageContext.put("password", "securityPassword");
         reqData.setMsgContext(messageContext);
-        
+
         final java.util.List<Integer> actions = new java.util.ArrayList<Integer>();
         actions.add(WSConstants.UT);
         Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
         CustomHandler handler = new CustomHandler();
         HandlerAction action = new HandlerAction(WSConstants.UT);
         handler.send(
-            doc, 
-            reqData, 
+            doc,
+            reqData,
             Collections.singletonList(action),
             true
         );
-        
-        String outputString = 
+
+        String outputString =
             XMLUtils.PrettyDocumentToString(doc);
         if (LOG.isDebugEnabled()) {
             LOG.debug(outputString);
@@ -109,15 +109,15 @@ public class WSHandlerGetPasswordTest ex
         assertTrue(outputString.contains("alice"));
         assertTrue(outputString.contains("securityPassword"));
     }
-    
+
     /**
-     * A test for WSHandler.getPassword(...), where the password is obtained from a 
+     * A test for WSHandler.getPassword(...), where the password is obtained from a
      * Callback Handler, which is placed on the Message Context using a reference.
      */
     @org.junit.Test
     public void
     testGetPasswordCallbackHandlerRef() throws Exception {
-        
+
         final WSSConfig cfg = WSSConfig.getNewInstance();
         final RequestData reqData = new RequestData();
         reqData.setWssConfig(cfg);
@@ -125,24 +125,24 @@ public class WSHandlerGetPasswordTest ex
         reqData.setPwType(WSConstants.PASSWORD_TEXT);
         java.util.Map<String, Object> messageContext = new java.util.TreeMap<String, Object>();
         messageContext.put(
-            WSHandlerConstants.PW_CALLBACK_REF, 
+            WSHandlerConstants.PW_CALLBACK_REF,
             callbackHandler
         );
         reqData.setMsgContext(messageContext);
-        
+
         final java.util.List<Integer> actions = new java.util.ArrayList<Integer>();
         actions.add(WSConstants.UT);
         Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
         CustomHandler handler = new CustomHandler();
         HandlerAction action = new HandlerAction(WSConstants.UT);
         handler.send(
-            doc, 
-            reqData, 
+            doc,
+            reqData,
             Collections.singletonList(action),
             true
         );
-        
-        String outputString = 
+
+        String outputString =
             XMLUtils.PrettyDocumentToString(doc);
         if (LOG.isDebugEnabled()) {
             LOG.debug(outputString);
@@ -150,5 +150,5 @@ public class WSHandlerGetPasswordTest ex
         assertTrue(outputString.contains("alice"));
         assertTrue(outputString.contains("securityPassword"));
     }
-    
+
 }

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/AttachmentCallbackHandler.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/AttachmentCallbackHandler.java?rev=1720192&r1=1720191&r2=1720192&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/AttachmentCallbackHandler.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/AttachmentCallbackHandler.java Tue Dec 15 16:40:37 2015
@@ -35,19 +35,19 @@ import java.util.List;
 import java.util.Map;
 
 /**
- * A Callback Handler implementation for the case of signing/encrypting Attachments via the SwA 
+ * A Callback Handler implementation for the case of signing/encrypting Attachments via the SwA
  * (SOAP with Attachments) specification or when using xop:Include in the case of MTOM.
  */
 public class AttachmentCallbackHandler implements CallbackHandler {
-    
+
     private final List<Attachment> originalRequestAttachments;
     private Map<String, Attachment> attachmentMap = new HashMap<>();
     private List<Attachment> responseAttachments = new ArrayList<>();
-    
+
     public AttachmentCallbackHandler() {
         originalRequestAttachments = Collections.emptyList();
     }
-    
+
     public AttachmentCallbackHandler(List<Attachment> attachments) {
         originalRequestAttachments = attachments;
         if (attachments != null) {
@@ -56,26 +56,26 @@ public class AttachmentCallbackHandler i
             }
         }
     }
-    
+
     public void handle(Callback[] callbacks)
         throws IOException, UnsupportedCallbackException {
         for (int i = 0; i < callbacks.length; i++) {
             if (callbacks[i] instanceof AttachmentRequestCallback) {
-                AttachmentRequestCallback attachmentRequestCallback = 
+                AttachmentRequestCallback attachmentRequestCallback =
                     (AttachmentRequestCallback) callbacks[i];
 
-                List<Attachment> attachments = 
+                List<Attachment> attachments =
                     getAttachmentsToAdd(attachmentRequestCallback.getAttachmentId());
                 if (attachments.isEmpty()) {
                     throw new RuntimeException("wrong attachment requested");
                 }
-                
+
                 attachmentRequestCallback.setAttachments(attachments);
             } else if (callbacks[i] instanceof AttachmentResultCallback) {
-                AttachmentResultCallback attachmentResultCallback = 
+                AttachmentResultCallback attachmentResultCallback =
                     (AttachmentResultCallback) callbacks[i];
                 responseAttachments.add(attachmentResultCallback.getAttachment());
-                attachmentMap.put(attachmentResultCallback.getAttachment().getId(), 
+                attachmentMap.put(attachmentResultCallback.getAttachment().getId(),
                                   attachmentResultCallback.getAttachment());
             } else {
                 throw new UnsupportedCallbackException(callbacks[i], "Unrecognized Callback");
@@ -86,7 +86,7 @@ public class AttachmentCallbackHandler i
     public List<Attachment> getResponseAttachments() {
         return responseAttachments;
     }
-    
+
     // Try to match the Attachment Id. Otherwise, add all Attachments.
     private List<Attachment> getAttachmentsToAdd(String id) {
         List<Attachment> attachments = new ArrayList<>();
@@ -97,7 +97,7 @@ public class AttachmentCallbackHandler i
                 attachments.addAll(originalRequestAttachments);
             }
         }
-        
+
         return attachments;
     }
 

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/AttachmentTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/AttachmentTest.java?rev=1720192&r1=1720191&r2=1720192&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/AttachmentTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/AttachmentTest.java Tue Dec 15 16:40:37 2015
@@ -107,7 +107,7 @@ public class AttachmentTest extends Asse
         attachment.setId(attachmentId);
         attachment.setSourceStream(new ByteArrayInputStream(SOAPUtil.SAMPLE_SOAP_MSG.getBytes(StandardCharsets.UTF_8)));
 
-        AttachmentCallbackHandler attachmentCallbackHandler = 
+        AttachmentCallbackHandler attachmentCallbackHandler =
             new AttachmentCallbackHandler(Collections.singletonList(attachment));
         builder.setAttachmentCallbackHandler(attachmentCallbackHandler);
 
@@ -126,7 +126,7 @@ public class AttachmentTest extends Asse
         NodeList sigReferences = signedDoc.getElementsByTagNameNS(WSConstants.SIG_NS, "Reference");
         Assert.assertEquals(2, sigReferences.getLength());
 
-        attachmentCallbackHandler = 
+        attachmentCallbackHandler =
             new AttachmentCallbackHandler(Collections.singletonList(attachment));
         verify(signedDoc, attachmentCallbackHandler);
 
@@ -152,7 +152,7 @@ public class AttachmentTest extends Asse
         attachment.setId(attachmentId);
         attachment.setSourceStream(new ByteArrayInputStream(SOAPUtil.SAMPLE_SOAP_MSG.getBytes(StandardCharsets.UTF_8)));
 
-        AttachmentCallbackHandler attachmentCallbackHandler = 
+        AttachmentCallbackHandler attachmentCallbackHandler =
             new AttachmentCallbackHandler(Collections.singletonList(attachment));
         builder.setAttachmentCallbackHandler(attachmentCallbackHandler);
 
@@ -208,7 +208,7 @@ public class AttachmentTest extends Asse
         attachment.setId(attachmentId);
         attachment.setSourceStream(new ByteArrayInputStream(SOAPUtil.SAMPLE_SOAP_MSG.getBytes(StandardCharsets.UTF_8)));
 
-        AttachmentCallbackHandler attachmentCallbackHandler = 
+        AttachmentCallbackHandler attachmentCallbackHandler =
             new AttachmentCallbackHandler(Collections.singletonList(attachment));
         builder.setAttachmentCallbackHandler(attachmentCallbackHandler);
 
@@ -227,7 +227,7 @@ public class AttachmentTest extends Asse
         NodeList sigReferences = signedDoc.getElementsByTagNameNS(WSConstants.SIG_NS, "Reference");
         Assert.assertEquals(2, sigReferences.getLength());
 
-        attachmentCallbackHandler = 
+        attachmentCallbackHandler =
             new AttachmentCallbackHandler(Collections.singletonList(attachment));
         verify(signedDoc, attachmentCallbackHandler);
 
@@ -253,7 +253,7 @@ public class AttachmentTest extends Asse
         attachment.setId(attachmentId);
         attachment.setSourceStream(new ByteArrayInputStream(SOAPUtil.SAMPLE_SOAP_MSG.getBytes(StandardCharsets.UTF_8)));
 
-        AttachmentCallbackHandler attachmentCallbackHandler = 
+        AttachmentCallbackHandler attachmentCallbackHandler =
             new AttachmentCallbackHandler(Collections.singletonList(attachment));
         builder.setAttachmentCallbackHandler(attachmentCallbackHandler);
 
@@ -316,10 +316,10 @@ public class AttachmentTest extends Asse
         attachment[1].setId(attachment2Id);
         attachment[1].setSourceStream(new ByteArrayInputStream(SOAPUtil.SAMPLE_SOAP_MSG.getBytes(StandardCharsets.UTF_8)));
 
-        AttachmentCallbackHandler attachmentCallbackHandler = 
+        AttachmentCallbackHandler attachmentCallbackHandler =
             new AttachmentCallbackHandler(Arrays.asList(attachment));
         builder.setAttachmentCallbackHandler(attachmentCallbackHandler);
-        
+
         LOG.info("Before Signing....");
         Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
         WSSecHeader secHeader = new WSSecHeader(doc);
@@ -370,7 +370,7 @@ public class AttachmentTest extends Asse
         attachment.setId(attachmentId);
         attachment.setSourceStream(new ByteArrayInputStream(SOAPUtil.SAMPLE_SOAP_MSG.getBytes(StandardCharsets.UTF_8)));
 
-        AttachmentCallbackHandler attachmentCallbackHandler = 
+        AttachmentCallbackHandler attachmentCallbackHandler =
             new AttachmentCallbackHandler(Collections.singletonList(attachment));
         encrypt.setAttachmentCallbackHandler(attachmentCallbackHandler);
         List<Attachment> encryptedAttachments = attachmentCallbackHandler.getResponseAttachments();
@@ -429,7 +429,7 @@ public class AttachmentTest extends Asse
         attachment.setId(attachmentId);
         attachment.setSourceStream(new ByteArrayInputStream(SOAPUtil.SAMPLE_SOAP_MSG.getBytes(StandardCharsets.UTF_8)));
 
-        AttachmentCallbackHandler attachmentCallbackHandler = 
+        AttachmentCallbackHandler attachmentCallbackHandler =
             new AttachmentCallbackHandler(Collections.singletonList(attachment));
         encrypt.setAttachmentCallbackHandler(attachmentCallbackHandler);
         List<Attachment> encryptedAttachments = attachmentCallbackHandler.getResponseAttachments();
@@ -441,11 +441,11 @@ public class AttachmentTest extends Asse
             LOG.debug(outputString);
         }
 
-        final PushbackInputStream pis = 
+        final PushbackInputStream pis =
             new PushbackInputStream(encryptedAttachments.get(0).getSourceStream(), 1);
         pis.unread('K');
         encryptedAttachments.get(0).setSourceStream(pis);
-        
+
         attachmentCallbackHandler = new AttachmentCallbackHandler(encryptedAttachments);
         verify(encryptedDoc, attachmentCallbackHandler);
 
@@ -456,7 +456,7 @@ public class AttachmentTest extends Asse
             byte[] attachmentBytes = readInputStream(responseAttachment.getSourceStream());
             Assert.assertFalse(Arrays.equals(attachmentBytes, SOAPUtil.SAMPLE_SOAP_MSG.getBytes(StandardCharsets.UTF_8)));
             Assert.assertEquals("text/xml", responseAttachment.getMimeType());
-    
+
             Map<String, String> attHeaders = responseAttachment.getHeaders();
             Assert.assertEquals(6, attHeaders.size());
         } catch (IOException ex) { //NOPMD
@@ -484,7 +484,7 @@ public class AttachmentTest extends Asse
         attachment.setId(attachmentId);
         attachment.setSourceStream(new ByteArrayInputStream(SOAPUtil.SAMPLE_SOAP_MSG.getBytes(StandardCharsets.UTF_8)));
 
-        AttachmentCallbackHandler attachmentCallbackHandler = 
+        AttachmentCallbackHandler attachmentCallbackHandler =
             new AttachmentCallbackHandler(Collections.singletonList(attachment));
         encrypt.setAttachmentCallbackHandler(attachmentCallbackHandler);
         List<Attachment> encryptedAttachments = attachmentCallbackHandler.getResponseAttachments();
@@ -520,7 +520,7 @@ public class AttachmentTest extends Asse
 
         Assert.assertFalse(attachmentCallbackHandler.getResponseAttachments().isEmpty());
         Attachment responseAttachment = attachmentCallbackHandler.getResponseAttachments().get(0);
-        
+
         byte[] attachmentBytes = readInputStream(responseAttachment.getSourceStream());
         Assert.assertTrue(Arrays.equals(attachmentBytes, SOAPUtil.SAMPLE_SOAP_MSG.getBytes(StandardCharsets.UTF_8)));
         Assert.assertEquals("text/xml", responseAttachment.getMimeType());
@@ -549,7 +549,7 @@ public class AttachmentTest extends Asse
         attachment.setId(attachmentId);
         attachment.setSourceStream(new ByteArrayInputStream(SOAPUtil.SAMPLE_SOAP_MSG.getBytes(StandardCharsets.UTF_8)));
 
-        AttachmentCallbackHandler attachmentCallbackHandler = 
+        AttachmentCallbackHandler attachmentCallbackHandler =
             new AttachmentCallbackHandler(Collections.singletonList(attachment));
         encrypt.setAttachmentCallbackHandler(attachmentCallbackHandler);
         List<Attachment> encryptedAttachments = attachmentCallbackHandler.getResponseAttachments();
@@ -613,7 +613,7 @@ public class AttachmentTest extends Asse
         attachment.setId(attachmentId);
         attachment.setSourceStream(new ByteArrayInputStream(SOAPUtil.SAMPLE_SOAP_MSG.getBytes(StandardCharsets.UTF_8)));
 
-        AttachmentCallbackHandler attachmentCallbackHandler = 
+        AttachmentCallbackHandler attachmentCallbackHandler =
             new AttachmentCallbackHandler(Collections.singletonList(attachment));
         encrypt.setAttachmentCallbackHandler(attachmentCallbackHandler);
         List<Attachment> encryptedAttachments = attachmentCallbackHandler.getResponseAttachments();
@@ -661,7 +661,7 @@ public class AttachmentTest extends Asse
         attachment.setId(attachmentId);
         attachment.setSourceStream(new ByteArrayInputStream(SOAPUtil.SAMPLE_SOAP_MSG.getBytes(StandardCharsets.UTF_8)));
 
-        AttachmentCallbackHandler attachmentCallbackHandler = 
+        AttachmentCallbackHandler attachmentCallbackHandler =
             new AttachmentCallbackHandler(Collections.singletonList(attachment));
         encrypt.setAttachmentCallbackHandler(attachmentCallbackHandler);
         List<Attachment> encryptedAttachments = attachmentCallbackHandler.getResponseAttachments();
@@ -674,18 +674,18 @@ public class AttachmentTest extends Asse
         }
 
         try {
-            final PushbackInputStream pis = 
+            final PushbackInputStream pis =
                 new PushbackInputStream(encryptedAttachments.get(0).getSourceStream(), 1);
             pis.unread('K');
             encryptedAttachments.get(0).setSourceStream(pis);
-            
+
             attachmentCallbackHandler = new AttachmentCallbackHandler(encryptedAttachments);
             verify(encryptedDoc, attachmentCallbackHandler);
         } catch (WSSecurityException e) {
             // Assert.assertEquals(e.getMessage(), "The signature or decryption was invalid");
             return;
         }
-        
+
         Assert.assertFalse(attachmentCallbackHandler.getResponseAttachments().isEmpty());
         Attachment responseAttachment = attachmentCallbackHandler.getResponseAttachments().get(0);
         byte[] attachmentBytes = readInputStream(responseAttachment.getSourceStream());
@@ -721,7 +721,7 @@ public class AttachmentTest extends Asse
         attachment[1].setId(attachment2Id);
         attachment[1].setSourceStream(new ByteArrayInputStream(SOAPUtil.SAMPLE_SOAP_MSG.getBytes(StandardCharsets.UTF_8)));
 
-        AttachmentCallbackHandler attachmentCallbackHandler = 
+        AttachmentCallbackHandler attachmentCallbackHandler =
             new AttachmentCallbackHandler(Arrays.asList(attachment));
         encrypt.setAttachmentCallbackHandler(attachmentCallbackHandler);
         List<Attachment> encryptedAttachments = attachmentCallbackHandler.getResponseAttachments();
@@ -774,7 +774,7 @@ public class AttachmentTest extends Asse
         attachment.setId(attachmentId);
         attachment.setSourceStream(new ByteArrayInputStream(SOAPUtil.SAMPLE_SOAP_MSG.getBytes(StandardCharsets.UTF_8)));
 
-        AttachmentCallbackHandler attachmentCallbackHandler = 
+        AttachmentCallbackHandler attachmentCallbackHandler =
             new AttachmentCallbackHandler(Collections.singletonList(attachment));
         signature.setAttachmentCallbackHandler(attachmentCallbackHandler);
 
@@ -785,7 +785,7 @@ public class AttachmentTest extends Asse
         encrypt.setKeyIdentifierType(WSConstants.ISSUER_SERIAL);
         encrypt.getParts().addAll(signature.getParts());
 
-        attachmentCallbackHandler = 
+        attachmentCallbackHandler =
             new AttachmentCallbackHandler(Collections.singletonList(attachment));
         encrypt.setAttachmentCallbackHandler(attachmentCallbackHandler);
         List<Attachment> encryptedAttachments = attachmentCallbackHandler.getResponseAttachments();
@@ -939,7 +939,7 @@ public class AttachmentTest extends Asse
         attachment.setId(attachmentId);
         attachment.setSourceStream(new ByteArrayInputStream(SOAPUtil.SAMPLE_SOAP_MSG.getBytes(StandardCharsets.UTF_8)));
 
-        AttachmentCallbackHandler attachmentCallbackHandler = 
+        AttachmentCallbackHandler attachmentCallbackHandler =
             new AttachmentCallbackHandler(Collections.singletonList(attachment));
         encrypt.setAttachmentCallbackHandler(attachmentCallbackHandler);
         List<Attachment> encryptedAttachments = attachmentCallbackHandler.getResponseAttachments();

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/CertErrorTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/CertErrorTest.java?rev=1720192&r1=1720191&r2=1720192&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/CertErrorTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/CertErrorTest.java Tue Dec 15 16:40:37 2015
@@ -32,12 +32,12 @@ import org.w3c.dom.Document;
  * "username" is used for encryption or signature. See WSS-137.
  */
 public class CertErrorTest extends org.junit.Assert {
-    
+
     @org.junit.AfterClass
     public static void cleanup() throws Exception {
         SecurityTestUtil.cleanup();
     }
-    
+
     public CertErrorTest() {
         WSSConfig.init();
     }
@@ -60,7 +60,7 @@ public class CertErrorTest extends org.j
             assertTrue(ex.getMessage().contains(expectedError));
         }
     }
-    
+
     /**
      * Test for when a bad certificate is used for Encryption
      */

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/DerivedKeyActionTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/DerivedKeyActionTest.java?rev=1720192&r1=1720191&r2=1720192&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/DerivedKeyActionTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/DerivedKeyActionTest.java Tue Dec 15 16:40:37 2015
@@ -50,16 +50,16 @@ import org.junit.Assert;
  * A set of tests for using a derived key for encryption/signature using WSHandler actions.
  */
 public class DerivedKeyActionTest extends Assert {
-    private static final org.slf4j.Logger LOG = 
+    private static final org.slf4j.Logger LOG =
         org.slf4j.LoggerFactory.getLogger(DerivedKeyActionTest.class);
     private CallbackHandler callbackHandler = new KeystoreCallbackHandler();
     private Crypto crypto = null;
-    
+
     @org.junit.AfterClass
     public static void cleanup() throws Exception {
         SecurityTestUtil.cleanup();
     }
-    
+
     public DerivedKeyActionTest() throws Exception {
         crypto = CryptoFactory.getInstance("wss40.properties");
         WSSConfig.init();
@@ -71,127 +71,127 @@ public class DerivedKeyActionTest extend
         final RequestData reqData = new RequestData();
         reqData.setWssConfig(cfg);
         reqData.setUsername("wss40");
-        
+
         java.util.Map<String, Object> config = new java.util.TreeMap<String, Object>();
         config.put(WSHandlerConstants.SIG_PROP_FILE, "wss40.properties");
         config.put(WSHandlerConstants.PW_CALLBACK_REF, callbackHandler);
         config.put(WSHandlerConstants.DERIVED_TOKEN_KEY_ID, "Thumbprint");
         reqData.setMsgContext(config);
-        
+
         final Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
         CustomHandler handler = new CustomHandler();
         HandlerAction action = new HandlerAction(WSConstants.DKT_SIGN);
         handler.send(
-            doc, 
-            reqData, 
+            doc,
+            reqData,
             Collections.singletonList(action),
             true
         );
-        String outputString = 
+        String outputString =
             XMLUtils.PrettyDocumentToString(doc);
         Assert.assertTrue(outputString.contains(ConversationConstants.WSC_NS_05_12));
         if (LOG.isDebugEnabled()) {
             LOG.debug(outputString);
         }
-        
+
         verify(doc);
     }
-    
+
     @org.junit.Test
     public void testSignatureThumbprintSHA1OldNamespace() throws Exception {
         final WSSConfig cfg = WSSConfig.getNewInstance();
         final RequestData reqData = new RequestData();
         reqData.setWssConfig(cfg);
         reqData.setUsername("wss40");
-        
+
         java.util.Map<String, Object> config = new java.util.TreeMap<String, Object>();
         config.put(WSHandlerConstants.SIG_PROP_FILE, "wss40.properties");
         config.put(WSHandlerConstants.PW_CALLBACK_REF, callbackHandler);
         config.put(WSHandlerConstants.DERIVED_TOKEN_KEY_ID, "Thumbprint");
         config.put(WSHandlerConstants.USE_2005_12_NAMESPACE, "false");
         reqData.setMsgContext(config);
-        
+
         final Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
         CustomHandler handler = new CustomHandler();
         HandlerAction action = new HandlerAction(WSConstants.DKT_SIGN);
         handler.send(
-            doc, 
-            reqData, 
+            doc,
+            reqData,
             Collections.singletonList(action),
             true
         );
-        String outputString = 
+        String outputString =
             XMLUtils.PrettyDocumentToString(doc);
         Assert.assertTrue(outputString.contains(ConversationConstants.WSC_NS_05_02));
         if (LOG.isDebugEnabled()) {
             LOG.debug(outputString);
         }
-        
+
         verify(doc);
     }
-    
+
     @org.junit.Test
     public void testSignatureThumbprintSHA1StrongDigest() throws Exception {
         final WSSConfig cfg = WSSConfig.getNewInstance();
         final RequestData reqData = new RequestData();
         reqData.setWssConfig(cfg);
         reqData.setUsername("wss40");
-        
+
         java.util.Map<String, Object> config = new java.util.TreeMap<String, Object>();
         config.put(WSHandlerConstants.SIG_PROP_FILE, "wss40.properties");
         config.put(WSHandlerConstants.PW_CALLBACK_REF, callbackHandler);
         config.put(WSHandlerConstants.SIG_DIGEST_ALGO, WSConstants.SHA256);
         config.put(WSHandlerConstants.DERIVED_TOKEN_KEY_ID, "Thumbprint");
         reqData.setMsgContext(config);
-        
+
         final Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
         CustomHandler handler = new CustomHandler();
         HandlerAction action = new HandlerAction(WSConstants.DKT_SIGN);
         handler.send(
-            doc, 
-            reqData, 
+            doc,
+            reqData,
             Collections.singletonList(action),
             true
         );
-        String outputString = 
+        String outputString =
             XMLUtils.PrettyDocumentToString(doc);
         if (LOG.isDebugEnabled()) {
             LOG.debug(outputString);
         }
-        
+
         verify(doc);
     }
-    
+
     @org.junit.Test
     public void testSignatureThumbprintDifferentKeyLength() throws Exception {
         final WSSConfig cfg = WSSConfig.getNewInstance();
         final RequestData reqData = new RequestData();
         reqData.setWssConfig(cfg);
         reqData.setUsername("wss40");
-        
+
         java.util.Map<String, Object> config = new java.util.TreeMap<String, Object>();
         config.put(WSHandlerConstants.SIG_PROP_FILE, "wss40.properties");
         config.put(WSHandlerConstants.PW_CALLBACK_REF, callbackHandler);
         config.put(WSHandlerConstants.DERIVED_TOKEN_KEY_ID, "Thumbprint");
         config.put(WSHandlerConstants.DERIVED_SIGNATURE_KEY_LENGTH, "16");
         reqData.setMsgContext(config);
-        
+
         final Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
         CustomHandler handler = new CustomHandler();
         HandlerAction action = new HandlerAction(WSConstants.DKT_SIGN);
         handler.send(
-            doc, 
-            reqData, 
+            doc,
+            reqData,
             Collections.singletonList(action),
             true
         );
-        String outputString = 
+        String outputString =
             XMLUtils.PrettyDocumentToString(doc);
         Assert.assertTrue(outputString.contains(ConversationConstants.WSC_NS_05_12));
         if (LOG.isDebugEnabled()) {
             LOG.debug(outputString);
         }
-        
+
         verify(doc);
     }
 
@@ -201,28 +201,28 @@ public class DerivedKeyActionTest extend
         final RequestData reqData = new RequestData();
         reqData.setWssConfig(cfg);
         reqData.setUsername("wss40");
-        
+
         java.util.Map<String, Object> config = new java.util.TreeMap<String, Object>();
         config.put(WSHandlerConstants.SIG_PROP_FILE, "wss40.properties");
         config.put(WSHandlerConstants.PW_CALLBACK_REF, callbackHandler);
         config.put(WSHandlerConstants.DERIVED_TOKEN_KEY_ID, "SKIKeyIdentifier");
         reqData.setMsgContext(config);
-        
+
         final Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
         CustomHandler handler = new CustomHandler();
         HandlerAction action = new HandlerAction(WSConstants.DKT_SIGN);
         handler.send(
-            doc, 
-            reqData, 
+            doc,
+            reqData,
             Collections.singletonList(action),
             true
         );
-        String outputString = 
+        String outputString =
             XMLUtils.PrettyDocumentToString(doc);
         if (LOG.isDebugEnabled()) {
             LOG.debug(outputString);
         }
-        
+
         verify(doc);
     }
 
@@ -232,70 +232,70 @@ public class DerivedKeyActionTest extend
         final RequestData reqData = new RequestData();
         reqData.setWssConfig(cfg);
         reqData.setUsername("wss40");
-        
+
         java.util.Map<String, Object> config = new java.util.TreeMap<String, Object>();
         config.put(WSHandlerConstants.SIG_PROP_FILE, "wss40.properties");
         config.put(WSHandlerConstants.PW_CALLBACK_REF, callbackHandler);
         config.put(WSHandlerConstants.DERIVED_TOKEN_REFERENCE, "DirectReference");
         config.put(WSHandlerConstants.DERIVED_TOKEN_KEY_ID, "X509KeyIdentifier");
         reqData.setMsgContext(config);
-        
+
         final Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
         CustomHandler handler = new CustomHandler();
         HandlerAction action = new HandlerAction(WSConstants.DKT_SIGN);
         handler.send(
-            doc, 
-            reqData, 
+            doc,
+            reqData,
             Collections.singletonList(action),
             true
         );
-        String outputString = 
+        String outputString =
             XMLUtils.PrettyDocumentToString(doc);
         if (LOG.isDebugEnabled()) {
             LOG.debug(outputString);
         }
-        
+
         verify(doc);
     }
-    
+
     @org.junit.Test
     public void testSignatureEncryptedKeyThumbprintSHA1() throws Exception {
         final WSSConfig cfg = WSSConfig.getNewInstance();
         final RequestData reqData = new RequestData();
         reqData.setWssConfig(cfg);
         reqData.setUsername("wss40");
-        
+
         java.util.Map<String, Object> config = new java.util.TreeMap<String, Object>();
         config.put(WSHandlerConstants.SIG_PROP_FILE, "wss40.properties");
         config.put(WSHandlerConstants.PW_CALLBACK_REF, callbackHandler);
         config.put(WSHandlerConstants.DERIVED_TOKEN_REFERENCE, "EncryptedKey");
         config.put(WSHandlerConstants.DERIVED_TOKEN_KEY_ID, "Thumbprint");
         reqData.setMsgContext(config);
-        
+
         final Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
         CustomHandler handler = new CustomHandler();
         HandlerAction action = new HandlerAction(WSConstants.DKT_SIGN);
         handler.send(
-            doc, 
-            reqData, 
+            doc,
+            reqData,
             Collections.singletonList(action),
             true
         );
-        String outputString = 
+        String outputString =
             XMLUtils.PrettyDocumentToString(doc);
         if (LOG.isDebugEnabled()) {
             LOG.debug(outputString);
         }
-        
+
         verify(doc);
     }
-    
+
     @org.junit.Test
     public void testSignatureSCT() throws Exception {
         final WSSConfig cfg = WSSConfig.getNewInstance();
         final RequestData reqData = new RequestData();
         reqData.setWssConfig(cfg);
-        
+
         // Generate a Key
         SecretKeyCallbackHandler secretKeyCallbackHandler = new SecretKeyCallbackHandler();
         KeyGenerator keyGen = KeyGenerator.getInstance("AES");
@@ -303,70 +303,70 @@ public class DerivedKeyActionTest extend
         SecretKey key = keyGen.generateKey();
         byte[] keyData = key.getEncoded();
         secretKeyCallbackHandler.setOutboundSecret(keyData);
-        
+
         java.util.Map<String, Object> config = new java.util.TreeMap<String, Object>();
         config.put(WSHandlerConstants.PW_CALLBACK_REF, secretKeyCallbackHandler);
         config.put(WSHandlerConstants.DERIVED_TOKEN_REFERENCE, "SecurityContextToken");
         reqData.setMsgContext(config);
-        
+
         final Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
         CustomHandler handler = new CustomHandler();
         HandlerAction action = new HandlerAction(WSConstants.DKT_SIGN);
         handler.send(
-            doc, 
-            reqData, 
+            doc,
+            reqData,
             Collections.singletonList(action),
             true
         );
-        String outputString = 
+        String outputString =
             XMLUtils.PrettyDocumentToString(doc);
         if (LOG.isDebugEnabled()) {
             LOG.debug(outputString);
         }
-        
+
         verify(doc, secretKeyCallbackHandler);
     }
-    
+
     @org.junit.Test
     public void testEncryptionThumbprintSHA1() throws Exception {
         final WSSConfig cfg = WSSConfig.getNewInstance();
         final RequestData reqData = new RequestData();
         reqData.setWssConfig(cfg);
         reqData.setUsername("wss40");
-        
+
         java.util.Map<String, Object> config = new java.util.TreeMap<String, Object>();
         config.put(WSHandlerConstants.ENC_PROP_FILE, "wss40.properties");
         config.put(WSHandlerConstants.PW_CALLBACK_REF, callbackHandler);
         config.put(WSHandlerConstants.DERIVED_TOKEN_REFERENCE, "EncryptedKey");
         config.put(WSHandlerConstants.DERIVED_TOKEN_KEY_ID, "Thumbprint");
         reqData.setMsgContext(config);
-        
+
         final Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
         CustomHandler handler = new CustomHandler();
         HandlerAction action = new HandlerAction(WSConstants.DKT_ENCR);
         handler.send(
-            doc, 
-            reqData, 
+            doc,
+            reqData,
             Collections.singletonList(action),
             true
         );
-        String outputString = 
+        String outputString =
             XMLUtils.PrettyDocumentToString(doc);
         Assert.assertTrue(outputString.contains(ConversationConstants.WSC_NS_05_12));
         if (LOG.isDebugEnabled()) {
             LOG.debug(outputString);
         }
-        
+
         verify(doc);
     }
-    
+
     @org.junit.Test
     public void testEncryptionSCT() throws Exception {
         final WSSConfig cfg = WSSConfig.getNewInstance();
         final RequestData reqData = new RequestData();
         reqData.setWssConfig(cfg);
         reqData.setUsername("wss40");
-        
+
         // Generate a Key
         SecretKeyCallbackHandler secretKeyCallbackHandler = new SecretKeyCallbackHandler();
         KeyGenerator keyGen = KeyGenerator.getInstance("AES");
@@ -374,39 +374,39 @@ public class DerivedKeyActionTest extend
         SecretKey key = keyGen.generateKey();
         byte[] keyData = key.getEncoded();
         secretKeyCallbackHandler.setOutboundSecret(keyData);
-        
+
         java.util.Map<String, Object> config = new java.util.TreeMap<String, Object>();
         config.put(WSHandlerConstants.PW_CALLBACK_REF, secretKeyCallbackHandler);
         config.put(WSHandlerConstants.DERIVED_TOKEN_REFERENCE, "SecurityContextToken");
         config.put(WSHandlerConstants.DERIVED_TOKEN_KEY_ID, "Thumbprint");
         reqData.setMsgContext(config);
-        
+
         final Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
         CustomHandler handler = new CustomHandler();
         HandlerAction action = new HandlerAction(WSConstants.DKT_ENCR);
         handler.send(
-            doc, 
-            reqData, 
+            doc,
+            reqData,
             Collections.singletonList(action),
             true
         );
-        String outputString = 
+        String outputString =
             XMLUtils.PrettyDocumentToString(doc);
         Assert.assertTrue(outputString.contains(ConversationConstants.WSC_NS_05_12));
         if (LOG.isDebugEnabled()) {
             LOG.debug(outputString);
         }
-        
+
         verify(doc, secretKeyCallbackHandler);
     }
-    
+
     @org.junit.Test
     public void testSignatureEncryptionThumbprintSHA1() throws Exception {
         final WSSConfig cfg = WSSConfig.getNewInstance();
         final RequestData reqData = new RequestData();
         reqData.setWssConfig(cfg);
         reqData.setUsername("wss40");
-        
+
         java.util.Map<String, Object> config = new java.util.TreeMap<String, Object>();
         config.put(WSHandlerConstants.SIG_PROP_FILE, "wss40.properties");
         config.put(WSHandlerConstants.ENC_PROP_FILE, "wss40.properties");
@@ -414,35 +414,35 @@ public class DerivedKeyActionTest extend
         config.put(WSHandlerConstants.DERIVED_TOKEN_REFERENCE, "EncryptedKey");
         config.put(WSHandlerConstants.DERIVED_TOKEN_KEY_ID, "Thumbprint");
         reqData.setMsgContext(config);
-        
+
         final Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
         CustomHandler handler = new CustomHandler();
         List<HandlerAction> actions = new ArrayList<>();
         actions.add(new HandlerAction(WSConstants.DKT_SIGN));
         actions.add(new HandlerAction(WSConstants.DKT_ENCR));
         handler.send(
-            doc, 
-            reqData, 
+            doc,
+            reqData,
             actions,
             true
         );
-        String outputString = 
+        String outputString =
             XMLUtils.PrettyDocumentToString(doc);
         Assert.assertTrue(outputString.contains(ConversationConstants.WSC_NS_05_12));
         if (LOG.isDebugEnabled()) {
             LOG.debug(outputString);
         }
-        
+
         verify(doc);
     }
-    
+
     @org.junit.Test
     public void testEncryptionSignatureThumbprintSHA1() throws Exception {
         final WSSConfig cfg = WSSConfig.getNewInstance();
         final RequestData reqData = new RequestData();
         reqData.setWssConfig(cfg);
         reqData.setUsername("wss40");
-        
+
         java.util.Map<String, Object> config = new java.util.TreeMap<String, Object>();
         config.put(WSHandlerConstants.SIG_PROP_FILE, "wss40.properties");
         config.put(WSHandlerConstants.ENC_PROP_FILE, "wss40.properties");
@@ -450,35 +450,35 @@ public class DerivedKeyActionTest extend
         config.put(WSHandlerConstants.DERIVED_TOKEN_REFERENCE, "EncryptedKey");
         config.put(WSHandlerConstants.DERIVED_TOKEN_KEY_ID, "Thumbprint");
         reqData.setMsgContext(config);
-        
+
         final Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
         CustomHandler handler = new CustomHandler();
         List<HandlerAction> actions = new ArrayList<>();
         actions.add(new HandlerAction(WSConstants.DKT_ENCR));
         actions.add(new HandlerAction(WSConstants.DKT_SIGN));
         handler.send(
-            doc, 
-            reqData, 
+            doc,
+            reqData,
             actions,
             true
         );
-        String outputString = 
+        String outputString =
             XMLUtils.PrettyDocumentToString(doc);
         Assert.assertTrue(outputString.contains(ConversationConstants.WSC_NS_05_12));
         if (LOG.isDebugEnabled()) {
             LOG.debug(outputString);
         }
-        
+
         verify(doc);
     }
-    
+
     @org.junit.Test
     public void testSignatureEncryptionSecurityContextToken() throws Exception {
         final WSSConfig cfg = WSSConfig.getNewInstance();
         final RequestData reqData = new RequestData();
         reqData.setWssConfig(cfg);
         reqData.setUsername("wss40");
-        
+
         // Generate a Key
         SecretKeyCallbackHandler secretKeyCallbackHandler = new SecretKeyCallbackHandler();
         KeyGenerator keyGen = KeyGenerator.getInstance("AES");
@@ -486,41 +486,41 @@ public class DerivedKeyActionTest extend
         SecretKey key = keyGen.generateKey();
         byte[] keyData = key.getEncoded();
         secretKeyCallbackHandler.setOutboundSecret(keyData);
-        
+
         java.util.Map<String, Object> config = new java.util.TreeMap<String, Object>();
         config.put(WSHandlerConstants.PW_CALLBACK_REF, secretKeyCallbackHandler);
         config.put(WSHandlerConstants.DERIVED_TOKEN_REFERENCE, "SecurityContextToken");
         config.put(WSHandlerConstants.DERIVED_TOKEN_KEY_ID, "Thumbprint");
         reqData.setMsgContext(config);
-        
+
         final Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
         CustomHandler handler = new CustomHandler();
         List<HandlerAction> actions = new ArrayList<>();
         actions.add(new HandlerAction(WSConstants.DKT_SIGN));
         actions.add(new HandlerAction(WSConstants.DKT_ENCR));
         handler.send(
-            doc, 
-            reqData, 
+            doc,
+            reqData,
             actions,
             true
         );
-        String outputString = 
+        String outputString =
             XMLUtils.PrettyDocumentToString(doc);
         Assert.assertTrue(outputString.contains(ConversationConstants.WSC_NS_05_12));
         if (LOG.isDebugEnabled()) {
             LOG.debug(outputString);
         }
-        
+
         verify(doc, secretKeyCallbackHandler);
     }
-    
+
     @org.junit.Test
     public void testEncryptionSignatureSecurityContextToken() throws Exception {
         final WSSConfig cfg = WSSConfig.getNewInstance();
         final RequestData reqData = new RequestData();
         reqData.setWssConfig(cfg);
         reqData.setUsername("wss40");
-        
+
         // Generate a Key
         SecretKeyCallbackHandler secretKeyCallbackHandler = new SecretKeyCallbackHandler();
         KeyGenerator keyGen = KeyGenerator.getInstance("AES");
@@ -528,31 +528,31 @@ public class DerivedKeyActionTest extend
         SecretKey key = keyGen.generateKey();
         byte[] keyData = key.getEncoded();
         secretKeyCallbackHandler.setOutboundSecret(keyData);
-        
+
         java.util.Map<String, Object> config = new java.util.TreeMap<String, Object>();
         config.put(WSHandlerConstants.PW_CALLBACK_REF, secretKeyCallbackHandler);
         config.put(WSHandlerConstants.DERIVED_TOKEN_REFERENCE, "SecurityContextToken");
         config.put(WSHandlerConstants.DERIVED_TOKEN_KEY_ID, "Thumbprint");
         reqData.setMsgContext(config);
-        
+
         final Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
         CustomHandler handler = new CustomHandler();
         List<HandlerAction> actions = new ArrayList<>();
         actions.add(new HandlerAction(WSConstants.DKT_ENCR));
         actions.add(new HandlerAction(WSConstants.DKT_SIGN));
         handler.send(
-            doc, 
-            reqData, 
+            doc,
+            reqData,
             actions,
             true
         );
-        String outputString = 
+        String outputString =
             XMLUtils.PrettyDocumentToString(doc);
         Assert.assertTrue(outputString.contains(ConversationConstants.WSC_NS_05_12));
         if (LOG.isDebugEnabled()) {
             LOG.debug(outputString);
         }
-        
+
         verify(doc, secretKeyCallbackHandler);
     }
 
@@ -562,12 +562,12 @@ public class DerivedKeyActionTest extend
 
     private WSHandlerResult verify(Document doc, CallbackHandler cbHandler) throws Exception {
         WSSecurityEngine secEngine = new WSSecurityEngine();
-        WSHandlerResult results = 
+        WSHandlerResult results =
             secEngine.processSecurityHeader(doc, null, cbHandler, crypto);
-        String outputString = 
+        String outputString =
             XMLUtils.PrettyDocumentToString(doc);
         assertTrue(outputString.indexOf("counter_port_type") > 0 ? true : false);
-        
+
         return results;
     }
 

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/DerivedKeyTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/DerivedKeyTest.java?rev=1720192&r1=1720191&r2=1720192&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/DerivedKeyTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/DerivedKeyTest.java Tue Dec 15 16:40:37 2015
@@ -42,17 +42,17 @@ import javax.security.auth.callback.Call
  * A set of tests for using a derived key for encryption/signature.
  */
 public class DerivedKeyTest extends org.junit.Assert {
-    private static final org.slf4j.Logger LOG = 
+    private static final org.slf4j.Logger LOG =
         org.slf4j.LoggerFactory.getLogger(DerivedKeyTest.class);
     private WSSecurityEngine secEngine = new WSSecurityEngine();
     private CallbackHandler callbackHandler = new KeystoreCallbackHandler();
     private Crypto crypto = null;
-    
+
     @org.junit.AfterClass
     public static void cleanup() throws Exception {
         SecurityTestUtil.cleanup();
     }
-    
+
     public DerivedKeyTest() throws Exception {
         crypto = CryptoFactory.getInstance("wss40.properties");
         WSSConfig.init();
@@ -60,7 +60,7 @@ public class DerivedKeyTest extends org.
 
     /**
      * Test encryption using a DerivedKeyToken using TRIPLEDES
-     * @throws Exception Thrown when there is any problem in signing or 
+     * @throws Exception Thrown when there is any problem in signing or
      * verification
      */
     @org.junit.Test
@@ -77,20 +77,20 @@ public class DerivedKeyTest extends org.
 
         //Key information from the EncryptedKey
         byte[] ek = encrKeyBuilder.getEphemeralKey();
-        String tokenIdentifier = encrKeyBuilder.getId();  
-        
+        String tokenIdentifier = encrKeyBuilder.getId();
+
         //Derived key encryption
         WSSecDKEncrypt encrBuilder = new WSSecDKEncrypt();
         encrBuilder.setSymmetricEncAlgorithm(WSConstants.AES_128);
         encrBuilder.setExternalKey(ek, tokenIdentifier);
         Document encryptedDoc = encrBuilder.build(doc, secHeader);
-        
+
         encrKeyBuilder.prependToHeader(secHeader);
         encrKeyBuilder.prependBSTElementToHeader(secHeader);
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("Encrypted message: 3DES  + DerivedKeys");
-            String outputString = 
+            String outputString =
                 XMLUtils.PrettyDocumentToString(encryptedDoc);
             LOG.debug(outputString);
         }
@@ -98,7 +98,7 @@ public class DerivedKeyTest extends org.
     }
 
     /**
-     * Test encryption using a DerivedKeyToken using AES128 
+     * Test encryption using a DerivedKeyToken using AES128
      * @throws Exception Thrown when there is any problem in signing or verification
      */
     @org.junit.Test
@@ -115,7 +115,7 @@ public class DerivedKeyTest extends org.
 
         //Key information from the EncryptedKey
         byte[] ek = encrKeyBuilder.getEphemeralKey();
-        String tokenIdentifier = encrKeyBuilder.getId();  
+        String tokenIdentifier = encrKeyBuilder.getId();
 
         //Derived key encryption
         WSSecDKEncrypt encrBuilder = new WSSecDKEncrypt();
@@ -128,13 +128,13 @@ public class DerivedKeyTest extends org.
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("Encrypted message: 3DES  + DerivedKeys");
-            String outputString = 
+            String outputString =
                 XMLUtils.PrettyDocumentToString(encryptedDoc);
             LOG.debug(outputString);
         }
         verify(doc);
      }
-     
+
     @org.junit.Test
     public void testSignature() throws Exception {
         Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
@@ -149,7 +149,7 @@ public class DerivedKeyTest extends org.
 
         //Key information from the EncryptedKey
         byte[] ek = encrKeyBuilder.getEphemeralKey();
-        String tokenIdentifier = encrKeyBuilder.getId();         
+        String tokenIdentifier = encrKeyBuilder.getId();
 
         //Derived key encryption
         WSSecDKSign sigBuilder = new WSSecDKSign();
@@ -162,13 +162,13 @@ public class DerivedKeyTest extends org.
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("Signed message: 3DES  + DerivedKeys");
-            String outputString = 
+            String outputString =
                 XMLUtils.PrettyDocumentToString(doc);
             LOG.debug(outputString);
         }
         WSHandlerResult results = verify(doc);
-        
-        WSSecurityEngineResult actionResult = 
+
+        WSSecurityEngineResult actionResult =
             results.getActionResults().get(WSConstants.SIGN).get(0);
         assertTrue(actionResult != null);
         assertFalse(actionResult.isEmpty());
@@ -204,13 +204,13 @@ public class DerivedKeyTest extends org.
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("Encrypted message: ThumbprintSHA1 + DerivedKeys");
-            String outputString = 
+            String outputString =
                 XMLUtils.PrettyDocumentToString(doc);
             LOG.debug(outputString);
         }
         WSHandlerResult results = verify(doc);
-        
-        WSSecurityEngineResult actionResult = 
+
+        WSSecurityEngineResult actionResult =
             results.getActionResults().get(WSConstants.SIGN).get(0);
         assertTrue(actionResult != null);
         assertFalse(actionResult.isEmpty());
@@ -245,13 +245,13 @@ public class DerivedKeyTest extends org.
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("Encrypted message: SKI + DerivedKeys");
-            String outputString = 
+            String outputString =
                 XMLUtils.PrettyDocumentToString(doc);
             LOG.debug(outputString);
         }
         WSHandlerResult results = verify(doc);
-        
-        WSSecurityEngineResult actionResult = 
+
+        WSSecurityEngineResult actionResult =
             results.getActionResults().get(WSConstants.SIGN).get(0);
         assertTrue(actionResult != null);
         assertFalse(actionResult.isEmpty());
@@ -292,7 +292,7 @@ public class DerivedKeyTest extends org.
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("Encrypted message: 3DES  + DerivedKeys");
-            String outputString = 
+            String outputString =
                 XMLUtils.PrettyDocumentToString(signedEncryptedDoc);
             LOG.debug(outputString);
         }
@@ -333,7 +333,7 @@ public class DerivedKeyTest extends org.
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("Encrypted message: 3DES  + DerivedKeys");
-            String outputString = 
+            String outputString =
                 XMLUtils.PrettyDocumentToString(encryptedSignedDoc);
             LOG.debug(outputString);
         }
@@ -344,17 +344,17 @@ public class DerivedKeyTest extends org.
     /**
      * Verifies the soap envelope
      * <p/>
-     * 
-     * @param envelope 
+     *
+     * @param envelope
      * @throws Exception Thrown when there is a problem in verification
      */
     private WSHandlerResult verify(Document doc) throws Exception {
-        WSHandlerResult results = 
+        WSHandlerResult results =
             secEngine.processSecurityHeader(doc, null, callbackHandler, crypto);
-        String outputString = 
+        String outputString =
             XMLUtils.PrettyDocumentToString(doc);
         assertTrue(outputString.indexOf("counter_port_type") > 0 ? true : false);
-        
+
         return results;
     }
 

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptedDataInHeaderTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptedDataInHeaderTest.java?rev=1720192&r1=1720191&r2=1720192&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptedDataInHeaderTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptedDataInHeaderTest.java Tue Dec 15 16:40:37 2015
@@ -40,22 +40,22 @@ import org.w3c.dom.Element;
 /**
  * This test encrypts a Timestamp and the SOAP Body, and appends the ReferenceList Element after the
  * EncryptedData Element that is the Timestamp. When processing, the EncryptedData Element gets decrypted,
- * and then the ReferenceListProcessor must check to see whether the Data Reference pointing to the 
+ * and then the ReferenceListProcessor must check to see whether the Data Reference pointing to the
  * encrypted Timestamp needs to be decrypted or not.
  */
 public class EncryptedDataInHeaderTest extends org.junit.Assert {
-    private static final org.slf4j.Logger LOG = 
+    private static final org.slf4j.Logger LOG =
         org.slf4j.LoggerFactory.getLogger(EncryptedDataInHeaderTest.class);
 
     private WSSecurityEngine secEngine = new WSSecurityEngine();
     private CallbackHandler callbackHandler = new KeystoreCallbackHandler();
     private Crypto crypto = null;
-    
+
     @org.junit.AfterClass
     public static void cleanup() throws Exception {
         SecurityTestUtil.cleanup();
     }
-    
+
     public EncryptedDataInHeaderTest() throws Exception {
         crypto = CryptoFactory.getInstance();
         WSSConfig.init();
@@ -66,61 +66,61 @@ public class EncryptedDataInHeaderTest e
         Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
         WSSecHeader secHeader = new WSSecHeader(doc);
         secHeader.insertSecurityHeader();
-        
+
         WSSecTimestamp timestamp = new WSSecTimestamp();
         timestamp.setTimeToLive(300);
         timestamp.build(doc, secHeader);
-        
+
         WSSecEncrypt encrypt = new WSSecEncrypt();
         encrypt.setUserInfo("16c73ab6-b892-458f-abf5-2f875f74882e", "security");
         encrypt.setKeyIdentifierType(WSConstants.ISSUER_SERIAL);
-        
+
         // Encrypt the Timestamp and SOAP Body
         WSEncryptionPart encP =
             new WSEncryptionPart(
                 "Timestamp", WSConstants.WSU_NS, "");
         encrypt.getParts().add(encP);
         String soapNamespace = WSSecurityUtil.getSOAPNamespace(doc.getDocumentElement());
-        encP = 
+        encP =
             new WSEncryptionPart(
                 WSConstants.ELEM_BODY, soapNamespace, "Content"
             );
         encrypt.getParts().add(encP);
-        
+
         encrypt.prepare(doc, crypto);
         encrypt.prependToHeader(secHeader);
-        
+
         // Append Reference List to security header
         Element refs = encrypt.encrypt();
         secHeader.getSecurityHeader().appendChild(refs);
 
         if (LOG.isDebugEnabled()) {
-            String outputString = 
+            String outputString =
                 XMLUtils.PrettyDocumentToString(doc);
             LOG.debug(outputString);
         }
-        
+
         WSHandlerResult results = verify(doc);
-        WSSecurityEngineResult actionResult = 
+        WSSecurityEngineResult actionResult =
             results.getActionResults().get(WSConstants.ENCR).get(0);
         assertTrue(actionResult != null);
         assertFalse(actionResult.isEmpty());
     }
-    
-    
+
+
     /**
      * Verifies the soap envelope
      * <p/>
-     * 
-     * @param doc 
+     *
+     * @param doc
      * @throws Exception Thrown when there is a problem in verification
      */
     private WSHandlerResult verify(Document doc) throws Exception {
-        WSHandlerResult results = 
+        WSHandlerResult results =
             secEngine.processSecurityHeader(doc, null, callbackHandler, null, crypto);
         if (LOG.isDebugEnabled()) {
             LOG.debug("Verified and decrypted message:");
-            String outputString = 
+            String outputString =
                 XMLUtils.PrettyDocumentToString(doc);
             LOG.debug(outputString);
         }



Mime
View raw message