[java-idp-testbed COMMIT] in /trunk/src/test/java/idp/c14n: TestC14N.java TestLegacyC14N.java

noreply at shibboleth.net noreply at shibboleth.net
Sat Feb 22 06:50:40 EST 2014


Author: rdw
Date: Sat Feb 22 06:50:40 2014
New Revision: 157

URL: http://svn.shibboleth.net/view/java-idp-testbed?rev=157&view=rev
Log:
IdP 359  Be slightly smarter about the setting of system properties.

Modified:
    trunk/src/test/java/idp/c14n/TestC14N.java
    trunk/src/test/java/idp/c14n/TestLegacyC14N.java

Modified: trunk/src/test/java/idp/c14n/TestC14N.java
URL: http://svn.shibboleth.net/view/java-idp-testbed/trunk/src/test/java/idp/c14n/TestC14N.java?rev=157&r1=156&r2=157&view=diff
==============================================================================
--- trunk/src/test/java/idp/c14n/TestC14N.java (original)
+++ trunk/src/test/java/idp/c14n/TestC14N.java Sat Feb 22 06:50:40 2014
@@ -21,12 +21,14 @@
 
 import javax.annotation.Nonnull;
 
+import org.junit.AfterClass;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.test.context.ContextConfiguration;
 import org.springframework.webflow.execution.FlowExecutionOutcome;
 import org.springframework.webflow.executor.FlowExecutionResult;
 import org.testng.Assert;
+import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 
 /**
@@ -35,12 +37,17 @@
 @ContextConfiguration({"classpath:/c14n/test-webflow-config.xml", "classpath:/c14n/locate-resolver.xml"})
 public class TestC14N extends AbstractFlowTest {
     
-    static {
+    /** Class logger. */
+    @Nonnull private final Logger log = LoggerFactory.getLogger(TestC14N.class);
+
+    @BeforeClass public void setPerClassProperties() {
         System.setProperty("idp.c14n.flows", "SAML2.*|Simple|Legacy.*|SAML1.*");
     }
-
-    /** Class logger. */
-    @Nonnull private final Logger log = LoggerFactory.getLogger(TestC14N.class);
+    
+    @AfterClass public void resetPerClassProperties() {
+        // Taken from idp.properties
+        System.setProperty("idp.c14n.flows", "Simple");
+    }
 
     @Test public void testTransientNameID() {
 

Modified: trunk/src/test/java/idp/c14n/TestLegacyC14N.java
URL: http://svn.shibboleth.net/view/java-idp-testbed/trunk/src/test/java/idp/c14n/TestLegacyC14N.java?rev=157&r1=156&r2=157&view=diff
==============================================================================
--- trunk/src/test/java/idp/c14n/TestLegacyC14N.java (original)
+++ trunk/src/test/java/idp/c14n/TestLegacyC14N.java Sat Feb 22 06:50:40 2014
@@ -21,12 +21,14 @@
 
 import javax.annotation.Nonnull;
 
+import org.junit.AfterClass;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.test.context.ContextConfiguration;
 import org.springframework.webflow.execution.FlowExecutionOutcome;
 import org.springframework.webflow.executor.FlowExecutionResult;
 import org.testng.Assert;
+import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 
 /**
@@ -35,8 +37,12 @@
 @ContextConfiguration({"classpath:/c14n/test-webflow-config.xml", "classpath:/c14n/locate-legacy-resolver.xml"})
 public class TestLegacyC14N extends AbstractFlowTest {
     
-    static {
-        System.setProperty("idp.c14n.flows", "SAML2.*|Simple|Legacy.*");
+    @BeforeClass public void setPerClassProperties() {
+        System.setProperty("idp.c14n.flows", "Simple|Legacy.*");
+    }
+    
+    @AfterClass public void resetPerClassProperties() {
+        System.setProperty("idp.c14n.flows", "Simple");
     }
 
     /** Class logger. */



More information about the commits mailing list