added test for getType against an abstract FactoryBean

This commit is contained in:
Juergen Hoeller 2010-05-27 13:45:44 +00:00
parent 3a5af35d37
commit 75c5405d6f
1 changed files with 10 additions and 1 deletions

View File

@ -89,7 +89,7 @@ import org.springframework.util.StopWatch;
* @author Sam Brannen
* @author Chris Beams
*/
public final class DefaultListableBeanFactoryTests {
public class DefaultListableBeanFactoryTests {
private static final Log factoryLog = LogFactory.getLog(DefaultListableBeanFactory.class);
@ -1280,6 +1280,15 @@ public final class DefaultListableBeanFactoryTests {
factoryBean, bean.getFactoryBean());
}
@Test
public void testGetTypeForAbstractFactoryBean() {
DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
RootBeanDefinition bd = new RootBeanDefinition(FactoryBeanThatShouldntBeCalled.class);
bd.setAbstract(true);
lbf.registerBeanDefinition("factoryBean", bd);
assertNull(lbf.getType("factoryBean"));
}
/**
* Verifies that a dependency on a {@link FactoryBean} can <strong>not</strong>
* be autowired <em>by name</em>, as &amp; is an illegal character in