[java-identity-provider COMMIT] in /trunk/idp-profile-impl/src/test: java/net/shibboleth/idp/profile/impl/ProfileActi...

noreply at shibboleth.net noreply at shibboleth.net
Tue Feb 11 13:59:21 EST 2014


Author: tzeller
Date: Tue Feb 11 13:59:20 2014
New Revision: 5374

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=5374&view=rev
Log:
Use mock actions for ProfileActionBeanPostProcessor tests.
Test throwing BeanCreationException when wrapping an OpenSAML action.

Modified:
    trunk/idp-profile-impl/src/test/java/net/shibboleth/idp/profile/impl/ProfileActionBeanPostProcessorTest.java
    trunk/idp-profile-impl/src/test/resources/net/shibboleth/idp/profile/impl/ProfileActionBeanPostProcessorTest.xml

Modified: trunk/idp-profile-impl/src/test/java/net/shibboleth/idp/profile/impl/ProfileActionBeanPostProcessorTest.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-profile-impl/src/test/java/net/shibboleth/idp/profile/impl/ProfileActionBeanPostProcessorTest.java?rev=5374&r1=5373&r2=5374&view=diff
==============================================================================
--- trunk/idp-profile-impl/src/test/java/net/shibboleth/idp/profile/impl/ProfileActionBeanPostProcessorTest.java (original)
+++ trunk/idp-profile-impl/src/test/java/net/shibboleth/idp/profile/impl/ProfileActionBeanPostProcessorTest.java Tue Feb 11 13:59:20 2014
@@ -17,7 +17,10 @@
 
 package net.shibboleth.idp.profile.impl;
 
+import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
+
 import org.opensaml.profile.action.ProfileAction;
+import org.springframework.beans.factory.BeanCreationException;
 import org.springframework.test.context.ContextConfiguration;
 import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
 import org.testng.Assert;
@@ -63,8 +66,24 @@
         bean = applicationContext.getBean("OpenSAMLActionWithCustomID");
         Assert.assertTrue(bean instanceof WebFlowProfileActionAdaptor);
         Assert.assertTrue(((WebFlowProfileActionAdaptor) bean).isInitialized());
-        
-        // TODO Test throwing ComponentInitializationException ?
+    }
+
+    @Test(expectedExceptions = BeanCreationException.class) public void testBeanCreationException() {
+        applicationContext.getBean("OpenSAMLExceptionAction");
+    }
+
+    public static class MockIdPAction extends net.shibboleth.idp.profile.AbstractProfileAction {
+
+    }
+
+    public static class MockOpenSAMLAction extends org.opensaml.profile.action.AbstractProfileAction {
+
+    }
+
+    public static class MockOpenSAMLExceptionAction extends org.opensaml.profile.action.AbstractProfileAction {
+        protected void doInitialize() throws ComponentInitializationException {
+            throw new ComponentInitializationException();
+        }
     }
 
 }

Modified: trunk/idp-profile-impl/src/test/resources/net/shibboleth/idp/profile/impl/ProfileActionBeanPostProcessorTest.xml
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-profile-impl/src/test/resources/net/shibboleth/idp/profile/impl/ProfileActionBeanPostProcessorTest.xml?rev=5374&r1=5373&r2=5374&view=diff
==============================================================================
--- trunk/idp-profile-impl/src/test/resources/net/shibboleth/idp/profile/impl/ProfileActionBeanPostProcessorTest.xml (original)
+++ trunk/idp-profile-impl/src/test/resources/net/shibboleth/idp/profile/impl/ProfileActionBeanPostProcessorTest.xml Tue Feb 11 13:59:20 2014
@@ -11,24 +11,29 @@
 
     <bean
         id="IdPActionWithDefaultID"
-        class="net.shibboleth.idp.profile.impl.InitializeRelyingPartyContext"
+        class="net.shibboleth.idp.profile.impl.ProfileActionBeanPostProcessorTest$MockIdPAction"
         scope="prototype" />
 
     <bean
         id="IdPActionWithCustomID"
-        class="net.shibboleth.idp.profile.impl.InitializeRelyingPartyContext"
+        class="net.shibboleth.idp.profile.impl.ProfileActionBeanPostProcessorTest$MockIdPAction"
         scope="prototype"
         p:id="CustomID" />
 
     <bean
         id="OpenSAMLActionWithDefaultID"
-        class="org.opensaml.profile.action.impl.CheckMandatoryIssuer"
+        class="net.shibboleth.idp.profile.impl.ProfileActionBeanPostProcessorTest$MockOpenSAMLAction"
         scope="prototype" />
 
     <bean
         id="OpenSAMLActionWithCustomID"
-        class="org.opensaml.profile.action.impl.CheckMandatoryIssuer"
+        class="net.shibboleth.idp.profile.impl.ProfileActionBeanPostProcessorTest$MockOpenSAMLAction"
         scope="prototype"
         p:id="CustomID" />
 
+    <bean
+        id="OpenSAMLExceptionAction"
+        class="net.shibboleth.idp.profile.impl.ProfileActionBeanPostProcessorTest$MockOpenSAMLExceptionAction"
+        scope="prototype" />
+
 </beans>



More information about the commits mailing list