[java-identity-provider COMMIT] in /trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/attribute/encoding/impl...

noreply at shibboleth.net noreply at shibboleth.net
Wed Apr 16 17:17:15 EDT 2014


Author: tzeller
Date: Wed Apr 16 17:17:14 2014
New Revision: 5732

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=5732&view=rev
Log:
OSJ-69 Replace the OWASP base64 decoder used in tests with a JDK provided base64 decoder.

Modified:
    trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/attribute/encoding/impl/SAML1ByteAttributeEncoderTest.java
    trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/attribute/encoding/impl/SAML2ByteAttributeEncoderTest.java

Modified: trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/attribute/encoding/impl/SAML1ByteAttributeEncoderTest.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/attribute/encoding/impl/SAML1ByteAttributeEncoderTest.java?rev=5732&r1=5731&r2=5732&view=diff
==============================================================================
--- trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/attribute/encoding/impl/SAML1ByteAttributeEncoderTest.java (original)
+++ trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/attribute/encoding/impl/SAML1ByteAttributeEncoderTest.java Wed Apr 16 17:17:14 2014
@@ -20,10 +20,12 @@
 import java.util.Collection;
 import java.util.List;
 
+import javax.xml.bind.DatatypeConverter;
+
 import net.shibboleth.idp.attribute.AttributeEncodingException;
-import net.shibboleth.idp.attribute.IdPAttributeValue;
 import net.shibboleth.idp.attribute.ByteAttributeValue;
 import net.shibboleth.idp.attribute.IdPAttribute;
+import net.shibboleth.idp.attribute.IdPAttributeValue;
 import net.shibboleth.idp.attribute.ScopedStringAttributeValue;
 import net.shibboleth.idp.attribute.StringAttributeValue;
 import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
@@ -33,7 +35,6 @@
 import org.opensaml.core.xml.schema.XSString;
 import org.opensaml.saml.saml1.core.Attribute;
 import org.opensaml.saml.saml1.core.AttributeValue;
-import org.owasp.esapi.codecs.Base64;
 import org.testng.Assert;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
@@ -112,7 +113,7 @@
 
         XSString childAsString = (XSString) child;
 
-        byte childAsBa[] = Base64.decode(childAsString.getValue());
+        byte childAsBa[] = DatatypeConverter.parseBase64Binary(childAsString.getValue());
 
         Assert.assertEquals(childAsBa, BYTE_ARRAY_1, "Input equals output");
     }
@@ -141,13 +142,13 @@
         XSString childAsString = (XSString) child;
         Assert.assertEquals(child.getElementQName(), AttributeValue.DEFAULT_ELEMENT_NAME,
                 "Attribute Value not inside <AttributeValue/>");
-        final byte[] res0 = Base64.decode(childAsString.getValue());
+        final byte[] res0 = DatatypeConverter.parseBase64Binary(childAsString.getValue());
 
         child = children.get(1);
         Assert.assertTrue(child instanceof XSString, "Child of result attribute should be a string");
 
         childAsString = (XSString) child;
-        final byte[] res1 = Base64.decode(childAsString.getValue());
+        final byte[] res1 = DatatypeConverter.parseBase64Binary(childAsString.getValue());
 
         //
         // order of results is not guaranteed so sense the result from the length

Modified: trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/attribute/encoding/impl/SAML2ByteAttributeEncoderTest.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/attribute/encoding/impl/SAML2ByteAttributeEncoderTest.java?rev=5732&r1=5731&r2=5732&view=diff
==============================================================================
--- trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/attribute/encoding/impl/SAML2ByteAttributeEncoderTest.java (original)
+++ trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/attribute/encoding/impl/SAML2ByteAttributeEncoderTest.java Wed Apr 16 17:17:14 2014
@@ -20,10 +20,12 @@
 import java.util.Collection;
 import java.util.List;
 
+import javax.xml.bind.DatatypeConverter;
+
 import net.shibboleth.idp.attribute.AttributeEncodingException;
-import net.shibboleth.idp.attribute.IdPAttributeValue;
 import net.shibboleth.idp.attribute.ByteAttributeValue;
 import net.shibboleth.idp.attribute.IdPAttribute;
+import net.shibboleth.idp.attribute.IdPAttributeValue;
 import net.shibboleth.idp.attribute.ScopedStringAttributeValue;
 import net.shibboleth.idp.attribute.StringAttributeValue;
 import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
@@ -33,7 +35,6 @@
 import org.opensaml.core.xml.schema.XSString;
 import org.opensaml.saml.saml2.core.Attribute;
 import org.opensaml.saml.saml2.core.AttributeValue;
-import org.owasp.esapi.codecs.Base64;
 import org.testng.Assert;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
@@ -108,7 +109,7 @@
 
         XSString childAsString = (XSString) child;
 
-        byte childAsBa[] = Base64.decode(childAsString.getValue());

[... 22 lines stripped ...]


More information about the commits mailing list