[java-identity-provider COMMIT] in /trunk/idp-conf/src/test/java/net/shibboleth/idp/test: TestEnvironmentApplicationC...
noreply at shibboleth.net
noreply at shibboleth.net
Mon Nov 9 17:17:08 EST 2015
Author: tzeller
Date: Mon Nov 9 17:17:08 2015
New Revision: 7975
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=7975&view=rev
Log:
IDP-812 - Move test properties from static block to an app ctx initializer.
Added:
trunk/idp-conf/src/test/java/net/shibboleth/idp/test/TestEnvironmentApplicationContextInitializer.java (with props)
Modified:
trunk/idp-conf/src/test/java/net/shibboleth/idp/test/flows/AbstractFlowTest.java
trunk/idp-conf/src/test/java/net/shibboleth/idp/test/flows/paths/IdPPropertiesApplicationContextInitializerTest.java
Modified: trunk/idp-conf/src/test/java/net/shibboleth/idp/test/flows/AbstractFlowTest.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-conf/src/test/java/net/shibboleth/idp/test/flows/AbstractFlowTest.java?rev=7975&r1=7974&r2=7975&view=diff
==============================================================================
--- trunk/idp-conf/src/test/java/net/shibboleth/idp/test/flows/AbstractFlowTest.java (original)
+++ trunk/idp-conf/src/test/java/net/shibboleth/idp/test/flows/AbstractFlowTest.java Mon Nov 9 17:17:08 2015
@@ -29,6 +29,7 @@
import net.shibboleth.idp.test.InMemoryDirectory;
import net.shibboleth.idp.test.PreferFileSystemApplicationContextInitializer;
import net.shibboleth.idp.test.PreferFileSystemContextLoader;
+import net.shibboleth.idp.test.TestEnvironmentApplicationContextInitializer;
import net.shibboleth.utilities.java.support.annotation.constraint.NonnullAfterInit;
import net.shibboleth.utilities.java.support.logic.Constraint;
import net.shibboleth.utilities.java.support.net.HttpServletRequestResponseContext;
@@ -87,9 +88,17 @@
/**
* Abstract flow test.
*/
- at ContextConfiguration(locations = {"/system/conf/global-system.xml", "/system/conf/mvc-beans.xml",
- "/system/conf/webflow-config.xml", "/test/test-beans.xml", "/test/override-beans.xml",}, initializers = {
- PreferFileSystemApplicationContextInitializer.class, IdPPropertiesApplicationContextInitializer.class},
+ at ContextConfiguration(
+ locations = {
+ "/system/conf/global-system.xml",
+ "/system/conf/mvc-beans.xml",
+ "/system/conf/webflow-config.xml",
+ "/test/test-beans.xml",
+ "/test/override-beans.xml",},
+ initializers = {
+ TestEnvironmentApplicationContextInitializer.class,
+ PreferFileSystemApplicationContextInitializer.class,
+ IdPPropertiesApplicationContextInitializer.class},
loader = PreferFileSystemContextLoader.class)
@WebAppConfiguration
public abstract class AbstractFlowTest extends AbstractTestNGSpringContextTests {
@@ -176,26 +185,6 @@
/** SP certificate wired via test/test-beans.xml. */
@Autowired @Qualifier("test.sp.X509Certificate") protected X509CertificateFactoryBean certFactoryBean;
- static {
- setIdPHomeProperty();
- setAuthnFlowsProperty();
- }
-
- /**
- * Set the 'idp.home' property to "classpath:".
- */
- public static void setIdPHomeProperty() {
- System.setProperty("idp.home", "classpath:");
- System.setProperty("idp.webflows", "classpath*:/flows");
- }
-
- /**
- * Sets the 'idp.authn.flows' property to "Password".
- */
- public static void setAuthnFlowsProperty() {
- System.setProperty("idp.authn.flows", "Password");
- }
-
/**
* {@link HttpServletRequestResponseContext#clearCurrent()}
*/
Modified: trunk/idp-conf/src/test/java/net/shibboleth/idp/test/flows/paths/IdPPropertiesApplicationContextInitializerTest.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-conf/src/test/java/net/shibboleth/idp/test/flows/paths/IdPPropertiesApplicationContextInitializerTest.java?rev=7975&r1=7974&r2=7975&view=diff
==============================================================================
--- trunk/idp-conf/src/test/java/net/shibboleth/idp/test/flows/paths/IdPPropertiesApplicationContextInitializerTest.java (original)
+++ trunk/idp-conf/src/test/java/net/shibboleth/idp/test/flows/paths/IdPPropertiesApplicationContextInitializerTest.java Mon Nov 9 17:17:08 2015
@@ -44,7 +44,6 @@
WebApplicationContextUtils.getRequiredWebApplicationContext(sc);
}
- /*
@Test(expectedExceptions = ConstraintViolationException.class) public void testNotFound() {
final MockServletContext sc = new MockServletContext("");
sc.addInitParameter(ContextLoader.CONFIG_LOCATION_PARAM, "classpath:/system/conf/global-system.xml");
@@ -54,7 +53,6 @@
listener.contextInitialized(new ServletContextEvent(sc));
WebApplicationContextUtils.getRequiredWebApplicationContext(sc);
}
- */
@Test(expectedExceptions = ConstraintViolationException.class) public void testUserDefinedNotFound() {
final MockServletContext sc = new MockServletContext("");
More information about the commits
mailing list