You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by co...@apache.org on 2013/12/05 18:08:28 UTC

svn commit: r1548207 - in /santuario/xml-security-java/trunk/src: main/java/org/apache/xml/security/stax/ext/ test/java/org/apache/xml/security/test/stax/encryption/ test/java/org/apache/xml/security/test/stax/performance/ test/java/org/apache/xml/secu...

Author: coheigea
Date: Thu Dec  5 17:08:27 2013
New Revision: 1548207

URL: http://svn.apache.org/r1548207
Log:
Switching to use a List rather than an array to configure actions

Modified:
    santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/ext/OutboundXMLSec.java
    santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/ext/XMLSec.java
    santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/ext/XMLSecurityProperties.java
    santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/encryption/EncryptionCreationTest.java
    santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/encryption/XMLEncryption11Test.java
    santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/performance/AbstractPerformanceTest.java
    santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/signature/SignatureCreationReferenceURIResolverTest.java
    santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/signature/SignatureCreationTest.java

Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/ext/OutboundXMLSec.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/ext/OutboundXMLSec.java?rev=1548207&r1=1548206&r2=1548207&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/ext/OutboundXMLSec.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/ext/OutboundXMLSec.java Thu Dec  5 17:08:27 2013
@@ -86,8 +86,7 @@ public class OutboundXMLSec {
 
         OutputProcessorChainImpl outputProcessorChain = new OutputProcessorChainImpl(outboundSecurityContext, documentContext);
 
-        for (int i = 0; i < securityProperties.getActions().length; i++) {
-            XMLSecurityConstants.Action action = securityProperties.getActions()[i];
+        for (XMLSecurityConstants.Action action : securityProperties.getActions()) {
             if (XMLSecurityConstants.SIGNATURE.equals(action)) {
                 XMLSignatureOutputProcessor signatureOutputProcessor = new XMLSignatureOutputProcessor();
                 initializeOutputProcessor(outputProcessorChain, signatureOutputProcessor, action);

Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/ext/XMLSec.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/ext/XMLSec.java?rev=1548207&r1=1548206&r2=1548207&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/ext/XMLSec.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/ext/XMLSec.java Thu Dec  5 17:08:27 2013
@@ -104,8 +104,7 @@ public class XMLSec {
             throw new XMLSecurityConfigurationException("stax.noOutputAction");
         }
 
-        for (int i = 0; i < securityProperties.getActions().length; i++) {
-            XMLSecurityConstants.Action action = securityProperties.getActions()[i];
+        for (XMLSecurityConstants.Action action : securityProperties.getActions()) {
             if (XMLSecurityConstants.SIGNATURE.equals(action)) {
                 if (securityProperties.getSignatureAlgorithm() == null) {
                     if (securityProperties.getSignatureKey() instanceof RSAPrivateKey) {

Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/ext/XMLSecurityProperties.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/ext/XMLSecurityProperties.java?rev=1548207&r1=1548206&r2=1548207&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/ext/XMLSecurityProperties.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/ext/XMLSecurityProperties.java Thu Dec  5 17:08:27 2013
@@ -40,7 +40,7 @@ public class XMLSecurityProperties {
     private boolean skipDocumentEvents = false;
     private boolean disableSchemaValidation = false;
 
-    private XMLSecurityConstants.Action[] actions;
+    private List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
 
     private X509Certificate encryptionUseThisCertificate;
     private String encryptionSymAlgorithm;
@@ -294,7 +294,7 @@ public class XMLSecurityProperties {
      *
      * @return The Actions in applied order
      */
-    public XMLSecurityConstants.Action[] getActions() {
+    public List<XMLSecurityConstants.Action> getActions() {
         return actions;
     }
 
@@ -303,7 +303,7 @@ public class XMLSecurityProperties {
      *
      * @param actions
      */
-    public void setActions(XMLSecurityConstants.Action[] actions) {
+    public void setActions(List<XMLSecurityConstants.Action> actions) {
         this.actions = actions;
     }
 

Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/encryption/EncryptionCreationTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/encryption/EncryptionCreationTest.java?rev=1548207&r1=1548206&r2=1548207&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/encryption/EncryptionCreationTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/encryption/EncryptionCreationTest.java Thu Dec  5 17:08:27 2013
@@ -26,6 +26,8 @@ import java.security.KeyPair;
 import java.security.KeyPairGenerator;
 import java.security.PrivateKey;
 import java.security.PublicKey;
+import java.util.ArrayList;
+import java.util.List;
 
 import javax.crypto.KeyGenerator;
 import javax.crypto.SecretKey;
@@ -78,8 +80,8 @@ public class EncryptionCreationTest exte
     public void testEncryptionContentCreation() throws Exception {
         // Set up the Configuration
         XMLSecurityProperties properties = new XMLSecurityProperties();
-        XMLSecurityConstants.Action[] actions = 
-            new XMLSecurityConstants.Action[]{XMLSecurityConstants.ENCRYPT};
+        List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
+        actions.add(XMLSecurityConstants.ENCRYPT);
         properties.setActions(actions);
         
         // Set the key up
@@ -134,8 +136,8 @@ public class EncryptionCreationTest exte
     public void testExceptionOnElementToEncryptNotFound() throws Exception {
         // Set up the Configuration
         XMLSecurityProperties properties = new XMLSecurityProperties();
-        XMLSecurityConstants.Action[] actions =
-                new XMLSecurityConstants.Action[]{XMLSecurityConstants.ENCRYPT};
+        List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
+        actions.add(XMLSecurityConstants.ENCRYPT);
         properties.setActions(actions);
 
         // Set the key up
@@ -170,8 +172,8 @@ public class EncryptionCreationTest exte
     public void testEncryptionElementCreation() throws Exception {
         // Set up the Configuration
         XMLSecurityProperties properties = new XMLSecurityProperties();
-        XMLSecurityConstants.Action[] actions = 
-            new XMLSecurityConstants.Action[]{XMLSecurityConstants.ENCRYPT};
+        List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
+        actions.add(XMLSecurityConstants.ENCRYPT);
         properties.setActions(actions);
         
         // Set the key up
@@ -226,8 +228,8 @@ public class EncryptionCreationTest exte
     public void testStrongEncryption() throws Exception {
         // Set up the Configuration
         XMLSecurityProperties properties = new XMLSecurityProperties();
-        XMLSecurityConstants.Action[] actions = 
-            new XMLSecurityConstants.Action[]{XMLSecurityConstants.ENCRYPT};
+        List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
+        actions.add(XMLSecurityConstants.ENCRYPT);
         properties.setActions(actions);
         
         // Set the key up
@@ -283,8 +285,8 @@ public class EncryptionCreationTest exte
     public void testEncryptionMultipleElements() throws Exception {
         // Set up the Configuration
         XMLSecurityProperties properties = new XMLSecurityProperties();
-        XMLSecurityConstants.Action[] actions = 
-            new XMLSecurityConstants.Action[]{XMLSecurityConstants.ENCRYPT};
+        List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
+        actions.add(XMLSecurityConstants.ENCRYPT);
         properties.setActions(actions);
         
         // Set the key up
@@ -335,8 +337,8 @@ public class EncryptionCreationTest exte
     public void testAES128ElementAES192KWCipherUsingKEKOutbound() throws Exception {
         // Set up the Configuration
         XMLSecurityProperties properties = new XMLSecurityProperties();
-        XMLSecurityConstants.Action[] actions = 
-            new XMLSecurityConstants.Action[]{XMLSecurityConstants.ENCRYPT};
+        List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
+        actions.add(XMLSecurityConstants.ENCRYPT);
         properties.setActions(actions);
         
         // Set the key up
@@ -399,8 +401,8 @@ public class EncryptionCreationTest exte
     public void testAES256ElementRSAKWCipherUsingKEKOutbound() throws Exception {
         // Set up the Configuration
         XMLSecurityProperties properties = new XMLSecurityProperties();
-        XMLSecurityConstants.Action[] actions = 
-            new XMLSecurityConstants.Action[]{XMLSecurityConstants.ENCRYPT};
+        List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
+        actions.add(XMLSecurityConstants.ENCRYPT);
         properties.setActions(actions);
         
         // Set the key up
@@ -466,8 +468,8 @@ public class EncryptionCreationTest exte
     public void testAES192Element3DESKWCipher() throws Exception {
         // Set up the Configuration
         XMLSecurityProperties properties = new XMLSecurityProperties();
-        XMLSecurityConstants.Action[] actions = 
-            new XMLSecurityConstants.Action[]{XMLSecurityConstants.ENCRYPT};
+        List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
+        actions.add(XMLSecurityConstants.ENCRYPT);
         properties.setActions(actions);
         
         // Set the key up
@@ -528,8 +530,8 @@ public class EncryptionCreationTest exte
     public void testTripleDesElementCipher() throws Exception {
         // Set up the Configuration
         XMLSecurityProperties properties = new XMLSecurityProperties();
-        XMLSecurityConstants.Action[] actions = 
-            new XMLSecurityConstants.Action[]{XMLSecurityConstants.ENCRYPT};
+        List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
+        actions.add(XMLSecurityConstants.ENCRYPT);
         properties.setActions(actions);
         
         // Set the key up
@@ -587,8 +589,8 @@ public class EncryptionCreationTest exte
     public void testAes128ElementCipher() throws Exception {
         // Set up the Configuration
         XMLSecurityProperties properties = new XMLSecurityProperties();
-        XMLSecurityConstants.Action[] actions = 
-            new XMLSecurityConstants.Action[]{XMLSecurityConstants.ENCRYPT};
+        List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
+        actions.add(XMLSecurityConstants.ENCRYPT);
         properties.setActions(actions);
         
         // Set the key up
@@ -648,8 +650,8 @@ public class EncryptionCreationTest exte
     public void testAes192ElementCipher() throws Exception {
         // Set up the Configuration
         XMLSecurityProperties properties = new XMLSecurityProperties();
-        XMLSecurityConstants.Action[] actions = 
-            new XMLSecurityConstants.Action[]{XMLSecurityConstants.ENCRYPT};
+        List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
+        actions.add(XMLSecurityConstants.ENCRYPT);
         properties.setActions(actions);
         
         // Set the key up
@@ -711,8 +713,8 @@ public class EncryptionCreationTest exte
     public void testAes256ElementCipher() throws Exception {
         // Set up the Configuration
         XMLSecurityProperties properties = new XMLSecurityProperties();
-        XMLSecurityConstants.Action[] actions = 
-            new XMLSecurityConstants.Action[]{XMLSecurityConstants.ENCRYPT};
+        List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
+        actions.add(XMLSecurityConstants.ENCRYPT);
         properties.setActions(actions);
         
         // Set the key up
@@ -778,8 +780,8 @@ public class EncryptionCreationTest exte
     public void testTripleDesDocumentCipher() throws Exception {
         // Set up the Configuration
         XMLSecurityProperties properties = new XMLSecurityProperties();
-        XMLSecurityConstants.Action[] actions = 
-            new XMLSecurityConstants.Action[]{XMLSecurityConstants.ENCRYPT};
+        List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
+        actions.add(XMLSecurityConstants.ENCRYPT);
         properties.setActions(actions);
         
         // Set the key up
@@ -838,8 +840,8 @@ public class EncryptionCreationTest exte
     public void testPhysicalRepresentation1() throws Exception {
         // Set up the Configuration
         XMLSecurityProperties properties = new XMLSecurityProperties();
-        XMLSecurityConstants.Action[] actions = 
-            new XMLSecurityConstants.Action[]{XMLSecurityConstants.ENCRYPT};
+        List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
+        actions.add(XMLSecurityConstants.ENCRYPT);
         properties.setActions(actions);
         
         // Set the key up
@@ -898,8 +900,8 @@ public class EncryptionCreationTest exte
     public void testPhysicalRepresentation2() throws Exception {
         // Set up the Configuration
         XMLSecurityProperties properties = new XMLSecurityProperties();
-        XMLSecurityConstants.Action[] actions = 
-            new XMLSecurityConstants.Action[]{XMLSecurityConstants.ENCRYPT};
+        List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
+        actions.add(XMLSecurityConstants.ENCRYPT);
         properties.setActions(actions);
         
         // Set the key up
@@ -957,8 +959,8 @@ public class EncryptionCreationTest exte
     public void testTransportKey() throws Exception {
         // Set up the Configuration
         XMLSecurityProperties properties = new XMLSecurityProperties();
-        XMLSecurityConstants.Action[] actions = 
-            new XMLSecurityConstants.Action[]{XMLSecurityConstants.ENCRYPT};
+        List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
+        actions.add(XMLSecurityConstants.ENCRYPT);
         properties.setActions(actions);
         
         // Set the key up - only specify a transport key, so the session key gets generated

Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/encryption/XMLEncryption11Test.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/encryption/XMLEncryption11Test.java?rev=1548207&r1=1548206&r2=1548207&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/encryption/XMLEncryption11Test.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/encryption/XMLEncryption11Test.java Thu Dec  5 17:08:27 2013
@@ -29,7 +29,9 @@ import java.security.Provider;
 import java.security.Security;
 import java.security.cert.Certificate;
 import java.security.cert.X509Certificate;
+import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 import javax.crypto.BadPaddingException;
@@ -527,8 +529,8 @@ public class XMLEncryption11Test extends
 
         // Set up the Configuration
         XMLSecurityProperties properties = new XMLSecurityProperties();
-        XMLSecurityConstants.Action[] actions =
-                new XMLSecurityConstants.Action[]{XMLSecurityConstants.ENCRYPT};
+        List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
+        actions.add(XMLSecurityConstants.ENCRYPT);
         properties.setActions(actions);
 
         properties.setEncryptionTransportKey(encryptedKey);

Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/performance/AbstractPerformanceTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/performance/AbstractPerformanceTest.java?rev=1548207&r1=1548206&r2=1548207&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/performance/AbstractPerformanceTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/performance/AbstractPerformanceTest.java Thu Dec  5 17:08:27 2013
@@ -38,10 +38,13 @@ import javax.xml.stream.XMLInputFactory;
 import javax.xml.stream.XMLStreamConstants;
 import javax.xml.stream.XMLStreamReader;
 import javax.xml.stream.XMLStreamWriter;
+
 import java.io.*;
 import java.security.Key;
 import java.security.KeyStore;
 import java.security.cert.X509Certificate;
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * @author $Author: $
@@ -137,9 +140,8 @@ public abstract class AbstractPerformanc
 
     protected void setUpOutboundSignatureXMLSec() throws XMLSecurityException {
         XMLSecurityProperties xmlSecurityProperties = new XMLSecurityProperties();
-        XMLSecurityConstants.Action[] actions = new XMLSecurityConstants.Action[]{
-                XMLSecurityConstants.SIGNATURE
-        };
+        List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
+        actions.add(XMLSecurityConstants.SIGNATURE);
         xmlSecurityProperties.setActions(actions);
         xmlSecurityProperties.setSignatureKeyIdentifier(SecurityTokenConstants.KeyIdentifier_X509KeyIdentifier);
 
@@ -169,9 +171,8 @@ public abstract class AbstractPerformanc
 
     protected void setUpOutboundEncryptionXMLSec() throws XMLSecurityException {
         XMLSecurityProperties xmlSecurityProperties = new XMLSecurityProperties();
-        XMLSecurityConstants.Action[] actions = new XMLSecurityConstants.Action[]{
-                XMLSecurityConstants.ENCRYPT
-        };
+        List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
+        actions.add(XMLSecurityConstants.ENCRYPT);
         xmlSecurityProperties.setActions(actions);
         xmlSecurityProperties.setEncryptionKey(encryptionSymKey);
         xmlSecurityProperties.setEncryptionSymAlgorithm("http://www.w3.org/2001/04/xmlenc#aes256-cbc");

Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/signature/SignatureCreationReferenceURIResolverTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/signature/SignatureCreationReferenceURIResolverTest.java?rev=1548207&r1=1548206&r2=1548207&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/signature/SignatureCreationReferenceURIResolverTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/signature/SignatureCreationReferenceURIResolverTest.java Thu Dec  5 17:08:27 2013
@@ -27,6 +27,8 @@ import java.net.Proxy;
 import java.security.Key;
 import java.security.KeyStore;
 import java.security.cert.X509Certificate;
+import java.util.ArrayList;
+import java.util.List;
 
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamReader;
@@ -58,8 +60,8 @@ public class SignatureCreationReferenceU
     public void testSignatureCreationWithExternalFilesystemXMLReference() throws Exception {
         // Set up the Configuration
         XMLSecurityProperties properties = new XMLSecurityProperties();
-        XMLSecurityConstants.Action[] actions =
-                new XMLSecurityConstants.Action[]{XMLSecurityConstants.SIGNATURE};
+        List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
+        actions.add(XMLSecurityConstants.SIGNATURE);
         properties.setActions(actions);
 
         // Set the key up
@@ -107,8 +109,8 @@ public class SignatureCreationReferenceU
     public void testSignatureCreationWithExternalFilesystemBinaryReference() throws Exception {
         // Set up the Configuration
         XMLSecurityProperties properties = new XMLSecurityProperties();
-        XMLSecurityConstants.Action[] actions =
-                new XMLSecurityConstants.Action[]{XMLSecurityConstants.SIGNATURE};
+        List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
+        actions.add(XMLSecurityConstants.SIGNATURE);
         properties.setActions(actions);
 
         // Set the key up
@@ -166,8 +168,8 @@ public class SignatureCreationReferenceU
 
             // Set up the Configuration
             XMLSecurityProperties properties = new XMLSecurityProperties();
-            XMLSecurityConstants.Action[] actions =
-                    new XMLSecurityConstants.Action[]{XMLSecurityConstants.SIGNATURE};
+            List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
+            actions.add(XMLSecurityConstants.SIGNATURE);
             properties.setActions(actions);
 
             // Set the key up
@@ -214,8 +216,8 @@ public class SignatureCreationReferenceU
     public void testSignatureCreationWithSameDocumentXPointerIdApostropheReference() throws Exception {
         // Set up the Configuration
         XMLSecurityProperties properties = new XMLSecurityProperties();
-        XMLSecurityConstants.Action[] actions =
-                new XMLSecurityConstants.Action[]{XMLSecurityConstants.SIGNATURE};
+        List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
+        actions.add(XMLSecurityConstants.SIGNATURE);
         properties.setActions(actions);
 
         // Set the key up

Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/signature/SignatureCreationTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/signature/SignatureCreationTest.java?rev=1548207&r1=1548206&r2=1548207&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/signature/SignatureCreationTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/signature/SignatureCreationTest.java Thu Dec  5 17:08:27 2013
@@ -44,6 +44,8 @@ import java.security.Key;
 import java.security.KeyStore;
 import java.security.Security;
 import java.security.cert.X509Certificate;
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * A set of test-cases for Signature creation.
@@ -54,8 +56,8 @@ public class SignatureCreationTest exten
     public void testSignatureCreation() throws Exception {
         // Set up the Configuration
         XMLSecurityProperties properties = new XMLSecurityProperties();
-        XMLSecurityConstants.Action[] actions = 
-            new XMLSecurityConstants.Action[]{XMLSecurityConstants.SIGNATURE};
+        List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
+        actions.add(XMLSecurityConstants.SIGNATURE);
         properties.setActions(actions);
         
         // Set the key up
@@ -108,8 +110,8 @@ public class SignatureCreationTest exten
     public void testExceptionOnElementToSignNotFound() throws Exception {
         // Set up the Configuration
         XMLSecurityProperties properties = new XMLSecurityProperties();
-        XMLSecurityConstants.Action[] actions =
-                new XMLSecurityConstants.Action[]{XMLSecurityConstants.SIGNATURE};
+        List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
+        actions.add(XMLSecurityConstants.SIGNATURE);
         properties.setActions(actions);
 
         // Set the key up
@@ -150,8 +152,8 @@ public class SignatureCreationTest exten
     public void testEnvelopedSignatureCreation() throws Exception {
         // Set up the Configuration
         XMLSecurityProperties properties = new XMLSecurityProperties();
-        XMLSecurityConstants.Action[] actions =
-                new XMLSecurityConstants.Action[]{XMLSecurityConstants.SIGNATURE};
+        List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
+        actions.add(XMLSecurityConstants.SIGNATURE);
         properties.setActions(actions);
 
         // Set the key up
@@ -212,8 +214,8 @@ public class SignatureCreationTest exten
     public void testMultipleElements() throws Exception {
         // Set up the Configuration
         XMLSecurityProperties properties = new XMLSecurityProperties();
-        XMLSecurityConstants.Action[] actions = 
-            new XMLSecurityConstants.Action[]{XMLSecurityConstants.SIGNATURE};
+        List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
+        actions.add(XMLSecurityConstants.SIGNATURE);
         properties.setActions(actions);
         
         // Set the key up
@@ -258,8 +260,8 @@ public class SignatureCreationTest exten
     public void testHMACSignatureCreation() throws Exception {
         // Set up the Configuration
         XMLSecurityProperties properties = new XMLSecurityProperties();
-        XMLSecurityConstants.Action[] actions = 
-            new XMLSecurityConstants.Action[]{XMLSecurityConstants.SIGNATURE};
+        List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
+        actions.add(XMLSecurityConstants.SIGNATURE);
         properties.setActions(actions);
         
         // Set the key up
@@ -297,8 +299,8 @@ public class SignatureCreationTest exten
     public void testStrongSignatureCreation() throws Exception {
         // Set up the Configuration
         XMLSecurityProperties properties = new XMLSecurityProperties();
-        XMLSecurityConstants.Action[] actions = 
-            new XMLSecurityConstants.Action[]{XMLSecurityConstants.SIGNATURE};
+        List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
+        actions.add(XMLSecurityConstants.SIGNATURE);
         properties.setActions(actions);
 
         // Set the key up
@@ -348,8 +350,8 @@ public class SignatureCreationTest exten
         
         // Set up the Configuration
         XMLSecurityProperties properties = new XMLSecurityProperties();
-        XMLSecurityConstants.Action[] actions = 
-            new XMLSecurityConstants.Action[]{XMLSecurityConstants.SIGNATURE};
+        List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
+        actions.add(XMLSecurityConstants.SIGNATURE);
         properties.setActions(actions);
         
         // Set the key up
@@ -399,8 +401,8 @@ public class SignatureCreationTest exten
         
         // Set up the Configuration
         XMLSecurityProperties properties = new XMLSecurityProperties();
-        XMLSecurityConstants.Action[] actions = 
-            new XMLSecurityConstants.Action[]{XMLSecurityConstants.SIGNATURE};
+        List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
+        actions.add(XMLSecurityConstants.SIGNATURE);
         properties.setActions(actions);
         
         KeyStore keyStore = KeyStore.getInstance("jks");
@@ -446,8 +448,8 @@ public class SignatureCreationTest exten
     public void testDifferentC14nMethod() throws Exception {
         // Set up the Configuration
         XMLSecurityProperties properties = new XMLSecurityProperties();
-        XMLSecurityConstants.Action[] actions = 
-            new XMLSecurityConstants.Action[]{XMLSecurityConstants.SIGNATURE};
+        List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
+        actions.add(XMLSecurityConstants.SIGNATURE);
         properties.setActions(actions);
         
         // Set the key up
@@ -491,8 +493,8 @@ public class SignatureCreationTest exten
     public void testDifferentC14nMethodForReference() throws Exception {
         // Set up the Configuration
         XMLSecurityProperties properties = new XMLSecurityProperties();
-        XMLSecurityConstants.Action[] actions =
-                new XMLSecurityConstants.Action[]{XMLSecurityConstants.SIGNATURE};
+        List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
+        actions.add(XMLSecurityConstants.SIGNATURE);
         properties.setActions(actions);
 
         // Set the key up
@@ -557,8 +559,8 @@ public class SignatureCreationTest exten
     public void testDifferentDigestMethodForReference() throws Exception {
         // Set up the Configuration
         XMLSecurityProperties properties = new XMLSecurityProperties();
-        XMLSecurityConstants.Action[] actions =
-                new XMLSecurityConstants.Action[]{XMLSecurityConstants.SIGNATURE};
+        List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
+        actions.add(XMLSecurityConstants.SIGNATURE);
         properties.setActions(actions);
 
         // Set the key up
@@ -623,8 +625,8 @@ public class SignatureCreationTest exten
     public void testC14n11Method() throws Exception {
         // Set up the Configuration
         XMLSecurityProperties properties = new XMLSecurityProperties();
-        XMLSecurityConstants.Action[] actions = 
-            new XMLSecurityConstants.Action[]{XMLSecurityConstants.SIGNATURE};
+        List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
+        actions.add(XMLSecurityConstants.SIGNATURE);
         properties.setActions(actions);
         
         // Set the key up
@@ -668,8 +670,8 @@ public class SignatureCreationTest exten
     public void testExcC14nInclusivePrefixes() throws Exception {
         // Set up the Configuration
         XMLSecurityProperties properties = new XMLSecurityProperties();
-        XMLSecurityConstants.Action[] actions =
-                new XMLSecurityConstants.Action[]{XMLSecurityConstants.SIGNATURE};
+        List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
+        actions.add(XMLSecurityConstants.SIGNATURE);
         properties.setActions(actions);
 
         // Set the key up
@@ -719,8 +721,8 @@ public class SignatureCreationTest exten
     public void testSignatureCreationKeyValue() throws Exception {
         // Set up the Configuration
         XMLSecurityProperties properties = new XMLSecurityProperties();
-        XMLSecurityConstants.Action[] actions = 
-            new XMLSecurityConstants.Action[]{XMLSecurityConstants.SIGNATURE};
+        List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
+        actions.add(XMLSecurityConstants.SIGNATURE);
         properties.setActions(actions);
         properties.setSignatureKeyIdentifier(SecurityTokenConstants.KeyIdentifier_KeyValue);
         
@@ -763,8 +765,8 @@ public class SignatureCreationTest exten
     public void testSignatureCreationSKI() throws Exception {
         // Set up the Configuration
         XMLSecurityProperties properties = new XMLSecurityProperties();
-        XMLSecurityConstants.Action[] actions = 
-            new XMLSecurityConstants.Action[]{XMLSecurityConstants.SIGNATURE};
+        List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
+        actions.add(XMLSecurityConstants.SIGNATURE);
         properties.setActions(actions);
         properties.setSignatureKeyIdentifier(SecurityTokenConstants.KeyIdentifier_SkiKeyIdentifier);
         properties.setSignatureAlgorithm("http://www.w3.org/2000/09/xmldsig#rsa-sha1");
@@ -808,8 +810,8 @@ public class SignatureCreationTest exten
     public void testSignatureCreationX509Certificate() throws Exception {
         // Set up the Configuration
         XMLSecurityProperties properties = new XMLSecurityProperties();
-        XMLSecurityConstants.Action[] actions = 
-            new XMLSecurityConstants.Action[]{XMLSecurityConstants.SIGNATURE};
+        List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
+        actions.add(XMLSecurityConstants.SIGNATURE);
         properties.setActions(actions);
         properties.setSignatureKeyIdentifier(SecurityTokenConstants.KeyIdentifier_X509KeyIdentifier);
         
@@ -852,8 +854,8 @@ public class SignatureCreationTest exten
     public void testSignatureCreationX509SubjectName() throws Exception {
         // Set up the Configuration
         XMLSecurityProperties properties = new XMLSecurityProperties();
-        XMLSecurityConstants.Action[] actions = 
-            new XMLSecurityConstants.Action[]{XMLSecurityConstants.SIGNATURE};
+        List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
+        actions.add(XMLSecurityConstants.SIGNATURE);
         properties.setActions(actions);
         properties.setSignatureKeyIdentifier(SecurityTokenConstants.KeyIdentifier_X509SubjectName);
         
@@ -896,8 +898,8 @@ public class SignatureCreationTest exten
     public void testSignatureCreationTransformBase64() throws Exception {
         // Set up the Configuration
         XMLSecurityProperties properties = new XMLSecurityProperties();
-        XMLSecurityConstants.Action[] actions =
-                new XMLSecurityConstants.Action[]{XMLSecurityConstants.SIGNATURE};
+        List<XMLSecurityConstants.Action> actions = new ArrayList<XMLSecurityConstants.Action>();
+        actions.add(XMLSecurityConstants.SIGNATURE);
         properties.setActions(actions);
 
         // Set the key up