BAEL-3290: Corrected formatting
This commit is contained in:
parent
348d6386b0
commit
71ba4ca875
|
@ -1,14 +1,14 @@
|
|||
<?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">
|
||||
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">
|
||||
|
||||
<!-- Autowired injection -->
|
||||
|
||||
<bean id="item" class="org.baeldung.store.ItemImpl1" />
|
||||
<bean id="item" class="org.baeldung.store.ItemImpl1" />
|
||||
|
||||
<bean id="xml-store-by-autowire-type" class="org.baeldung.store.Store" autowire="byType">
|
||||
</bean>
|
||||
<bean id="xml-store-by-autowire-type" class="org.baeldung.store.Store" autowire="byType">
|
||||
</bean>
|
||||
|
||||
</beans>
|
|
@ -1,34 +1,34 @@
|
|||
<?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
|
||||
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">
|
||||
|
||||
<!-- Constructor injection -->
|
||||
|
||||
<bean id="item1" class="org.baeldung.store.ItemImpl1" />
|
||||
<bean id="xml-store-by-constructor" class="org.baeldung.store.Store">
|
||||
<constructor-arg type="Item" index="0" name="item" ref="item1" />
|
||||
</bean>
|
||||
|
||||
<!-- Setter injection -->
|
||||
<bean id="item1" class="org.baeldung.store.ItemImpl1" />
|
||||
<bean id="xml-store-by-constructor" class="org.baeldung.store.Store">
|
||||
<constructor-arg type="Item" index="0" name="item" ref="item1" />
|
||||
</bean>
|
||||
|
||||
<!-- Setter injection -->
|
||||
|
||||
<bean id="xml-store-by-setter" class="org.baeldung.store.Store">
|
||||
<property name="item" ref="item1" />
|
||||
</bean>
|
||||
|
||||
<!-- Autowired injection -->
|
||||
|
||||
<bean id="item" class="org.baeldung.store.ItemImpl1" />
|
||||
<bean id="xml-store-by-setter" class="org.baeldung.store.Store">
|
||||
<property name="item" ref="item1" />
|
||||
</bean>
|
||||
|
||||
<!-- Autowired injection -->
|
||||
|
||||
<bean id="item" class="org.baeldung.store.ItemImpl1" />
|
||||
|
||||
<bean id="xml-store-by-autowire-name" class="org.baeldung.store.Store" autowire="byName">
|
||||
</bean>
|
||||
|
||||
<!-- Lazy instantiation -->
|
||||
|
||||
<bean id="item1-lazy" class="org.baeldung.store.ItemImpl1" lazy-init="true" />
|
||||
<bean id="xml-store-by-setter-lazy" class="org.baeldung.store.Store">
|
||||
<property name="item" ref="item1-lazy" />
|
||||
</bean>
|
||||
<bean id="xml-store-by-autowire-name" class="org.baeldung.store.Store" autowire="byName">
|
||||
</bean>
|
||||
|
||||
<!-- Lazy instantiation -->
|
||||
|
||||
<bean id="item1-lazy" class="org.baeldung.store.ItemImpl1" lazy-init="true" />
|
||||
<bean id="xml-store-by-setter-lazy" class="org.baeldung.store.Store">
|
||||
<property name="item" ref="item1-lazy" />
|
||||
</bean>
|
||||
|
||||
</beans>
|
|
@ -1,6 +1,5 @@
|
|||
package org.baeldung.store;
|
||||
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
|
||||
import org.junit.Test;
|
||||
|
|
|
@ -13,8 +13,6 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
|||
* Separate unit test class where only one Item object is available for
|
||||
* autowiring. If the ioc-context.xml were used for autowiring by type, there
|
||||
* would be multiple qualifying Item objects, causing a failure.
|
||||
*
|
||||
* @author Justin Albano <albano.justin@gmail.com>
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration("classpath:/ioc-context-by-type.xml")
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package org.baeldung.store;
|
||||
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
|
||||
import org.junit.Test;
|
||||
|
|
Loading…
Reference in New Issue