You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wss4j-dev@ws.apache.org by co...@apache.org on 2009/05/19 11:55:04 UTC

svn commit: r776253 [2/2] - in /webservices/wss4j/trunk: src/org/apache/ws/axis/security/ src/org/apache/ws/security/ src/org/apache/ws/security/components/crypto/ src/org/apache/ws/security/handler/ src/org/apache/ws/security/processor/ src/org/apache...

Modified: webservices/wss4j/trunk/test/wssec/TestWSSecurityResultsOrder.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/test/wssec/TestWSSecurityResultsOrder.java?rev=776253&r1=776252&r2=776253&view=diff
==============================================================================
--- webservices/wss4j/trunk/test/wssec/TestWSSecurityResultsOrder.java (original)
+++ webservices/wss4j/trunk/test/wssec/TestWSSecurityResultsOrder.java Tue May 19 09:55:03 2009
@@ -24,7 +24,6 @@
 import junit.framework.TestSuite;
 import org.apache.ws.security.WSConstants;
 import org.apache.ws.security.WSSecurityEngineResult;
-import org.apache.ws.security.handler.WSHandler;
 
 
 /**
@@ -59,7 +58,7 @@
     testOrder() throws Exception {
         MyHandler handler = new MyHandler();
         
-        java.util.Vector results = new java.util.Vector();
+        java.util.List results = new java.util.Vector();
         results.add(
             new WSSecurityEngineResult(WSConstants.UT, (Object)null)
         );
@@ -73,7 +72,7 @@
             new WSSecurityEngineResult(WSConstants.SIGN, (Object)null)
         );
         
-        java.util.Vector actions = new java.util.Vector();
+        java.util.List actions = new java.util.Vector();
         actions.add(new Integer(WSConstants.UT));
         actions.add(new Integer(WSConstants.TS));
         actions.add(new Integer(WSConstants.SIGN));
@@ -88,7 +87,7 @@
     testReverseOrder() throws Exception {
         MyHandler handler = new MyHandler();
         
-        java.util.Vector results = new java.util.Vector();
+        java.util.List results = new java.util.Vector();
         results.add(
             new WSSecurityEngineResult(WSConstants.SIGN, (Object)null)
         );
@@ -102,7 +101,7 @@
             new WSSecurityEngineResult(WSConstants.UT, (Object)null)
         );
         
-        java.util.Vector actions = new java.util.Vector();
+        java.util.List actions = new java.util.Vector();
         actions.add(new Integer(WSConstants.UT));
         actions.add(new Integer(WSConstants.TS));
         actions.add(new Integer(WSConstants.SIGN));
@@ -117,7 +116,7 @@
     testMixedOrder() throws Exception {
         MyHandler handler = new MyHandler();
         
-        java.util.Vector results = new java.util.Vector();
+        java.util.List results = new java.util.Vector();
         results.add(
             new WSSecurityEngineResult(WSConstants.TS, (Object)null)
         );
@@ -131,7 +130,7 @@
             new WSSecurityEngineResult(WSConstants.UT, (Object)null)
         );
         
-        java.util.Vector actions = new java.util.Vector();
+        java.util.List actions = new java.util.Vector();
         actions.add(new Integer(WSConstants.UT));
         actions.add(new Integer(WSConstants.TS));
         actions.add(new Integer(WSConstants.SIGN));
@@ -147,7 +146,7 @@
     testMixedOrder2() throws Exception {
         MyHandler handler = new MyHandler();
         
-        java.util.Vector results = new java.util.Vector();
+        java.util.List results = new java.util.Vector();
         results.add(
             new WSSecurityEngineResult(WSConstants.TS, (Object)null)
         );
@@ -161,7 +160,7 @@
             new WSSecurityEngineResult(WSConstants.UT, (Object)null)
         );
         
-        java.util.Vector actions = new java.util.Vector();
+        java.util.List actions = new java.util.Vector();
         actions.add(new Integer(WSConstants.SIGN));
         actions.add(new Integer(WSConstants.UT));
         actions.add(new Integer(WSConstants.TS));
@@ -176,7 +175,7 @@
     testMissingResult() throws Exception {
         MyHandler handler = new MyHandler();
         
-        java.util.Vector results = new java.util.Vector();
+        java.util.List results = new java.util.Vector();
         results.add(
             new WSSecurityEngineResult(WSConstants.UT, (Object)null)
         );
@@ -187,7 +186,7 @@
             new WSSecurityEngineResult(WSConstants.SC, (Object)null)
         );
         
-        java.util.Vector actions = new java.util.Vector();
+        java.util.List actions = new java.util.Vector();
         actions.add(new Integer(WSConstants.TS));
         actions.add(new Integer(WSConstants.UT));
         actions.add(new Integer(WSConstants.SIGN));
@@ -202,7 +201,7 @@
     testMissingAction() throws Exception {
         MyHandler handler = new MyHandler();
         
-        java.util.Vector results = new java.util.Vector();
+        java.util.List results = new java.util.Vector();
         results.add(
             new WSSecurityEngineResult(WSConstants.UT, (Object)null)
         );
@@ -216,7 +215,7 @@
             new WSSecurityEngineResult(WSConstants.SC, (Object)null)
         );
         
-        java.util.Vector actions = new java.util.Vector();
+        java.util.List actions = new java.util.Vector();
         actions.add(new Integer(WSConstants.TS));
         actions.add(new Integer(WSConstants.UT));
         
@@ -230,9 +229,9 @@
     testNoResult() throws Exception {
         MyHandler handler = new MyHandler();
         
-        java.util.Vector results = new java.util.Vector();
+        java.util.List results = new java.util.Vector();
         
-        java.util.Vector actions = new java.util.Vector();
+        java.util.List actions = new java.util.Vector();
         actions.add(new Integer(WSConstants.TS));
         
         assertFalse (handler.checkResults(results, actions));
@@ -245,62 +244,15 @@
     testNoAction() throws Exception {
         MyHandler handler = new MyHandler();
         
-        java.util.Vector results = new java.util.Vector();
+        java.util.List results = new java.util.Vector();
         results.add(
             new WSSecurityEngineResult(WSConstants.TS, (Object)null)
         );
         
-        java.util.Vector actions = new java.util.Vector();
+        java.util.List actions = new java.util.Vector();
         
         assertFalse (handler.checkResults(results, actions));
         assertFalse (handler.checkResultsAnyOrder(results, actions));
     }
     
-    /**
-     * a trivial extension of the WSHandler type
-     */
-    public static class MyHandler extends WSHandler {
-        
-        public Object 
-        getOption(String key) {
-            return null;
-        }
-        
-        public void 
-        setProperty(
-            Object msgContext, 
-            String key, 
-            Object value
-        ) {
-        }
-
-        public Object 
-        getProperty(Object ctx, String key) {
-            return null;
-        }
-    
-        public void 
-        setPassword(Object msgContext, String password) {
-        }
-        
-        public String 
-        getPassword(Object msgContext) {
-            return null;
-        }
-
-        boolean checkResults(
-            java.util.Vector results,
-            java.util.Vector actions
-        ) throws org.apache.ws.security.WSSecurityException {
-            return checkReceiverResults(results, actions);
-        }
-        
-        boolean checkResultsAnyOrder(
-            java.util.Vector results,
-            java.util.Vector actions
-        ) throws org.apache.ws.security.WSSecurityException {
-            return checkReceiverResultsAnyOrder(results, actions);
-        }
-    }
-    
 }

