[java-idp-testbed COMMIT] in /trunk/src/test/java/idp: AbstractFlowTest.java AbstractSAML1FlowTest.java saml1/SAML1At...

noreply at shibboleth.net noreply at shibboleth.net
Tue Apr 8 13:36:16 EDT 2014


Author: tzeller
Date: Tue Apr  8 13:36:15 2014
New Revision: 178

URL: http://svn.shibboleth.net/view/java-idp-testbed?rev=178&view=rev
Log:
Merge common code from the SAML 1 AttributQuery and SSO tests into parent classes.

Added:
    trunk/src/test/java/idp/AbstractSAML1FlowTest.java   (with props)
Modified:
    trunk/src/test/java/idp/AbstractFlowTest.java
    trunk/src/test/java/idp/saml1/SAML1AttributeQueryTest.java
    trunk/src/test/java/idp/saml1/SAML1UnsolicitedFlowTest.java

Modified: trunk/src/test/java/idp/AbstractFlowTest.java
URL: http://svn.shibboleth.net/view/java-idp-testbed/trunk/src/test/java/idp/AbstractFlowTest.java?rev=178&r1=177&r2=178&view=diff
==============================================================================
--- trunk/src/test/java/idp/AbstractFlowTest.java (original)
+++ trunk/src/test/java/idp/AbstractFlowTest.java Tue Apr  8 13:36:15 2014
@@ -18,11 +18,19 @@
 package idp;
 
 import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import net.shibboleth.utilities.java.support.annotation.constraint.NonnullAfterInit;
 import net.shibboleth.utilities.java.support.net.HttpServletRequestResponseContext;
-
+import net.shibboleth.utilities.java.support.xml.ParserPool;
+
+import org.opensaml.core.xml.XMLObjectBuilderFactory;
+import org.opensaml.core.xml.config.XMLObjectProviderRegistrySupport;
+import org.opensaml.core.xml.io.MarshallerFactory;
+import org.opensaml.core.xml.io.UnmarshallerFactory;
+import org.opensaml.profile.context.ProfileRequestContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.mock.web.MockHttpServletRequest;
@@ -31,15 +39,19 @@
 import org.springframework.test.context.ContextConfiguration;
 import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
 import org.springframework.test.context.web.WebAppConfiguration;
+import org.springframework.webflow.execution.FlowExecutionOutcome;
+import org.springframework.webflow.executor.FlowExecutionResult;
 import org.springframework.webflow.executor.FlowExecutor;
 import org.springframework.webflow.test.MockExternalContext;
 import org.testng.Assert;
 import org.testng.annotations.AfterMethod;
 import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeClass;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.BeforeTest;
 
 import com.unboundid.ldap.sdk.LDAPException;
+
 import common.InMemoryDirectory;
 import common.PathPropertySupport;
 
@@ -57,12 +69,24 @@
 
     /** Path to LDIF file to be imported into directory server. */
     @Nonnull public final static String LDIF_FILE = "src/main/resources/test/ldap.ldif";
+
+    /** Name of flow output attribute containing the profile request context. */
+    @Nonnull public final static String OUTPUT_ATTR_NAME = "ProfileRequestContext";
+
+    /** The IDP entity ID. */
+    @Nonnull public final static String IDP_ENTITY_ID = "https://idp.example.org";
     
-    /** Name of flow output attribute containing the profile request context. */
-    public final static String OUTPUT_ATTR_NAME = "ProfileRequestContext";
+    /** The SP entity ID. */
+    @Nonnull public final static String SP_ENTITY_ID = "https://sp.example.org";
+
+    /** The SP ACS URL. */
+    @Nonnull public final static String SP_ACS_URL = "https://sp.example.org/SAML1/POST/ACS";
+
+    /** The SP relay state. */
+    @Nonnull public final static String SP_RELAY_STATE = "myRelayState";
 
     /** In-memory directory server. */
-    @Nonnull protected InMemoryDirectory directoryServer;
+    @NonnullAfterInit protected InMemoryDirectory directoryServer;
 
     /** Mock external context. */
     @Nonnull protected MockExternalContext externalContext;
@@ -75,6 +99,18 @@
 
     /** Mock response. */
     @Nonnull protected MockHttpServletResponse response;
+
+    /** Parser pool */
+    @NonnullAfterInit protected static ParserPool parserPool;
+
+    /** XMLObject builder factory */
+    @NonnullAfterInit protected static XMLObjectBuilderFactory builderFactory;
+
+    /** XMLObject marshaller factory */
+    @NonnullAfterInit protected static MarshallerFactory marshallerFactory;
+
+    /** XMLObject unmarshaller factory */
+    @NonnullAfterInit protected static UnmarshallerFactory unmarshallerFactory;
 
     static {
         PathPropertySupport.setupIdPHomeProperty();
@@ -115,6 +151,16 @@
     }
 
     /**
+     * Initialize XMLObject support classes.
+     */
+    @BeforeClass public void initializeXMLObjectSupport() {
+        parserPool = XMLObjectProviderRegistrySupport.getParserPool();
+        builderFactory = XMLObjectProviderRegistrySupport.getBuilderFactory();
+        marshallerFactory = XMLObjectProviderRegistrySupport.getMarshallerFactory();
+        unmarshallerFactory = XMLObjectProviderRegistrySupport.getUnmarshallerFactory();
+    }
+
+    /**
      * Creates an UnboundID in-memory directory server. Leverages LDIF found at {@value #LDIF_FILE}.
      * 

[... 542 lines stripped ...]


More information about the commits mailing list