Temporarily add OpenSAML init code to trust tests.
authorwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Fri, 28 Jul 2006 22:43:18 +0000 (22:43 +0000)
committerwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Fri, 28 Jul 2006 22:43:18 +0000 (22:43 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@1983 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

tests/edu/internet2/middleware/shibboleth/common/TrustTests.java

index 12a4a8b..31521a3 100644 (file)
@@ -23,6 +23,8 @@ import junit.framework.TestCase;
 import org.apache.log4j.BasicConfigurator;
 import org.apache.log4j.Level;
 import org.apache.log4j.Logger;
+import org.opensaml.common.SAMLObjectTestCaseConfigInitializer;
+import org.opensaml.common.xml.ParserPoolManager;
 import org.opensaml.saml2.metadata.EntityDescriptor;
 import org.opensaml.saml2.metadata.SPSSODescriptor;
 import org.opensaml.saml2.metadata.provider.FilesystemMetadataProvider;
@@ -31,6 +33,8 @@ import org.opensaml.saml2.metadata.provider.MetadataProviderException;
 import org.opensaml.security.TrustEngine;
 import org.opensaml.security.X509EntityCredential;
 import org.opensaml.security.impl.SimpleX509EntityCredential;
+import org.opensaml.xml.Configuration;
+import org.w3c.dom.Document;
 
 import edu.internet2.middleware.shibboleth.common.ShibResource.ResourceNotAvailableException;
 import edu.internet2.middleware.shibboleth.common.provider.ShibbolethTrustEngine;
@@ -60,6 +64,36 @@ public class TrustTests extends TestCase {
        protected void setUp() throws Exception {
 
                super.setUp();
+
+               // TODO delete this stuff when the library can do default initialization
+
+               Class clazz = SAMLObjectTestCaseConfigInitializer.class;
+               ParserPoolManager ppMgr = ParserPoolManager.getInstance();
+
+               // Common Object Provider Configuration
+               Document commonConfig = ppMgr.parse(clazz.getResourceAsStream("/common-config.xml"));
+               Configuration.load(commonConfig);
+
+               // SAML 1.X Assertion Object Provider Configuration
+               Document saml1AssertionConfig = ppMgr.parse(clazz.getResourceAsStream("/saml1-assertion-config.xml"));
+               Configuration.load(saml1AssertionConfig);
+
+               // SAML 1.X Protocol Object Provider Configuration
+               Document saml1ProtocolConfig = ppMgr.parse(clazz.getResourceAsStream("/saml1-protocol-config.xml"));
+               Configuration.load(saml1ProtocolConfig);
+
+               // SAML 2.0 Metadata Object Provider Configuration
+               Document saml2mdConfig = ppMgr.parse(clazz.getResourceAsStream("/saml2-metadata-config.xml"));
+               Configuration.load(saml2mdConfig);
+
+               // SAML 2.0 Assertion Object Provider Configuration
+               Document saml2assertionConfig = ppMgr.parse(clazz.getResourceAsStream("/saml2-assertion-config.xml"));
+               Configuration.load(saml2assertionConfig);
+
+               // SAML 2.0 Protocol Object Provider Configuration
+               Document saml2protocolConfig = ppMgr.parse(clazz.getResourceAsStream("/saml2-protocol-config.xml"));
+               Configuration.load(saml2protocolConfig);
+
        }
 
        public void testInlineX509CertValidate() {