SimpleMetadataReaderFactory is capable of resolving inner class names with dot syntax now (analogous to ClassUtils.forName)

Issue: SPR-12390
(cherry picked from commit 725ad0d)
This commit is contained in:
Juergen Hoeller
2014-11-01 12:58:08 +01:00
parent 91940f212e
commit 2d874d724b
2 changed files with 28 additions and 2 deletions

View File

@@ -85,6 +85,16 @@ public class ConfigurationClassPostProcessorTests {
assertSame(foo, bar.foo);
}
@Test
public void configurationIntrospectionOfInnerClassesWorksWithDotNameSyntax() {
beanFactory.registerBeanDefinition("config", new RootBeanDefinition(getClass().getName() + ".SingletonBeanConfig"));
ConfigurationClassPostProcessor pp = new ConfigurationClassPostProcessor();
pp.postProcessBeanFactory(beanFactory);
Foo foo = beanFactory.getBean("foo", Foo.class);
Bar bar = beanFactory.getBean("bar", Bar.class);
assertSame(foo, bar.foo);
}
/**
* Tests the fix for SPR-5655, a special workaround that prefers reflection
* over ASM if a bean class is already loaded.