[java-identity-provider COMMIT] in /trunk/idp-core/src/test: java/net/shibboleth/idp/spring/naturestudy/TheBeanTest.j...

noreply at shibboleth.net noreply at shibboleth.net
Thu Dec 19 06:02:27 EST 2013


Author: rdw
Date: Thu Dec 19 06:02:26 2013
New Revision: 5063

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=5063&view=rev
Log:
IDP-209 More nature study.

Added:
    trunk/idp-core/src/test/resources/net/shibboleth/idp/spring/naturestudy/CustomBeanReplace3.xml   (with props)
    trunk/idp-core/src/test/resources/net/shibboleth/idp/spring/naturestudy/PropertyPlaceholder.xml   (with props)
Modified:
    trunk/idp-core/src/test/java/net/shibboleth/idp/spring/naturestudy/TheBeanTest.java

Modified: trunk/idp-core/src/test/java/net/shibboleth/idp/spring/naturestudy/TheBeanTest.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-core/src/test/java/net/shibboleth/idp/spring/naturestudy/TheBeanTest.java?rev=5063&r1=5062&r2=5063&view=diff
==============================================================================
--- trunk/idp-core/src/test/java/net/shibboleth/idp/spring/naturestudy/TheBeanTest.java (original)
+++ trunk/idp-core/src/test/java/net/shibboleth/idp/spring/naturestudy/TheBeanTest.java Thu Dec 19 06:02:26 2013
@@ -23,6 +23,7 @@
 
 import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
 import org.springframework.context.support.GenericApplicationContext;
+import org.springframework.core.io.ClassPathResource;
 import org.testng.Assert;
 import org.testng.annotations.Test;
 
@@ -38,7 +39,7 @@
 
         beanDefinitionReader.setValidationMode(XmlBeanDefinitionReader.VALIDATION_XSD);
         beanDefinitionReader.loadBeanDefinitions(fileName);
-        context.refresh(); // Gotta have this line or the proprty replacement won't work.
+        context.refresh(); // Gotta have this line or the property replacement won't work.
         
         Collection<TheBean> beans = context.getBeansOfType(TheBean.class).values();
         Assert.assertEquals(beans.size(), 1);
@@ -98,4 +99,22 @@
         Assert.assertEquals(bean.getMessage(), "REPLACE_CUSTOM_2");
     }
     
+    @Test public void testReplaceCustomBean3() {
+        final GenericApplicationContext context = new GenericApplicationContext();
+        SchemaTypeAwareXMLBeanDefinitionReader beanDefinitionReader =
+                new SchemaTypeAwareXMLBeanDefinitionReader(context);
+
+        beanDefinitionReader.setValidationMode(XmlBeanDefinitionReader.VALIDATION_XSD);
+        beanDefinitionReader.loadBeanDefinitions(new ClassPathResource("net/shibboleth/idp/spring/naturestudy/CustomBeanReplace3.xml"),
+                new ClassPathResource("net/shibboleth/idp/spring/naturestudy/PropertyPlaceholder.xml"));
+        context.refresh(); 
+        
+        Collection<TheBean> beans = context.getBeansOfType(TheBean.class).values();
+        Assert.assertEquals(beans.size(), 1);
+
+        TheBean bean = beans.iterator().next();
+        
+        Assert.assertEquals(bean.getMessage(), "REPLACE_CUSTOM_2");
+    }
+
 }



More information about the commits mailing list