fix tests

This commit is contained in:
Marek Lewandowski
2016-11-16 19:56:38 +01:00
parent e2c76098ab
commit be5ac17249
2 changed files with 2 additions and 2 deletions

View File

@@ -13,11 +13,11 @@ public class BeanFactoryWithClassPathResourceTest {
@Test
public void createBeanFactoryAndCheckEmployeeBean() {
Resource res = new ClassPathResource("spring-app.xml");
Resource res = new ClassPathResource("beanfactory-example.xml");
BeanFactory factory = new XmlBeanFactory(res);
Employee emp = (Employee) factory.getBean("employee");
assertFalse(factory.isSingleton("employee"));
assertTrue(factory.isSingleton("employee"));
assertTrue(factory.getBean("employee") instanceof Employee);
assertTrue(factory.isTypeMatch("employee", Employee.class));
assertTrue(factory.getAliases("employee").length > 0);

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
<bean id="employee" class="com.baeldung.beanfactory.Employee">
<constructor-arg name="name" value="Hello! My name is Java"/>
<constructor-arg name="age" value="18"/>
</bean>
<alias name="employee" alias="empalias" />
</beans>