mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-21 13:31:46 +00:00
DefaultListableBeanFactory checks for alias circle on registerAlias (avoiding endless loop; SPR-7274)
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3409 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
+14
@@ -723,6 +723,20 @@ public class DefaultListableBeanFactoryTests {
|
||||
assertTrue("Test bean age is 48", tb.getAge() == 48);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAliasCircle() {
|
||||
DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
|
||||
lbf.registerAlias("test", "test2");
|
||||
lbf.registerAlias("test2", "test3");
|
||||
try {
|
||||
lbf.registerAlias("test3", "test");
|
||||
fail("Should have thrown IllegalStateException");
|
||||
}
|
||||
catch (IllegalStateException ex) {
|
||||
// expected
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBeanDefinitionOverriding() {
|
||||
DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
|
||||
|
||||
Reference in New Issue
Block a user