adapted to changes in non-lenient mode

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@1779 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
Juergen Hoeller
2009-08-27 10:45:46 +00:00
parent 2577b03d2e
commit c103aa7733
2 changed files with 5 additions and 41 deletions
@@ -1365,36 +1365,6 @@ public final class XmlBeanFactoryTests {
assertEquals(Boolean.TRUE, bean.boolean2);
}
public @Test void testDoubleBooleanNoType() {
XmlBeanFactory xbf = new XmlBeanFactory(CONSTRUCTOR_ARG_CONTEXT);
AbstractBeanDefinition bd = (AbstractBeanDefinition) xbf.getBeanDefinition("beanWithDoubleBooleanNoType");
bd.setLenientConstructorResolution(false);
try {
xbf.getBean("beanWithDoubleBooleanNoType");
fail("Should have thrown BeanCreationException");
}
catch (BeanCreationException ex) {
// expected
ex.printStackTrace();
assertTrue(ex.getMostSpecificCause().getMessage().contains("Ambiguous"));
}
}
public @Test void testDoubleBooleanNoTypeFactoryMethod() {
XmlBeanFactory xbf = new XmlBeanFactory(CONSTRUCTOR_ARG_CONTEXT);
AbstractBeanDefinition bd = (AbstractBeanDefinition) xbf.getBeanDefinition("beanWithDoubleBooleanNoTypeFactoryMethod");
bd.setLenientConstructorResolution(false);
try {
xbf.getBean("beanWithDoubleBooleanNoTypeFactoryMethod");
fail("Should have thrown BeanCreationException");
}
catch (BeanCreationException ex) {
// expected
ex.printStackTrace();
assertTrue(ex.getMostSpecificCause().getMessage().contains("Ambiguous"));
}
}
public @Test void testLenientDependencyMatching() {
XmlBeanFactory xbf = new XmlBeanFactory(CONSTRUCTOR_ARG_CONTEXT);
LenientDependencyTestBean bean = (LenientDependencyTestBean) xbf.getBean("lenientDependencyTestBean");