Remove duplicate test classes
Prior to this commit many test utility classes and sample beans were duplicated across projects. This was previously necessary due to the fact that dependent test sources were not shared during a gradle build. Since the introduction of the 'test-source-set-dependencies' gradle plugin this is no longer the case. This commit attempts to remove as much duplicate code as possible, co-locating test utilities and beans in the most suitable project. For example, test beans are now located in the 'spring-beans' project. Some of the duplicated code had started to drift apart when modifications made in one project where not ported to others. All changes have now been consolidated and when necessary existing tests have been refactored to account for the differences. Conflicts: spring-beans/src/test/java/org/springframework/beans/factory/ConcurrentBeanFactoryTests.java spring-beans/src/test/java/org/springframework/beans/factory/support/BeanFactoryGenericsTests.java spring-beans/src/test/java/org/springframework/beans/support/PagedListHolderTests.java
This commit is contained in:
committed by
Chris Beams
parent
2a30fa07ea
commit
42b5d6dd7e
@@ -8,13 +8,13 @@
|
||||
<!-- age should inherit value of 1 from parent -->
|
||||
</bean>
|
||||
|
||||
<bean id="inheritsWithDifferentClass" class="org.springframework.beans.DerivedTestBean"
|
||||
<bean id="inheritsWithDifferentClass" class="org.springframework.tests.sample.beans.DerivedTestBean"
|
||||
parent="inheritedTestBean" init-method="initialize">
|
||||
<property name="name"><value>override</value></property>
|
||||
<!-- age should inherit value of 1 from parent -->
|
||||
</bean>
|
||||
|
||||
<bean id="inheritsWithClass" class="org.springframework.beans.DerivedTestBean"
|
||||
<bean id="inheritsWithClass" class="org.springframework.tests.sample.beans.DerivedTestBean"
|
||||
parent="inheritedTestBeanWithoutClass" init-method="initialize">
|
||||
<property name="name"><value>override</value></property>
|
||||
<!-- age should inherit value of 1 from parent -->
|
||||
@@ -42,7 +42,7 @@
|
||||
|
||||
<bean id="bogusParent" parent="bogus" scope="prototype"/>
|
||||
|
||||
<bean id="indexedTestBean" class="org.springframework.beans.IndexedTestBean">
|
||||
<bean id="indexedTestBean" class="org.springframework.tests.sample.beans.IndexedTestBean">
|
||||
<property name="array[0].name"><value>myname</value></property>
|
||||
</bean>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
<beans>
|
||||
|
||||
<bean id="validEmptyWithDescription" class="org.springframework.beans.TestBean">
|
||||
<bean id="validEmptyWithDescription" class="org.springframework.tests.sample.beans.TestBean">
|
||||
<description>
|
||||
I have no properties and I'm happy without them.
|
||||
</description>
|
||||
@@ -12,7 +12,7 @@
|
||||
<!--
|
||||
Check automatic creation of alias, to allow for names that are illegal as XML ids.
|
||||
-->
|
||||
<bean id="aliased" class=" org.springframework.beans.TestBean " name="myalias">
|
||||
<bean id="aliased" class=" org.springframework.tests.sample.beans.TestBean " name="myalias">
|
||||
<property name="name"><value>aliased</value></property>
|
||||
</bean>
|
||||
|
||||
@@ -20,17 +20,17 @@
|
||||
|
||||
<alias name="multiAliased" alias="alias3"/>
|
||||
|
||||
<bean id="multiAliased" class="org.springframework.beans.TestBean" name="alias1,alias2">
|
||||
<bean id="multiAliased" class="org.springframework.tests.sample.beans.TestBean" name="alias1,alias2">
|
||||
<property name="name"><value>aliased</value></property>
|
||||
</bean>
|
||||
|
||||
<alias name="multiAliased" alias="alias4"/>
|
||||
|
||||
<bean class="org.springframework.beans.TestBean" name="aliasWithoutId1,aliasWithoutId2,aliasWithoutId3">
|
||||
<bean class="org.springframework.tests.sample.beans.TestBean" name="aliasWithoutId1,aliasWithoutId2,aliasWithoutId3">
|
||||
<property name="name"><value>aliased</value></property>
|
||||
</bean>
|
||||
|
||||
<bean class="org.springframework.beans.TestBean">
|
||||
<bean class="org.springframework.tests.sample.beans.TestBean">
|
||||
<property name="name"><null/></property>
|
||||
</bean>
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
<bean class="org.springframework.beans.factory.xml.DummyReferencer"/>
|
||||
|
||||
<bean id="rod" class="org.springframework.beans.TestBean">
|
||||
<bean id="rod" class="org.springframework.tests.sample.beans.TestBean">
|
||||
<property name="name"><value><!-- a comment -->Rod</value></property>
|
||||
<property name="age"><value>31</value></property>
|
||||
<property name="spouse"><ref bean="father"/></property>
|
||||
@@ -52,29 +52,29 @@
|
||||
<!-- Should inherit age -->
|
||||
</bean>
|
||||
|
||||
<bean id="kerry" class="org.springframework.beans.TestBean">
|
||||
<bean id="kerry" class="org.springframework.tests.sample.beans.TestBean">
|
||||
<property name="name"><value>Ker<!-- a comment -->ry</value></property>
|
||||
<property name="age"><value>34</value></property>
|
||||
<property name="spouse"><ref local="rod"/></property>
|
||||
<property name="touchy"><value></value></property>
|
||||
</bean>
|
||||
|
||||
<bean id="kathy" class="org.springframework.beans.TestBean" scope="prototype">
|
||||
<bean id="kathy" class="org.springframework.tests.sample.beans.TestBean" scope="prototype">
|
||||
<property name="name"><value>Kathy</value></property>
|
||||
<property name="age"><value>28</value></property>
|
||||
<property name="spouse"><ref bean="father"/></property>
|
||||
</bean>
|
||||
|
||||
<bean id="typeMismatch" class="org.springframework.beans.TestBean" scope="prototype">
|
||||
<bean id="typeMismatch" class="org.springframework.tests.sample.beans.TestBean" scope="prototype">
|
||||
<property name="name"><value>typeMismatch</value></property>
|
||||
<property name="age"><value>34x</value></property>
|
||||
<property name="spouse"><ref local="rod"/></property>
|
||||
</bean>
|
||||
|
||||
<!-- Test of lifecycle callbacks -->
|
||||
<bean id="mustBeInitialized" class="org.springframework.beans.factory.MustBeInitialized"/>
|
||||
<bean id="mustBeInitialized" class="org.springframework.tests.sample.beans.MustBeInitialized"/>
|
||||
|
||||
<bean id="lifecycle" class="org.springframework.beans.factory.LifecycleBean"
|
||||
<bean id="lifecycle" class="org.springframework.tests.sample.beans.LifecycleBean"
|
||||
init-method="declaredInitMethod">
|
||||
<property name="initMethodDeclared"><value>true</value></property>
|
||||
</bean>
|
||||
@@ -85,10 +85,10 @@
|
||||
</bean>
|
||||
|
||||
<!-- Factory beans are automatically treated differently -->
|
||||
<bean id="singletonFactory" class="org.springframework.beans.factory.DummyFactory">
|
||||
<bean id="singletonFactory" class="org.springframework.tests.sample.beans.factory.DummyFactory">
|
||||
</bean>
|
||||
|
||||
<bean id="prototypeFactory" class="org.springframework.beans.factory.DummyFactory">
|
||||
<bean id="prototypeFactory" class="org.springframework.tests.sample.beans.factory.DummyFactory">
|
||||
<property name="singleton"><value>false</value></property>
|
||||
</bean>
|
||||
|
||||
@@ -113,14 +113,14 @@
|
||||
<property name="testBean2"><ref bean="kathy"/></property>
|
||||
</bean>
|
||||
|
||||
<bean id="listenerVeto" class="org.springframework.beans.TestBean">
|
||||
<bean id="listenerVeto" class="org.springframework.tests.sample.beans.TestBean">
|
||||
<property name="name"><value>listenerVeto</value></property>
|
||||
<property name="age"><value>66</value></property>
|
||||
</bean>
|
||||
|
||||
<bean id="validEmpty" class="org.springframework.beans.TestBean"/>
|
||||
<bean id="validEmpty" class="org.springframework.tests.sample.beans.TestBean"/>
|
||||
|
||||
<bean id="commentsInValue" class="org.springframework.beans.TestBean">
|
||||
<bean id="commentsInValue" class="org.springframework.tests.sample.beans.TestBean">
|
||||
<property name="name"><value>this is<!-- don't mind me --> a <![CDATA[<!--comment-->]]></value></property>
|
||||
</bean>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user