BAEL-3290: Corrected formatting
This commit is contained in:
parent
348d6386b0
commit
71ba4ca875
@ -1,14 +1,14 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||||
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
|
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
|
||||||
|
|
||||||
<!-- Autowired injection -->
|
<!-- 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 id="xml-store-by-autowire-type" class="org.baeldung.store.Store" autowire="byType">
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
</beans>
|
</beans>
|
@ -1,34 +1,34 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||||
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
|
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
|
||||||
|
|
||||||
<!-- Constructor injection -->
|
<!-- Constructor injection -->
|
||||||
|
|
||||||
<bean id="item1" class="org.baeldung.store.ItemImpl1" />
|
<bean id="item1" class="org.baeldung.store.ItemImpl1" />
|
||||||
<bean id="xml-store-by-constructor" class="org.baeldung.store.Store">
|
<bean id="xml-store-by-constructor" class="org.baeldung.store.Store">
|
||||||
<constructor-arg type="Item" index="0" name="item" ref="item1" />
|
<constructor-arg type="Item" index="0" name="item" ref="item1" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<!-- Setter injection -->
|
<!-- Setter injection -->
|
||||||
|
|
||||||
<bean id="xml-store-by-setter" class="org.baeldung.store.Store">
|
<bean id="xml-store-by-setter" class="org.baeldung.store.Store">
|
||||||
<property name="item" ref="item1" />
|
<property name="item" ref="item1" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<!-- Autowired injection -->
|
<!-- Autowired injection -->
|
||||||
|
|
||||||
<bean id="item" class="org.baeldung.store.ItemImpl1" />
|
<bean id="item" class="org.baeldung.store.ItemImpl1" />
|
||||||
|
|
||||||
<bean id="xml-store-by-autowire-name" class="org.baeldung.store.Store" autowire="byName">
|
<bean id="xml-store-by-autowire-name" class="org.baeldung.store.Store" autowire="byName">
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<!-- Lazy instantiation -->
|
<!-- Lazy instantiation -->
|
||||||
|
|
||||||
<bean id="item1-lazy" class="org.baeldung.store.ItemImpl1" lazy-init="true" />
|
<bean id="item1-lazy" class="org.baeldung.store.ItemImpl1" lazy-init="true" />
|
||||||
<bean id="xml-store-by-setter-lazy" class="org.baeldung.store.Store">
|
<bean id="xml-store-by-setter-lazy" class="org.baeldung.store.Store">
|
||||||
<property name="item" ref="item1-lazy" />
|
<property name="item" ref="item1-lazy" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
</beans>
|
</beans>
|
@ -1,6 +1,5 @@
|
|||||||
package org.baeldung.store;
|
package org.baeldung.store;
|
||||||
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
|
|
||||||
import org.junit.Test;
|
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
|
* 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
|
* autowiring. If the ioc-context.xml were used for autowiring by type, there
|
||||||
* would be multiple qualifying Item objects, causing a failure.
|
* would be multiple qualifying Item objects, causing a failure.
|
||||||
*
|
|
||||||
* @author Justin Albano <albano.justin@gmail.com>
|
|
||||||
*/
|
*/
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
@RunWith(SpringJUnit4ClassRunner.class)
|
||||||
@ContextConfiguration("classpath:/ioc-context-by-type.xml")
|
@ContextConfiguration("classpath:/ioc-context-by-type.xml")
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package org.baeldung.store;
|
package org.baeldung.store;
|
||||||
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user