Browse Source

Moved tests from testsuite to beans

pull/23217/head
Arjen Poutsma 17 years ago
parent
commit
e31ad80a0b
  1. 0
      org.springframework.beans/src/test/java/org/springframework/beans/factory/xml/MetadataAttachmentTests.java
  2. 0
      org.springframework.beans/src/test/java/org/springframework/beans/factory/xml/SchemaValidationTests.java
  3. 0
      org.springframework.beans/src/test/java/org/springframework/beans/factory/xml/ShortcutTests.java
  4. 0
      org.springframework.beans/src/test/java/org/springframework/beans/factory/xml/UtilNamespaceHandlerTests.java
  5. 1
      org.springframework.beans/src/test/resources/org/springframework/beans/factory/config/util.properties
  6. 8
      org.springframework.beans/src/test/resources/org/springframework/beans/factory/xml/invalidPerSchema.xml
  7. 20
      org.springframework.beans/src/test/resources/org/springframework/beans/factory/xml/schemaValidated.xml
  8. 27
      org.springframework.beans/src/test/resources/org/springframework/beans/factory/xml/shortcutTests.xml
  9. 184
      org.springframework.beans/src/test/resources/org/springframework/beans/factory/xml/testUtilNamespace.xml
  10. 21
      org.springframework.beans/src/test/resources/org/springframework/beans/factory/xml/withMeta.xml

0
org.springframework.testsuite/src/test/java/org/springframework/beans/factory/xml/MetadataAttachmentTests.java → org.springframework.beans/src/test/java/org/springframework/beans/factory/xml/MetadataAttachmentTests.java

0
org.springframework.testsuite/src/test/java/org/springframework/beans/factory/xml/SchemaValidationTests.java → org.springframework.beans/src/test/java/org/springframework/beans/factory/xml/SchemaValidationTests.java

0
org.springframework.testsuite/src/test/java/org/springframework/beans/factory/xml/ShortcutTests.java → org.springframework.beans/src/test/java/org/springframework/beans/factory/xml/ShortcutTests.java

0
org.springframework.testsuite/src/test/java/org/springframework/beans/factory/xml/UtilNamespaceHandlerTests.java → org.springframework.beans/src/test/java/org/springframework/beans/factory/xml/UtilNamespaceHandlerTests.java

1
org.springframework.beans/src/test/resources/org/springframework/beans/factory/config/util.properties

@ -0,0 +1 @@ @@ -0,0 +1 @@
foo=bar

8
org.springframework.beans/src/test/resources/org/springframework/beans/factory/xml/invalidPerSchema.xml

@ -0,0 +1,8 @@ @@ -0,0 +1,8 @@
<?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-2.0.xsd">
<foobar/>
</beans>

20
org.springframework.beans/src/test/resources/org/springframework/beans/factory/xml/schemaValidated.xml

@ -0,0 +1,20 @@ @@ -0,0 +1,20 @@
<?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-2.0.xsd">
<bean xml:lang="en" id="testBean" class="org.springframework.beans.TestBean"/>
<bean id="fooBean" class="org.springframework.beans.TestBean">
<property name="spouse">
<bean class="org.springframework.beans.TestBean"/>
</property>
<property name="friends">
<list>
<bean class="org.springframework.beans.TestBean"/>
<bean class="org.springframework.beans.TestBean"/>
</list>
</property>
</bean>
</beans>

27
org.springframework.beans/src/test/resources/org/springframework/beans/factory/xml/shortcutTests.xml

@ -0,0 +1,27 @@ @@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
<bean id="rob" class="org.springframework.beans.TestBean" p:name="Rob Harrop" p:spouse-ref="sally">
<property name="age" value="24"/>
</bean>
<bean id="sally" class="org.springframework.beans.TestBean" p:name="Sally Greenwood" p:spouse-ref="rob"/>
<bean id="sally2" class="org.springframework.beans.TestBean">
<property name="spouse">
<bean id="rob2" class="org.springframework.beans.TestBean" p:name="Rob Harrop" p:spouse-ref="sally2">
<property name="age" value="24"/>
</bean>
</property>
</bean>
<bean id="derivedSally" class="org.springframework.beans.DerivedTestBean" p:name="Sally Greenwood" p:spouseRef="r"/>
</beans>

184
org.springframework.beans/src/test/resources/org/springframework/beans/factory/xml/testUtilNamespace.xml

