BAEL-3290: Corrected formatting

This commit is contained in:
Justin Albano 2019-12-11 08:26:29 -05:00
parent 348d6386b0
commit 71ba4ca875
5 changed files with 30 additions and 34 deletions

View File

@ -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>

View File

@ -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>

View File

@ -1,6 +1,5 @@
package org.baeldung.store;
import static org.junit.Assert.assertNotNull;
import org.junit.Test;

View File

@ -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")

View File

@ -1,6 +1,5 @@
package org.baeldung.store;
import static org.junit.Assert.assertNotNull;
import org.junit.Test;