[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
Thu Apr 17 00:02:47 EDT 2014
Author: tzeller
Date: Thu Apr 17 00:02:43 2014
New Revision: 5738
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=5738&view=rev
Log:
OSJ-69 Instead of the JDK provided base64 decoder, use java-support's.
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=5738&r1=5737&r2=5738&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 Thu Apr 17 00:02:43 2014
@@ -20,14 +20,13 @@
import java.util.Collection;
import java.util.List;
-import javax.xml.bind.DatatypeConverter;
-
import net.shibboleth.idp.attribute.AttributeEncodingException;
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.codec.Base64Support;
import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
import org.opensaml.core.OpenSAMLInitBaseTestCase;
@@ -113,7 +112,7 @@
XSString childAsString = (XSString) child;
- byte childAsBa[] = DatatypeConverter.parseBase64Binary(childAsString.getValue());
+ byte childAsBa[] = Base64Support.decode(childAsString.getValue());
Assert.assertEquals(childAsBa, BYTE_ARRAY_1, "Input equals output");
}
@@ -142,13 +141,13 @@
XSString childAsString = (XSString) child;
Assert.assertEquals(child.getElementQName(), AttributeValue.DEFAULT_ELEMENT_NAME,
"Attribute Value not inside <AttributeValue/>");
- final byte[] res0 = DatatypeConverter.parseBase64Binary(childAsString.getValue());
+ final byte[] res0 = Base64Support.decode(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 = DatatypeConverter.parseBase64Binary(childAsString.getValue());
+ final byte[] res1 = Base64Support.decode(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=5738&r1=5737&r2=5738&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 Thu Apr 17 00:02:43 2014
@@ -20,14 +20,13 @@
import java.util.Collection;
import java.util.List;
-import javax.xml.bind.DatatypeConverter;
-
import net.shibboleth.idp.attribute.AttributeEncodingException;
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.codec.Base64Support;
import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
import org.opensaml.core.OpenSAMLInitBaseTestCase;
@@ -109,7 +108,7 @@
XSString childAsString = (XSString) child;
- byte childAsBa[] = DatatypeConverter.parseBase64Binary(childAsString.getValue());
+ byte childAsBa[] = Base64Support.decode(childAsString.getValue());
Assert.assertEquals(childAsBa, BYTE_ARRAY_1, "Input equals output");
}
@@ -136,13 +135,13 @@
XSString childAsString = (XSString) child;
Assert.assertEquals(child.getElementQName(), AttributeValue.DEFAULT_ELEMENT_NAME,
"Attribute Value not inside <AttributeValue/>");
- final byte[] res0 = DatatypeConverter.parseBase64Binary(childAsString.getValue());
[... 12 lines stripped ...]
More information about the commits
mailing list