@ -0,0 +1,184 @@ @@ -0,0 +1,184 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd">
<util:constant id="min" static-field="
java.lang.Integer.
MIN_VALUE
"/>
<util:constant static-field="java.lang.Integer.MAX_VALUE"/>
<util:property-path id="name" path="
configuredBean.
name
"/>
<bean id="testBean" class="org.springframework.beans.TestBean" scope="prototype">
<property name="name">
<util:property-path path="configuredBean.name"/>
</property>
<property name="someProperties">
<util:properties location="classpath:/org/springframework/beans/factory/config/util.properties"/>
</property>
</bean>
<bean id="constructedTestBean" class="org.springframework.beans.TestBean">
<constructor-arg index="0">
<util:property-path path="configuredBean.name"/>
</constructor-arg>
</bean>
<bean id="configuredBean" class="org.springframework.beans.TestBean">
<property name="name" value="Rob Harrop"/>
</bean>
<util:map id="simpleMap">
<entry key="foo" value="bar"/>
</util:map>
<util:map id="scopedMap" scope="prototype">
<description>My scoped Map</description>
<entry key="foo" value="bar"/>
</util:map>
<util:map id="mapWithRef" map-class="java.util.TreeMap">
<entry key="bean" value-ref="testBean"/>
</util:map>
<util:list id="simpleList">
<value>Rob Harrop</value>
</util:list>
<util:list id="scopedList" scope="prototype">
<description>My scoped List</description>
<value>Rob Harrop</value>
</util:list>
<util:set id="simpleSet">
<value>Rob Harrop</value>
</util:set>
<util:set id="scopedSet" scope="prototype">
<description>My scoped Set</description>
<value>Rob Harrop</value>
</util:set>
<bean id="nestedCollectionsBean" class="org.springframework.beans.TestBean">
<property name="someList">
<util:list>
<value>foo</value>
</util:list>
</property>
<property name="someSet">
<util:set>
<value>bar</value>
</util:set>
</property>
<property name="someMap">
<util:map>
<entry key="foo">
<util:set>
<value>bar</value>
</util:set>
</entry>
</util:map>
</property>
</bean>
<bean id="nestedCustomTagBean" class="org.springframework.beans.TestBean" scope="prototype">
<property name="someList">
<list>
<util:constant static-field="java.lang.Integer.MIN_VALUE"/>
</list>
</property>
<property name="someSet">
<set>
<util:constant static-field="java.lang.Integer.MIN_VALUE"/>
</set>
</property>
<property name="someMap">
<map>
<entry>
<key><value>min</value></key>
<util:constant static-field="java.lang.Integer.MIN_VALUE"/>
</entry>
</map>
</property>
</bean>
<bean id="circularCollectionsBean" class="org.springframework.beans.TestBean">
<property name="someList">
<util:list>
<ref bean="circularCollectionsBean"/>
</util:list>
</property>
<property name="someSet">
<util:set>
<ref bean="circularCollectionsBean"/>
</util:set>
</property>
<property name="someMap">
<util:map>
<entry key="foo" value-ref="circularCollectionsBean"/>
</util:map>
</property>
</bean>
<util:list id="circularList">
<ref bean="circularCollectionBeansBean"/>
</util:list>
<util:set id="circularSet">
<ref bean="circularCollectionBeansBean"/>
</util:set>
<util:map id="circularMap">
<entry key="foo" value-ref="circularCollectionBeansBean"/>
</util:map>
<bean id="circularCollectionBeansBean" class="org.springframework.beans.TestBean">
<property name="someList" ref="circularList"/>
<property name="someSet" ref="circularSet"/>
<property name="someMap" ref="circularMap"/>
</bean>
<util:properties id="myProperties"
location="classpath:/org/springframework/beans/factory/config/util.properties"/>
<util:properties id="myScopedProperties"
location="classpath:/org/springframework/beans/factory/config/util.properties" scope="prototype"/>
<util:properties id="myLocalProperties">
<prop key="foo2">bar2</prop>
</util:properties>
<util:properties id="myMergedProperties"
location="classpath:/org/springframework/beans/factory/config/util.properties">
<prop key="foo2">bar2</prop>
</util:properties>
<util:properties id="defaultLocalOverrideProperties"
location="classpath:/org/springframework/beans/factory/config/util.properties">
<prop key="foo">local</prop>
<prop key="foo2">local2</prop>
</util:properties>
<util:properties id="trueLocalOverrideProperties"
location="classpath:/org/springframework/beans/factory/config/util.properties"
local-override="true">
<prop key="foo">local</prop>
<prop key="foo2">local2</prop>
</util:properties>
<util:properties id="falseLocalOverrideProperties"
location="classpath:/org/springframework/beans/factory/config/util.properties"
local-override="false">
<prop key="foo">local</prop>
<prop key="foo2">local2</prop>
</util:properties>
</beans>

21
org.springframework.beans/src/test/resources/org/springframework/beans/factory/xml/withMeta.xml

@ -0,0 +1,21 @@ @@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<spring:beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:spring="http://www.springframework.org/schema/beans"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<spring:bean id="testBean1" class="org.springframework.beans.TestBean">
<spring:meta key="foo" value="bar"/>
</spring:bean>
<spring:bean id="testBean2" class="org.springframework.beans.TestBean" parent="testBean1">
<spring:meta key="abc" value="123"/>
</spring:bean>
<spring:bean id="testBean3" class="org.springframework.beans.TestBean">
<spring:property name="name" value="Rob">
<spring:meta key="surname" value="Harrop"/>
</spring:property>
</spring:bean>
</spring:beans>
Loading…
Cancel
Save