[java-identity-provider COMMIT] in /trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/attribute/encoding...
noreply at shibboleth.net
noreply at shibboleth.net
Thu Apr 19 14:59:55 BST 2012
Author: rdw
Date: Thu Apr 19 14:59:55 2012
New Revision: 4179
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=4179&view=rev
Log:
OSJ-15 Do not call InitializeServer.Initialize() instead rely on an inherited class (and make sure we also respect group ordering if we have our own @BeforeSuite()
Modified:
trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/attribute/encoding/Saml1ByteAttributeEncoderTest.java
trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/attribute/encoding/Saml1StringAttributeEncoderTest.java
trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/attribute/encoding/Saml1XmlObjectAttributeEncoderTest.java
trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/attribute/encoding/Saml1XmlObjectSubjectNameIdentifierEncoderTest.java
trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/attribute/encoding/Saml2ByteAttributeEncoderTest.java
trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/attribute/encoding/Saml2StringAttributeEncoderTest.java
trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/attribute/encoding/Saml2XmlObjectAttributeEncoderTest.java
trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/attribute/encoding/Saml2XmlObjectSubjectNameIDEncoderTest.java
Modified: trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/attribute/encoding/Saml1ByteAttributeEncoderTest.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/attribute/encoding/Saml1ByteAttributeEncoderTest.java?rev=4179&r1=4178&r2=4179&view=diff
==============================================================================
--- trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/attribute/encoding/Saml1ByteAttributeEncoderTest.java (original)
+++ trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/attribute/encoding/Saml1ByteAttributeEncoderTest.java Thu Apr 19 14:59:55 2012
@@ -24,9 +24,9 @@
import net.shibboleth.idp.attribute.ByteAttributeValue;
import net.shibboleth.idp.attribute.ScopedStringAttributeValue;
import net.shibboleth.idp.attribute.StringAttributeValue;
+import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
-import org.opensaml.core.config.InitializationException;
-import org.opensaml.core.config.InitializationService;
+import org.opensaml.core.OpenSAMLInitBaseTestCase;
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.schema.XSString;
import org.opensaml.saml.saml1.core.Attribute;
@@ -42,7 +42,7 @@
*
* Identical code to the {@link Saml1ByteAttributeEncoder} except that the type of assertion and encoder is changed.
*/
-public class Saml1ByteAttributeEncoderTest {
+public class Saml1ByteAttributeEncoderTest extends OpenSAMLInitBaseTestCase {
/** The name we give the test attribute. */
private final static String ATTR_NAME = "foo";
@@ -52,13 +52,17 @@
/** A second test value. */
private final static byte[] BYTE_ARRAY_2 = {4, 3, 2, 1};
-
- @BeforeSuite() public void initOpenSAML() throws InitializationException {
- InitializationService.initialize();
+
+ private Saml1ByteAttributeEncoder encoder;
+
+ @BeforeSuite(dependsOnGroups={"opensaml.init"}) public void initTest() throws ComponentInitializationException {
+ encoder = new Saml1ByteAttributeEncoder();
+ encoder.setName(ATTR_NAME);
+ encoder.setNamespace("NameSpace");
+ encoder.initialize();
}
-
+
@Test public void testEmpty() throws Exception {
- final Saml1ByteAttributeEncoder encoder = new Saml1ByteAttributeEncoder();
final net.shibboleth.idp.attribute.Attribute inputAttribute;
inputAttribute = new net.shibboleth.idp.attribute.Attribute(ATTR_NAME);
@@ -69,7 +73,6 @@
}
@Test public void testInappropriate() throws Exception {
- final Saml1ByteAttributeEncoder encoder = new Saml1ByteAttributeEncoder();
final int[] intArray = {1, 2, 3, 4};
final Collection<AttributeValue> values =
Lists.newArrayList((AttributeValue) new StringAttributeValue("foo"), new ScopedStringAttributeValue(
@@ -88,7 +91,6 @@
}
@Test public void testSingle() throws Exception {
- final Saml1ByteAttributeEncoder encoder = new Saml1ByteAttributeEncoder();
final Collection<AttributeValue> values = Lists.newArrayList((AttributeValue) new StringAttributeValue("foo"), new ByteAttributeValue(BYTE_ARRAY_1));
final net.shibboleth.idp.attribute.Attribute inputAttribute;
@@ -117,7 +119,6 @@
}
@Test public void testMulti() throws Exception {
- final Saml1ByteAttributeEncoder encoder = new Saml1ByteAttributeEncoder();
final Collection<AttributeValue> values = Lists.newArrayList((AttributeValue) new ByteAttributeValue(BYTE_ARRAY_1), new ByteAttributeValue(BYTE_ARRAY_2));
final net.shibboleth.idp.attribute.Attribute inputAttribute;
[... 562 lines stripped ...]
More information about the commits
mailing list