[java-opensaml COMMIT] in /trunk/opensaml-saml-impl/src: main/java/org/opensaml/saml/common/profile/impl/AddNotBefore...

noreply at shibboleth.net noreply at shibboleth.net
Wed Mar 5 21:57:26 EST 2014


Author: scantor
Date: Wed Mar  5 21:57:26 2014
New Revision: 3677

URL: http://svn.shibboleth.net/view/java-opensaml?rev=3677&view=rev
Log:
IDP-145 - create dual version action

Added:
    trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/common/profile/impl/AddNotBeforeConditionToAssertions.java   (with props)
    trunk/opensaml-saml-impl/src/test/java/org/opensaml/saml/common/profile/impl/AddNotBeforeConditionToAssertionsTest.java
      - copied, changed from r3665, trunk/opensaml-saml-impl/src/test/java/org/opensaml/saml/saml1/profile/impl/AddNotBeforeConditionToAssertionsTest.java
Modified:
    trunk/opensaml-saml-impl/src/test/java/org/opensaml/saml/saml1/profile/impl/AddNotBeforeConditionToAssertionsTest.java

Copied: trunk/opensaml-saml-impl/src/test/java/org/opensaml/saml/common/profile/impl/AddNotBeforeConditionToAssertionsTest.java (from r3665, trunk/opensaml-saml-impl/src/test/java/org/opensaml/saml/saml1/profile/impl/AddNotBeforeConditionToAssertionsTest.java)
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-saml-impl/src/test/java/org/opensaml/saml/common/profile/impl/AddNotBeforeConditionToAssertionsTest.java?p2=trunk/opensaml-saml-impl/src/test/java/org/opensaml/saml/common/profile/impl/AddNotBeforeConditionToAssertionsTest.java&p1=trunk/opensaml-saml-impl/src/test/java/org/opensaml/saml/saml1/profile/impl/AddNotBeforeConditionToAssertionsTest.java&r1=3665&r2=3677&rev=3677&view=diff
==============================================================================
--- trunk/opensaml-saml-impl/src/test/java/org/opensaml/saml/saml1/profile/impl/AddNotBeforeConditionToAssertionsTest.java (original)
+++ trunk/opensaml-saml-impl/src/test/java/org/opensaml/saml/common/profile/impl/AddNotBeforeConditionToAssertionsTest.java Wed Mar  5 21:57:26 2014
@@ -15,10 +15,13 @@
  * limitations under the License.
  */
 
-package org.opensaml.saml.saml1.profile.impl;
+package org.opensaml.saml.common.profile.impl;
+
+import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
 
 import org.opensaml.core.OpenSAMLInitBaseTestCase;
 import org.opensaml.core.xml.config.XMLObjectProviderRegistrySupport;
+import org.opensaml.profile.ProfileException;
 import org.opensaml.profile.RequestContextBuilder;
 import org.opensaml.profile.action.ActionTestingSupport;
 import org.opensaml.profile.action.EventIds;
@@ -28,7 +31,7 @@
 import org.opensaml.saml.saml1.core.Conditions;
 import org.opensaml.saml.saml1.core.Response;
 import org.opensaml.saml.saml1.profile.SAML1ActionTestingSupport;
-import org.opensaml.saml.saml1.profile.impl.AddNotBeforeConditionToAssertions;
+import org.opensaml.saml.saml2.profile.SAML2ActionTestingSupport;
 import org.testng.Assert;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
@@ -38,20 +41,22 @@
 
     private ProfileRequestContext prc;
     
+    private AddNotBeforeConditionToAssertions action;
+    
     @BeforeMethod
-    public void setUp() {
+    public void setUp() throws ComponentInitializationException {
         prc = new RequestContextBuilder().setOutboundMessage(
                 SAML1ActionTestingSupport.buildResponse()).buildProfileRequestContext();
+        
+        action = new AddNotBeforeConditionToAssertions();
+        action.setId("test");
+        action.initialize();
     }
     
     /** Test that action errors out properly if there is no response. */
     @Test
-    public void testNoResponse() throws Exception {
+    public void testNoResponse() throws ProfileException {
         prc.setOutboundMessageContext(null);
-        
-        final AddNotBeforeConditionToAssertions action = new AddNotBeforeConditionToAssertions();
-        action.setId("test");
-        action.initialize();
         
         action.execute(prc);
         ActionTestingSupport.assertEvent(prc, EventIds.INVALID_MSG_CTX);
@@ -59,11 +64,7 @@
 
     /** Test that action works properly if there is no assertion in the response. */
     @Test
-    public void testNoAssertion() throws Exception {
-        final AddNotBeforeConditionToAssertions action = new AddNotBeforeConditionToAssertions();
-        action.setId("test");
-        action.initialize();
-
+    public void testNoAssertion() throws ProfileException {
         action.execute(prc);
         ActionTestingSupport.assertProceedEvent(prc);
     }
@@ -73,15 +74,11 @@
      * response.
      */
     @Test
-    public void testSingleAssertion() throws Exception {
+    public void testSingleAssertion() throws ProfileException {
         final Assertion assertion = SAML1ActionTestingSupport.buildAssertion();
 
         final Response response = (Response) prc.getOutboundMessageContext().getMessage();
         response.getAssertions().add(assertion);
-
-        final AddNotBeforeConditionToAssertions action = new AddNotBeforeConditionToAssertions();
-        action.setId("test");
-        action.initialize();
 
         action.execute(prc);
         ActionTestingSupport.assertProceedEvent(prc);
@@ -98,7 +95,7 @@
      * response.
      */
     @Test

[... 63 lines stripped ...]


More information about the commits mailing list