Modified: webservices/wss4j/trunk/test/wssec/TestWSSecuritySignatureParts.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/test/wssec/TestWSSecuritySignatureParts.java?rev=776253&r1=776252&r2=776253&view=diff
==============================================================================
--- webservices/wss4j/trunk/test/wssec/TestWSSecuritySignatureParts.java (original)
+++ webservices/wss4j/trunk/test/wssec/TestWSSecuritySignatureParts.java Tue May 19 09:55:03 2009
@@ -150,7 +150,7 @@
             LOG.debug(outputString);
         }
         
-        Vector results = verify(signedDoc);
+        List results = verify(signedDoc);
         
         QName name = new QName("urn:foo.bar", "foobar");
         WSSecurityUtil.checkAllElementsProtected(results, WSConstants.SIGN, new QName[]{name});
@@ -271,7 +271,7 @@
             LOG.debug(outputString);
         }
         
-        Vector results = verify(signedDoc);
+        List results = verify(signedDoc);
         
         QName fooName = new QName("urn:foo.bar", "foobar");
         QName bodyName = new QName(soapConstants.getEnvelopeURI(), "Body");
@@ -318,8 +318,8 @@
      * @param doc 
      * @throws Exception Thrown when there is a problem in verification
      */
-    private Vector verify(Document doc) throws Exception {
-        Vector results = secEngine.processSecurityHeader(doc, null, this, crypto);
+    private List verify(Document doc) throws Exception {
+        List results = secEngine.processSecurityHeader(doc, null, this, crypto);
         if (LOG.isDebugEnabled()) {
             LOG.debug("Verfied and decrypted message:");
             String outputString = 

Modified: webservices/wss4j/trunk/test/wssec/TestWSSecurityTimestamp.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/test/wssec/TestWSSecurityTimestamp.java?rev=776253&r1=776252&r2=776253&view=diff
==============================================================================
--- webservices/wss4j/trunk/test/wssec/TestWSSecurityTimestamp.java (original)
+++ webservices/wss4j/trunk/test/wssec/TestWSSecurityTimestamp.java Tue May 19 09:55:03 2009
@@ -42,7 +42,7 @@
 
 import java.io.ByteArrayInputStream;
 import java.io.InputStream;
-import java.util.Vector;
+import java.util.List;
 
 /**
  * WS-Security Test Case for Timestamps.
@@ -135,7 +135,7 @@
         //
         // Do some processing
         //
-        Vector wsResult = verify(createdDoc, WSSConfig.getNewInstance());
+        List wsResult = verify(createdDoc, WSSConfig.getNewInstance());
         WSSecurityEngineResult actionResult = 
             WSSecurityUtil.fetchActionResult(wsResult, WSConstants.TS);
         assertTrue(actionResult != null);
@@ -168,7 +168,7 @@
         //
         // Do some processing
         //
-        Vector wsResult = verify(createdDoc, WSSConfig.getNewInstance());
+        List wsResult = verify(createdDoc, WSSConfig.getNewInstance());
         WSSecurityEngineResult actionResult = 
             WSSecurityUtil.fetchActionResult(wsResult, WSConstants.TS);
         assertTrue(actionResult != null);
@@ -247,7 +247,7 @@
      * @param wssConfig
      * @throws java.lang.Exception Thrown when there is a problem in verification
      */
-    private Vector verify(Document doc, WSSConfig wssConfig) throws Exception {
+    private List verify(Document doc, WSSConfig wssConfig) throws Exception {
         secEngine.setWssConfig(wssConfig);
         return secEngine.processSecurityHeader(doc, null, null, null);
     }

Modified: webservices/wss4j/trunk/test/wssec/TestWSSecurityUTDK.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/test/wssec/TestWSSecurityUTDK.java?rev=776253&r1=776252&r2=776253&view=diff
==============================================================================
--- webservices/wss4j/trunk/test/wssec/TestWSSecurityUTDK.java (original)
+++ webservices/wss4j/trunk/test/wssec/TestWSSecurityUTDK.java Tue May 19 09:55:03 2009
@@ -52,7 +52,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 
-import java.util.Vector;
+import java.util.List;
 
 /**
  * WS-Security Test Case for UsernameToken Key Derivation, as defined in the 
@@ -344,7 +344,7 @@
             LOG.debug(outputString);
         }
         
-        Vector results = verify(signedDoc);
+        List results = verify(signedDoc);
         WSSecurityEngineResult actionResult =
             WSSecurityUtil.fetchActionResult(results, WSConstants.SIGN);
         java.security.Principal principal = 
@@ -449,7 +449,7 @@
      * @param env soap envelope
      * @throws java.lang.Exception Thrown when there is a problem in verification
      */
-    private Vector verify(Document doc) throws Exception {
+    private List verify(Document doc) throws Exception {
         return secEngine.processSecurityHeader(doc, null, this, crypto);
     }
     

Modified: webservices/wss4j/trunk/test/wssec/TestWSSecurityUTSignature.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/test/wssec/TestWSSecurityUTSignature.java?rev=776253&r1=776252&r2=776253&view=diff
==============================================================================
--- webservices/wss4j/trunk/test/wssec/TestWSSecurityUTSignature.java (original)
+++ webservices/wss4j/trunk/test/wssec/TestWSSecurityUTSignature.java Tue May 19 09:55:03 2009
@@ -50,7 +50,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 
-import java.util.Vector;
+import java.util.List;
 
 /**
  * WS-Security Test Case for UsernameToken Key Derivation, as defined in the 
@@ -160,7 +160,7 @@
             LOG.debug(outputString);
         }
         
-        Vector results = verify(signedDoc);
+        List results = verify(signedDoc);
         WSSecurityEngineResult actionResult =
             WSSecurityUtil.fetchActionResult(results, WSConstants.UT_SIGN);
         java.security.Principal principal = 
@@ -214,7 +214,7 @@
      * @param env soap envelope
      * @throws java.lang.Exception Thrown when there is a problem in verification
      */
-    private Vector verify(Document doc) throws Exception {
+    private List verify(Document doc) throws Exception {
         return secEngine.processSecurityHeader(doc, null, this, crypto);
     }
     

Modified: webservices/wss4j/trunk/test/wssec/TestWSSecurityUserProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/test/wssec/TestWSSecurityUserProcessor.java?rev=776253&r1=776252&r2=776253&view=diff
==============================================================================
--- webservices/wss4j/trunk/test/wssec/TestWSSecurityUserProcessor.java (original)
+++ webservices/wss4j/trunk/test/wssec/TestWSSecurityUserProcessor.java Tue May 19 09:55:03 2009
@@ -34,7 +34,6 @@
 import org.apache.ws.security.WSSConfig;
 import org.apache.ws.security.components.crypto.Crypto;
 import org.apache.ws.security.components.crypto.CryptoFactory;
-import org.apache.ws.security.handler.WSHandler;
 import org.apache.ws.security.handler.RequestData;
 import org.apache.ws.security.message.WSSecSignature;
 import org.apache.ws.security.message.WSSecHeader;
@@ -228,11 +227,12 @@
         MyHandler handler = new MyHandler();
         reqData.setMsgContext("bread");
         assertEquals(reqData.getMsgContext(), "bread");
-        handler.doit(
+        handler.send(
             action, 
             doc, 
             reqData, 
-            actions
+            actions,
+            true
         );
         assertEquals(reqData.getMsgContext(), "crumb");
     }
@@ -257,60 +257,14 @@
         MyHandler handler = new MyHandler();
         reqData.setMsgContext("bread");
         assertEquals(reqData.getMsgContext(), "bread");
-        handler.doit(
+        handler.send(
             action, 
             doc, 
             reqData, 
-            actions
+            actions,
+            true
         );
         assertEquals(reqData.getMsgContext(), "crumb");
     }
-    
-    /**
-     * a trivial extension of the WSHandler type
-     */
-    public static class MyHandler extends WSHandler {
-        
-        public Object 
-        getOption(String key) {
-            return null;
-        }
-        
-        public void 
-        setProperty(
-            Object msgContext, 
-            String key, 
-            Object value
-        ) {
-        }
 
-        public Object 
-        getProperty(Object ctx, String key) {
-            return null;
-        }
-    
-        public void 
-        setPassword(Object msgContext, String password) {
-        }
-        
-        public String 
-        getPassword(Object msgContext) {
-            return null;
-        }
-
-        void doit(
-            int action, 
-            Document doc,
-            RequestData reqData, 
-            java.util.Vector actions
-        ) throws org.apache.ws.security.WSSecurityException {
-            doSenderAction(
-                action, 
-                doc, 
-                reqData, 
-                actions,
-                true
-            );
-        }
-    }
 }

Modified: webservices/wss4j/trunk/test/wssec/TestWSSecurityWSS40.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/test/wssec/TestWSSecurityWSS40.java?rev=776253&r1=776252&r2=776253&view=diff
==============================================================================
--- webservices/wss4j/trunk/test/wssec/TestWSSecurityWSS40.java (original)
+++ webservices/wss4j/trunk/test/wssec/TestWSSecurityWSS40.java Tue May 19 09:55:03 2009
@@ -37,7 +37,6 @@
 import org.apache.ws.security.components.crypto.Crypto;
 import org.apache.ws.security.components.crypto.CryptoFactory;
 import org.apache.ws.security.handler.RequestData;
-import org.apache.ws.security.handler.WSHandler;
 import org.apache.ws.security.message.WSSecSignature;
 import org.apache.ws.security.message.WSSecHeader;
 import org.apache.ws.security.util.WSSecurityUtil;
@@ -50,7 +49,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.security.cert.X509Certificate;
-import java.util.Vector;
+import java.util.List;
 
 /**
  * This is a test for WSS-40. Essentially it just tests that a message is signed using a
@@ -167,7 +166,7 @@
         //
         // Verify the signature
         //
-        Vector results = verify(signedDoc, cryptoCA);
+        List results = verify(signedDoc, cryptoCA);
         
         //
         // Verify trust on the X509Certificate
@@ -246,7 +245,7 @@
         //
         // Verify the signature
         //
-        Vector results = verify(signedDoc, CryptoFactory.getInstance("wss40badcatrust.properties"));
+        List results = verify(signedDoc, CryptoFactory.getInstance("wss40badcatrust.properties"));
         
         //
         // Verify trust on the X509Certificate
@@ -276,8 +275,8 @@
      * @param doc 
      * @throws Exception Thrown when there is a problem in verification
      */
-    private Vector verify(Document doc, Crypto crypto) throws WSSecurityException {
-        Vector results = secEngine.processSecurityHeader(
+    private List verify(Document doc, Crypto crypto) throws WSSecurityException {
+        List results = secEngine.processSecurityHeader(
             doc, null, this, crypto
         );
         if (LOG.isDebugEnabled()) {
@@ -307,46 +306,4 @@
         }
     }
     
-    /**
-     * a trivial extension of the WSHandler type
-     */
-    public static class MyHandler extends WSHandler {
-        
-        public Object 
-        getOption(String key) {
-            return null;
-        }
-        
-        public void 
-        setProperty(
-            Object msgContext, 
-            String key, 
-            Object value
-        ) {
-        }
-
-        public Object 
-        getProperty(Object ctx, String key) {
-            return null;
-        }
-    
-        public void 
-        setPassword(Object msgContext, String password) {
-        }
-        
-        public String 
-        getPassword(Object msgContext) {
-            return null;
-        }
-
-        boolean verifyCertificate(
-            X509Certificate cert,
-            RequestData reqData 
-        ) throws org.apache.ws.security.WSSecurityException {
-            return verifyTrust(
-                cert, 
-                reqData
-            );
-        }
-    }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: wss4j-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: wss4j-dev-help@ws.apache.org