[spring-extensions] branch master updated: Add test of identifiable singleton beans

Tom Zeller tzeller at dragonacea.biz
Sun Sep 25 16:23:29 EDT 2016


This is an automated email from the git hooks/post-receive script.

tzeller pushed a commit to branch master
in repository spring-extensions.

View the commit online:
http://git.shibboleth.net/view/?p=spring-extensions.git;a=commit;h=cffff4eb02fa1b61ed9a6236a812939f99721180

The following commit(s) were added to refs/heads/master by this push:
       new  cffff4e   Add test of identifiable singleton beans
cffff4e is described below

commit cffff4eb02fa1b61ed9a6236a812939f99721180
Author: Tom Zeller <tzeller at dragonacea.biz>
AuthorDate: Sun Sep 25 16:23:26 2016 -0400

    Add test of identifiable singleton beans
---
 .../ext/spring/config/IdentifiableBeanPostProcessorTest.java  | 11 +++++++++++
 .../ext/spring/config/identifiableBeanPostProcessorTest.xml   |  8 ++++++++
 2 files changed, 19 insertions(+)

diff --git a/src/test/java/net/shibboleth/ext/spring/config/IdentifiableBeanPostProcessorTest.java b/src/test/java/net/shibboleth/ext/spring/config/IdentifiableBeanPostProcessorTest.java
index 3c29869..c39e29e 100644
--- a/src/test/java/net/shibboleth/ext/spring/config/IdentifiableBeanPostProcessorTest.java
+++ b/src/test/java/net/shibboleth/ext/spring/config/IdentifiableBeanPostProcessorTest.java
@@ -62,6 +62,16 @@ public class IdentifiableBeanPostProcessorTest extends AbstractTestNGSpringConte
         Assert.assertEquals(bean.getId(), "TautologousName");
     }
 
+    @Test public void testSingleton() {
+        IdentifiedComponent bean = applicationContext.getBean("SingletonIdentifiableBean", Identifiable.class);
+        Assert.assertEquals(bean.getId(), "SingletonIdentifiableBean");
+    }
+
+    @Test public void testNonDefaultSingleton() {
+        IdentifiedComponent bean = applicationContext.getBean("NonDefaultSingletonIdentifiableBean", Identifiable.class);
+        Assert.assertEquals(bean.getId(), "NameForNonDefaultSingletonIdentifiableBean");
+    }
+
     public static class Identified extends AbstractIdentifiedInitializableComponent {
         @Override public void setId(@Nonnull String componentId) {
             super.setId(componentId);
@@ -70,4 +80,5 @@ public class IdentifiableBeanPostProcessorTest extends AbstractTestNGSpringConte
 
     public static class Identifiable extends AbstractIdentifiableInitializableComponent {
     }
+
 }
diff --git a/src/test/resources/net/shibboleth/ext/spring/config/identifiableBeanPostProcessorTest.xml b/src/test/resources/net/shibboleth/ext/spring/config/identifiableBeanPostProcessorTest.xml
index 63f1dc5..a571d85 100644
--- a/src/test/resources/net/shibboleth/ext/spring/config/identifiableBeanPostProcessorTest.xml
+++ b/src/test/resources/net/shibboleth/ext/spring/config/identifiableBeanPostProcessorTest.xml
@@ -25,5 +25,13 @@
 	<bean id="TautologousName"
 		class="net.shibboleth.ext.spring.config.IdentifiableBeanPostProcessorTest$Identifiable"
 		scope="prototype" p:id="TautologousName" />
+        
+    <bean id="SingletonIdentifiableBean"
+        class="net.shibboleth.ext.spring.config.IdentifiableBeanPostProcessorTest$Identifiable"
+        scope="singleton" />
+
+    <bean id="NonDefaultSingletonIdentifiableBean"
+        class="net.shibboleth.ext.spring.config.IdentifiableBeanPostProcessorTest$Identifiable"
+        scope="singleton" p:id="NameForNonDefaultSingletonIdentifiableBean" />    
 
 </beans>
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list