Upgrade to Tomcat 8.5.11

This commit is contained in:
Brian Clozel
2017-01-20 09:55:33 +01:00
parent 78a23be9bc
commit 35b67a54d2
930 changed files with 32832 additions and 1 deletions

View File

@@ -0,0 +1,40 @@
<?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 id="a" class="java.lang.Object" />
<bean id="b" class="java.lang.Integer">
<constructor-arg value="50" />
</bean>
<bean id="c" class="java.lang.String">
<constructor-arg ref="b" />
</bean>
<bean id="int" class="java.lang.Integer">
<constructor-arg ref="c" />
</bean>
<bean id="long" class="java.lang.Long">
<constructor-arg ref="c" />
</bean>
<bean id="buffer" class="java.lang.StringBuffer">
<constructor-arg ref="int" />
</bean>
<bean id="thread" class="java.lang.Thread"/>
<bean id="field" class="org.springframework.beans.factory.config.FieldRetrievingFactoryBean">
<property name="targetObject" ref="thread"/>
<property name="targetField" value="MAX_PRIORITY"/>
</bean>
<bean id="secondBuffer" class="java.lang.StringBuffer">
<constructor-arg ref="field"/>
</bean>
</beans>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<bean id="test3" class="org.springframework.tests.sample.beans.TestBean" scope="prototype">
<property name="name"><value>custom</value></property>
<property name="age"><value>25</value></property>
</bean>
</beans>

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<!-- Simple target -->
<bean id="test" class="org.springframework.tests.sample.beans.TestBean">
<property name="name"><value>custom</value></property>
<property name="age"><value>666</value></property>
</bean>
<!--
Check that invoker is automatically added to wrap target.
Non pointcut bean name should be wrapped in invoker.
-->
<bean id="numberTestBean" class="org.springframework.tests.sample.beans.NumberTestBean"/>
</beans>

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<!--
Just included for the count: not to mean anything in particular
-->
<bean id="something" class="org.springframework.tests.sample.beans.GenericIntegerBean"/>
<bean id="indexedBean" class="org.springframework.tests.sample.beans.IndexedTestBean"/>
<!-- Overridden by next factory -->
<bean id="test" class="org.springframework.tests.sample.beans.TestBean">
<property name="name"><value>custom</value></property>
<property name="age"><value>25</value></property>
</bean>
<bean id="testFactory1" class="org.springframework.tests.sample.beans.factory.DummyFactory"/>
<bean id="testFactory2" class="org.springframework.tests.sample.beans.factory.DummyFactory">
<property name="singleton"><value>false</value></property>
</bean>
</beans>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<bean id="bean1" class="org.springframework.beans.factory.ConcurrentBeanFactoryTests$ConcurrentBean"
scope="prototype">
<property name="date" value="2004/08/08"/>
</bean>
<bean id="bean2" class="org.springframework.beans.factory.ConcurrentBeanFactoryTests$ConcurrentBean"
scope="prototype">
<property name="date" value="2000/02/02"/>
</bean>
</beans>

View File

@@ -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.xsd">
<bean id="fooFactory" class="org.springframework.beans.factory.FooFactoryBean"/>
</beans>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<bean id="abstractFactoryBean" class="org.springframework.beans.factory.FactoryBeanTests$AbstractFactoryBean" abstract="true"/>
</beans>

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<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">
<bean id="bean1" class="org.springframework.beans.factory.FactoryBeanTests$PassThroughFactoryBean" primary="true">
<constructor-arg value="org.springframework.beans.factory.FactoryBeanTests$BeanImpl1"/>
<property name="instanceName" value="beanImpl1"/>
</bean>
<bean id="beanImpl1" class="org.springframework.beans.factory.FactoryBeanTests$BeanImpl1">
<property name="impl2" ref="bean2"/>
</bean>
<bean id="bean2" class="org.springframework.beans.factory.FactoryBeanTests$PassThroughFactoryBean" primary="true">
<constructor-arg value="org.springframework.beans.factory.FactoryBeanTests$BeanImpl2"/>
<property name="instanceName" value="beanImpl2"/>
</bean>
<bean id="beanImpl2" class="org.springframework.beans.factory.FactoryBeanTests$BeanImpl2">
<property name="impl1" ref="bean1"/>
</bean>
</beans>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<bean id="factoryBean" class="org.springframework.beans.factory.FactoryBeanTests$NullReturningFactoryBean"/>
</beans>

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans default-lazy-init="true">
<bean name="beta" class="org.springframework.beans.factory.FactoryBeanTests$Beta" autowire="byType">
<property name="name" value="${myName}"/>
</bean>
<bean id="alpha" class="org.springframework.beans.factory.FactoryBeanTests$Alpha" autowire="byType"/>
<bean id="gamma" class="org.springframework.beans.factory.FactoryBeanTests$Gamma"/>
<bean id="betaFactory" class="org.springframework.beans.factory.FactoryBeanTests$BetaFactoryBean" autowire="constructor">
<property name="beta" ref="beta"/>
</bean>
<bean id="gammaFactory" factory-bean="betaFactory" factory-method="getGamma"/>
<bean id="propertyPlaceholderConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="properties">
<props>
<prop key="myName">yourName</prop>
</props>
</property>
</bean>
</beans>

View File

@@ -0,0 +1,33 @@
<?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.5.xsd">
<bean id="resolver" class="org.springframework.beans.factory.annotation.CustomAutowireConfigurerTests$CustomResolver"/>
<bean id="number-one" class="java.lang.String">
<meta key="priority" value="1"/>
<constructor-arg value="#1!"/>
</bean>
<bean id="one" class="java.lang.String" autowire-candidate="false">
<meta key="priority" value="1"/>
<constructor-arg value="#1"/>
</bean>
<bean id="number1" class="java.lang.String">
<meta key="priority" value="1"/>
<constructor-arg value="#1"/>
</bean>
<bean id="number-two" class="java.lang.String">
<meta key="priority" value="2"/>
<constructor-arg value="#2"/>
</bean>
<bean id="testBean"
class="org.springframework.beans.factory.annotation.CustomAutowireConfigurerTests$TestBean"
autowire="constructor"/>
</beans>

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<bean id="testBean" class="org.springframework.tests.sample.beans.TestBean">
<property name="someIntegerArray">
<list>
<bean name="java.sql.Connection.TRANSACTION_SERIALIZABLE" class="org.springframework.beans.factory.config.FieldRetrievingFactoryBean"/>
<bean name="java.sql.Connection.TRANSACTION_SERIALIZABLE" class="org.springframework.beans.factory.config.FieldRetrievingFactoryBean"/>
</list>
</property>
</bean>
</beans>

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<bean id="prototypeTarget" class="java.util.Date" scope="prototype"/>
<bean id="prototypeFactory" class="org.springframework.beans.factory.config.ObjectFactoryCreatingFactoryBean">
<property name="targetBeanName" value="prototypeTarget"/>
</bean>
<bean id="factoryTestBean" class="org.springframework.beans.factory.config.ObjectFactoryCreatingFactoryBeanTests$FactoryTestBean">
<property name="objectFactory" ref="prototypeFactory"/>
</bean>
<bean id="prototypeProvider" class="org.springframework.beans.factory.config.ProviderCreatingFactoryBean">
<property name="targetBeanName" value="prototypeTarget"/>
</bean>
<bean id="providerTestBean" class="org.springframework.beans.factory.config.ObjectFactoryCreatingFactoryBeanTests$ProviderTestBean">
<property name="provider" ref="prototypeProvider"/>
</bean>
</beans>

View File

@@ -0,0 +1,2 @@
tb.array[0].age=99
tb.list[1].name=test

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties version="1.0">
<entry key="tb.array[0].age">99</entry>
<entry key="tb.list[1].name">test</entry>
</properties>

View File

@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<bean id="tb" class="org.springframework.tests.sample.beans.TestBean" scope="prototype">
<property name="age"><value>10</value></property>
<property name="spouse">
<bean class="org.springframework.tests.sample.beans.TestBean">
<property name="age"><value>11</value></property>
</bean>
</property>
</bean>
<bean id="otb" class="org.springframework.tests.sample.beans.TestBean">
<property name="age"><value>98</value></property>
<property name="spouse">
<bean class="org.springframework.tests.sample.beans.TestBean">
<property name="age"><value>99</value></property>
</bean>
</property>
</bean>
<bean id="propertyPath1" class="org.springframework.beans.factory.config.PropertyPathFactoryBean">
<property name="targetObject">
<bean class="org.springframework.tests.sample.beans.TestBean">
<property name="age"><value>12</value></property>
</bean>
</property>
<property name="propertyPath"><value>age</value></property>
</bean>
<bean id="propertyPath2" class="org.springframework.beans.factory.config.PropertyPathFactoryBean">
<property name="targetBeanName"><value>tb</value></property>
<property name="propertyPath"><value>spouse.age</value></property>
</bean>
<bean id="tb.age" class="org.springframework.beans.factory.config.PropertyPathFactoryBean"/>
<bean id="otb.spouse" class="org.springframework.beans.factory.config.PropertyPathFactoryBean"/>
<bean id="tb.spouse" class="org.springframework.beans.factory.config.PropertyPathFactoryBean"/>
<bean id="tb.spouse.spouse" class="org.springframework.beans.factory.config.PropertyPathFactoryBean"/>
<bean id="propertyPath3" class="org.springframework.beans.factory.config.PropertyPathFactoryBean">
<property name="targetBeanName"><value>tb</value></property>
<property name="propertyPath"><value>spouse</value></property>
<property name="resultType"><value>org.springframework.tests.sample.beans.TestBean</value></property>
</bean>
<bean id="tbWithInner" class="org.springframework.tests.sample.beans.TestBean">
<property name="age" value="10"/>
<property name="spouse">
<bean name="otb.spouse" class="org.springframework.beans.factory.config.PropertyPathFactoryBean"/>
</property>
<property name="friends">
<bean name="otb.spouse" class="org.springframework.beans.factory.config.PropertyPathFactoryBean"/>
</property>
</bean>
</beans>

View File

@@ -0,0 +1,2 @@
tb.array[0].age=99
tb.list[1].name=test

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties version="1.0">
<entry key="tb.array[0].age">99</entry>
<entry key="tb.list[1].name">test</entry>
</properties>

View File

@@ -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">
<bean id="usesScope" class="org.springframework.tests.sample.beans.TestBean" scope="myScope"/>
</beans>

View File

@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN"
"http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<bean id="invalidClass" class="some.class.that.does.not.Exist"/>
<bean id="invalidMapDefinition" class="org.springframework.tests.sample.beans.TestBean">
<property name="someMap">
<map>
<entry/>
</map>
</property>
</bean>
<bean id="nestedBeanErrors" class="org.springframework.tests.sample.beans.TestBean">
<property name="spouse">
<bean class="org.springframework.tests.sample.beans.TestBean">
<property name="someMap">
<map>
<entry/>
</map>
</property>
</bean>
</property>
</bean>
<bean id="validBean" class="org.springframework.tests.sample.beans.TestBean"/>
</beans>

View File

@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<bean id="listOfArrays" class="org.springframework.tests.sample.beans.GenericBean">
<property name="listOfArrays">
<list>
<list>
<value>value1</value>
<value>value2</value>
</list>
</list>
</property>
</bean>
<bean id="list" class="org.springframework.beans.factory.config.ListFactoryBean">
<property name="sourceList" value="http://localhost:8080"/>
<property name="targetListClass" value="org.springframework.beans.factory.support.BeanFactoryGenericsTests$NamedUrlList"/>
</bean>
<bean id="set" class="org.springframework.beans.factory.config.SetFactoryBean">
<property name="sourceSet" value="http://localhost:8080"/>
<property name="targetSetClass" value="org.springframework.beans.factory.support.BeanFactoryGenericsTests$NamedUrlSet"/>
</bean>
<bean id="map" class="org.springframework.beans.factory.config.MapFactoryBean">
<property name="sourceMap">
<map>
<entry key="10" value="http://localhost:8080"/>
</map>
</property>
<property name="targetMapClass" value="org.springframework.beans.factory.support.BeanFactoryGenericsTests$NamedUrlMap"/>
</bean>
<bean class="org.springframework.beans.factory.support.BeanFactoryGenericsTests$CollectionDependentBean">
<constructor-arg ref="list"/>
<constructor-arg ref="set"/>
<constructor-arg ref="map"/>
</bean>
<bean class="org.springframework.beans.factory.support.BeanFactoryGenericsTests$CollectionDependentBean"
autowire="constructor">
</bean>
<bean id="integerBean" class="org.springframework.tests.sample.beans.GenericIntegerBean">
<property name="genericProperty" value="10"/>
<property name="genericListProperty">
<list>
<value>20</value>
<value>30</value>
</list>
</property>
</bean>
<bean id="setOfIntegerBean" class="org.springframework.tests.sample.beans.GenericSetOfIntegerBean">
<property name="genericProperty" value="10"/>
<property name="genericListProperty">
<list>
<value>20</value>
<value>30</value>
</list>
</property>
</bean>
<bean id="setBean" class="org.springframework.beans.factory.support.BeanFactoryGenericsTests$UrlSet">
<property name="urlNames" value="http://www.springframework.org"/>
</bean>
</beans>

View File

@@ -0,0 +1,22 @@
<?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-4.1.xsd">
<bean id="abstractBean" class="org.springframework.beans.factory.support.LookupMethodTests$AbstractBean">
<lookup-method name="get"/> <!-- applying to overloaded methods, and based on return type since no bean name is given -->
<lookup-method name="getOneArgument" bean="testBean"/>
<lookup-method name="getTwoArguments" bean="testBean"/>
</bean>
<bean id="extendedBean" parent="abstractBean">
<lookup-method name="getOneArgument" bean="jedi"/>
</bean>
<bean id="testBean" class="org.springframework.tests.sample.beans.TestBean" scope="prototype"/>
<bean id="jedi" class="org.springframework.tests.sample.beans.TestBean" scope="prototype" autowire-candidate="false">
<property name="jedi" value="true"/>
</bean>
</beans>

View File

@@ -0,0 +1,3 @@
testBean.(class)=org.springframework.tests.sample.beans.TestBean
testBean.$0=Rob Harrop
testBean.$1=23

View File

@@ -0,0 +1,5 @@
sally.(class)=org.springframework.tests.sample.beans.TestBean
sally.name=Sally
rob.(class)=org.springframework.tests.sample.beans.TestBean
rob.$0(ref)=sally

View File

@@ -0,0 +1,93 @@
<?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.xsd"
default-lazy-init="true">
<bean name="spring-init" class="org.springframework.beans.factory.support.security.support.InitBean"/>
<bean name="spring-destroy" class="org.springframework.beans.factory.support.security.support.DestroyBean"/>
<bean name="custom-init" class="org.springframework.beans.factory.support.security.support.CustomCallbackBean"
init-method="init"/>
<bean name="custom-destroy" class="org.springframework.beans.factory.support.security.support.CustomCallbackBean"
destroy-method="destroy"/>
<bean name="spring-factory" class="org.springframework.beans.factory.support.security.support.CustomFactoryBean"/>
<bean name="custom-static-factory-method" class="org.springframework.beans.factory.support.security.support.FactoryBean" factory-method="makeStaticInstance"/>
<bean name="factory-bean" class="org.springframework.beans.factory.support.security.support.FactoryBean"/>
<bean name="custom-factory-method" factory-bean="factory-bean" factory-method="makeInstance"/>
<bean name="constructor" class="org.springframework.beans.factory.support.security.support.ConstructorBean"/>
<bean name="working-factory-method" class="org.springframework.beans.factory.support.security.support.FactoryBean" factory-method="protectedStaticInstance"/>
<bean name="container-execution" class="org.springframework.beans.factory.support.security.support.ConstructorBean">
<constructor-arg ref="working-factory-method"/>
</bean>
<bean name="property-injection" class="org.springframework.beans.factory.support.security.support.PropertyBean">
<property name="securityProperty" value="value"/>
</bean>
<bean name="working-property-injection" class="org.springframework.beans.factory.support.security.support.PropertyBean">
<property name="property">
<array>
<ref bean="working-factory-method"/>
</array>
</property>
</bean>
<bean name="privileged-static-factory-method" class="java.lang.System" factory-method="getProperties"/>
<!-- check trusted beans -->
<bean name="trusted-spring-callbacks" class="org.springframework.beans.factory.support.security.CallbacksSecurityTests$NonPrivilegedSpringCallbacksBean">
<constructor-arg value="user1"/>
</bean>
<bean name="trusted-custom-init-destroy" class="org.springframework.beans.factory.support.security.CallbacksSecurityTests$NonPrivilegedBean"
init-method="init" destroy-method="destroy">
<constructor-arg value="user1"/>
</bean>
<bean name="trusted-spring-factory" class="org.springframework.beans.factory.support.security.CallbacksSecurityTests$NonPrivilegedFactoryBean">
<constructor-arg value="user1"/>
</bean>
<bean name="trusted-static-factory-method" class="org.springframework.beans.factory.support.security.CallbacksSecurityTests$NonPrivilegedFactory"
factory-method="makeStaticInstance">
<constructor-arg value="user1"/>
</bean>
<bean name="trusted-factory-bean" class="org.springframework.beans.factory.support.security.CallbacksSecurityTests$NonPrivilegedFactory">
<constructor-arg value="user1"/>
</bean>
<bean name="trusted-factory-method" factory-bean="trusted-factory-bean" factory-method="makeInstance"/>
<bean name="trusted-property-injection" class="org.springframework.beans.factory.support.security.CallbacksSecurityTests$NonPrivilegedBean">
<constructor-arg value="user1"/>
<property name="property" value="value"/>
</bean>
<bean name="trusted-working-property-injection" class="org.springframework.beans.factory.support.security.CallbacksSecurityTests$NonPrivilegedBean">
<constructor-arg value="user1"/>
<property name="property">
<map>
<entry key-ref="trusted-property-injection" value-ref="trusted-factory-method"/>
</map>
</property>
<property name="listProperty">
<list>
<value>foo</value>
<value>bar</value>
</list>
</property>
</bean>
</beans>

View File

@@ -0,0 +1,3 @@
grant {
permission java.security.AllPermission;
};

View File

@@ -0,0 +1,2 @@
testBean.(class)=org.springframework.tests.sample.beans.TestBean
testBean.$0=Rob Harrop

View File

@@ -0,0 +1,16 @@
<?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.1.xsd">
<bean id="testBean" class="org.springframework.tests.sample.beans.TestBean">
<property name="name" value="topLevel"/>
</bean>
<beans>
<bean id="testBean" class="org.springframework.tests.sample.beans.TestBean">
<property name="name" value="nested"/>
</bean>
</beans>
</beans>

View File

@@ -0,0 +1,15 @@
<?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.1.xsd">
<bean id="testBean" class="org.springframework.tests.sample.beans.TestBean">
<property name="name" value="original"/>
</bean>
<!-- STS should raise an error for this duplicate id -->
<bean id="testBean" class="org.springframework.tests.sample.beans.TestBean">
<property name="name" value="duplicate"/>
</bean>
</beans>

View File

@@ -0,0 +1,33 @@
<?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.1.xsd"
default-autowire-candidates="foo*">
<bean id="fooRepository" class="java.lang.Object"/>
<bean id="fooService" class="java.lang.Object"/>
<bean id="other" class="java.lang.Object"/>
<beans default-autowire-candidates="*Service">
<bean id="barService" class="java.lang.Object"/>
<bean id="fooController" class="java.lang.Object"/>
<beans default-autowire-candidates="*Repository">
<bean id="bizRepository" class="java.lang.Object"/>
<bean id="bizService" class="java.lang.Object"/>
</beans>
<beans> <!-- should inherit enclosing beans' defaults -->
<bean id="bazService" class="java.lang.Object"/>
<bean id="random" class="java.lang.Object"/>
<bean id="fooComponent" class="java.lang.Object"/>
<bean id="fRepository" class="java.lang.Object"/>
</beans>
<beans default-autowire-candidates="*Component">
<bean id="aComponent" class="java.lang.Object"/>
<bean id="someService" class="java.lang.Object"/>
</beans>
</beans>
</beans>

View File

@@ -0,0 +1,16 @@
<?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.1.xsd">
<bean id="foo" class="java.lang.Object"/>
<beans default-autowire="constructor">
<bean id="bar" class="java.lang.Object"/>
<beans>
<bean id="baz" class="java.lang.Object"/>
</beans>
</beans>
</beans>

View File

@@ -0,0 +1,22 @@
<?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.1.xsd"
default-init-method="initMethod1"
default-destroy-method="destroyMethod1">
<bean id="beanA" class="org.springframework.beans.factory.xml.InitDestroyBean"/>
<beans default-init-method="initMethod2" default-destroy-method="destroyMethod2">
<bean id="beanB" class="org.springframework.beans.factory.xml.InitDestroyBean"/>
<beans default-init-method="initMethod3" default-destroy-method="destroyMethod3">
<bean id="beanC" class="org.springframework.beans.factory.xml.InitDestroyBean"/>
</beans>
<beans> <!-- should fall back to outer defaults (initMethod2 and destroyMethod2) -->
<bean id="beanD" class="org.springframework.beans.factory.xml.InitDestroyBean"/>
</beans>
</beans>
</beans>

View File

@@ -0,0 +1,29 @@
<?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.1.xsd">
<!-- lazy == false (based on default XSD values) -->
<bean id="foo" class="java.lang.Object"/>
<beans default-lazy-init="true">
<!-- lazy == true (explicit default specified) -->
<bean id="bar" class="java.lang.Object"/>
</beans>
<beans default-lazy-init="false">
<!-- lazy == false (explicit default specified) -->
<bean id="baz" class="java.lang.Object"/>
</beans>
<beans default-lazy-init="true">
<!-- lazy == true (explicit default specified) -->
<bean id="biz" class="java.lang.Object"/>
<beans>
<!-- lazy == true (inherit enclosing <beans> defaults -->
<bean id="buz" class="java.lang.Object"/>
</beans>
</beans>
</beans>

View File

@@ -0,0 +1,47 @@
<?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.1.xsd"
default-merge="false">
<bean id="abstractTestBean" class="org.springframework.tests.sample.beans.TestBean" abstract="true">
<property name="someList">
<list>
<value>alpha</value>
<value>bravo</value>
</list>
</property>
</bean>
<bean id="topLevelConcreteTestBean" parent="abstractTestBean">
<property name="someList">
<list>
<value>charlie</value>
<value>delta</value>
</list>
</property>
</bean>
<beans default-merge="true">
<bean id="firstLevelNestedTestBean" parent="topLevelConcreteTestBean">
<property name="someList">
<list>
<value>echo</value>
<value>foxtrot</value>
</list>
</property>
</bean>
<beans>
<bean id="secondLevelNestedTestBean" parent="firstLevelNestedTestBean">
<property name="someList">
<list>
<value>golf</value>
<value>hotel</value>
</list>
</property>
</bean>
</beans>
</beans>
</beans>

View File

@@ -0,0 +1,19 @@
<?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.1.xsd">
<bean id="foo" class="java.lang.String"/>
<beans profile="dev">
<!-- should override the 'foo' bean above when the 'dev' profile is active -->
<bean name="foo" class="java.lang.Integer">
<constructor-arg value="42"/>
</bean>
<!-- should only be available when the 'dev' profile is active -->
<bean name="devOnlyBean" class="java.lang.Object"/>
</beans>
</beans>

View File

@@ -0,0 +1,13 @@
<?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.1.xsd">
<beans profile="custom-default">
<bean id="foo" class="java.lang.String"/>
</beans>
<beans profile="other">
<!-- does not contain bean 'foo' -->
</beans>
</beans>

View File

@@ -0,0 +1,9 @@
<?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.1.xsd"
profile="dev,default">
<!-- bean should be processed if dev OR no profile is defined -->
<bean id="foo" class="java.lang.String"/>
</beans>

View File

@@ -0,0 +1,13 @@
<?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.1.xsd">
<beans profile="default">
<bean id="foo" class="java.lang.String"/>
</beans>
<beans profile="other">
<!-- does not contain bean 'foo' -->
</beans>
</beans>

View File

@@ -0,0 +1,9 @@
<?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.1.xsd"
profile="dev">
<bean id="foo" class="java.lang.String"/>
</beans>

View File

@@ -0,0 +1,9 @@
<?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.1.xsd"
profile="dev,prod">
<bean id="foo" class="java.lang.String"/>
</beans>

View File

@@ -0,0 +1,9 @@
<?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.1.xsd"
profile="!dev,prod">
<bean id="foo" class="java.lang.String"/>
</beans>

View File

@@ -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-3.1.xsd">
<bean id="foo" class="java.lang.String"/>
</beans>

View File

@@ -0,0 +1,9 @@
<?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.1.xsd"
profile="!dev">
<bean id="foo" class="java.lang.String"/>
</beans>

View File

@@ -0,0 +1,9 @@
<?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.1.xsd"
profile="prod">
<bean id="foo" class="java.lang.String"/>
</beans>

View File

@@ -0,0 +1,9 @@
<?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.1.xsd"
profile="dev prod">
<bean id="foo" class="java.lang.String"/>
</beans>

View File

@@ -0,0 +1,9 @@
<?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.1.xsd"
profile="unknown">
<bean id="foo" class="java.lang.String"/>
</beans>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<bean id="rob" class="org.springframework.tests.sample.beans.TestBean" scope="prototype" autowire="constructor"/>
<bean id="sally" class="org.springframework.tests.sample.beans.TestBean" scope="prototype"/>
<bean id="props1" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<property name="properties">
<value>name=props1</value>
</property>
</bean>
<bean id="props2" class="org.springframework.beans.factory.config.PropertiesFactoryBean" autowire-candidate="false">
<property name="properties">
<value>name=props2</value>
</property>
</bean>
</beans>

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<bean id="rob" class="org.springframework.tests.sample.beans.TestBean" autowire="byType"/>
<bean id="sally" class="org.springframework.tests.sample.beans.TestBean"/>
<bean id="props1" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<property name="properties">
<value>name=props1</value>
</property>
</bean>
<bean id="props2" class="org.springframework.beans.factory.config.PropertiesFactoryBean" autowire-candidate="false">
<property name="properties">
<value>name=props2</value>
</property>
</bean>
<bean class="org.springframework.beans.factory.xml.CountingFactory">
<property name="testBean" ref="rob"/>
</bean>
</beans>

View File

@@ -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"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"
default-autowire-candidates="">
<bean id="rob" class="org.springframework.tests.sample.beans.TestBean" autowire="byType"/>
<bean id="sally" class="org.springframework.tests.sample.beans.TestBean" autowire-candidate="true"/>
<bean id="props1" class="org.springframework.beans.factory.config.PropertiesFactoryBean" autowire-candidate="true">
<property name="properties">
<value>name=props1</value>
</property>
</bean>
<bean id="props2" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<property name="properties">
<value>name=props2</value>
</property>
</bean>
<bean class="org.springframework.beans.factory.xml.CountingFactory">
<property name="testBean" ref="rob"/>
</bean>
</beans>

View File

@@ -0,0 +1,33 @@
<?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.5.xsd"
default-autowire-candidates="props*,*ly">
<bean id="rob" class="org.springframework.tests.sample.beans.TestBean" autowire="byType"/>
<bean id="sally" class="org.springframework.tests.sample.beans.TestBean"/>
<bean id="props1" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<property name="properties">
<value>name=props1</value>
</property>
</bean>
<bean id="props2" class="org.springframework.beans.factory.config.PropertiesFactoryBean" autowire-candidate="false">
<property name="properties">
<value>name=props2</value>
</property>
</bean>
<bean id="someProps" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<property name="properties">
<value>name=someProps</value>
</property>
</bean>
<bean class="org.springframework.beans.factory.xml.CountingFactory">
<property name="testBean" ref="rob"/>
</bean>
</beans>

View File

@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans default-lazy-init="true" default-autowire="constructor" default-merge="true"
default-init-method="myInit" default-destroy-method="myDestroy">
<import resource="beanEventsImported.xml"/>
<alias name="testBean" alias="testBeanAlias1"/>
<alias name="testBean" alias="testBeanAlias2"/>
<bean id="testBean" class="org.springframework.tests.sample.beans.TestBean">
<constructor-arg type="java.lang.String" value="Rob Harrop"/>
<property name="friends">
<ref bean="testBean2"/>
</property>
<property name="doctor">
<bean class="org.springframework.tests.sample.beans.NestedTestBean">
<constructor-arg type="java.lang.String" value="ACME"/>
</bean>
</property>
</bean>
<bean id="testBean2" class="org.springframework.tests.sample.beans.TestBean">
<property name="name" value="Juergen Hoeller"/>
<property name="spouse">
<bean class="org.springframework.tests.sample.beans.TestBean">
<property name="name" value="Eva Schallmeiner"/>
</bean>
</property>
</bean>
</beans>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
</beans>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<bean class="org.springframework.beans.factory.xml.GeneratedNameBean">
<property name="child">
<bean class="org.springframework.beans.factory.xml.GeneratedNameBean"/>
</property>
</bean>
<bean class="org.springframework.beans.factory.xml.GeneratedNameBean">
<property name="child">
<bean class="org.springframework.beans.factory.xml.GeneratedNameBean"/>
</property>
</bean>
</beans>

View File

@@ -0,0 +1,205 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<bean id="parentWithList" class="org.springframework.tests.sample.beans.TestBean">
<property name="someList">
<list>
<value>Rob Harrop</value>
<value>Rod Johnson</value>
</list>
</property>
</bean>
<bean id="childWithList" parent="parentWithList">
<property name="someList">
<list merge="true">
<value>Juergen Hoeller</value>
</list>
</property>
</bean>
<bean id="childWithListOfRefs" parent="parentWithList">
<property name="someList">
<list merge="true">
<bean class="org.springframework.tests.sample.beans.TestBean"/>
</list>
</property>
</bean>
<bean id="parentWithSet" class="org.springframework.tests.sample.beans.TestBean">
<property name="someSet">
<set>
<value>Rob Harrop</value>
</set>
</property>
</bean>
<bean id="childWithSet" parent="parentWithSet">
<property name="someSet">
<set merge="true">
<value>Sally Greenwood</value>
</set>
</property>
</bean>
<bean id="childWithSetOfRefs" parent="parentWithSet">
<property name="someSet">
<set merge="true">
<bean class="org.springframework.tests.sample.beans.TestBean">
<property name="name" value="Sally"/>
</bean>
</set>
</property>
</bean>
<bean id="parentWithMap" class="org.springframework.tests.sample.beans.TestBean">
<property name="someMap">
<map>
<entry key="Rob" value="Sall"/>
<entry key="Juergen" value="Eva"/>
</map>
</property>
</bean>
<bean id="childWithMap" parent="parentWithMap">
<property name="someMap">
<map merge="true">
<entry key="Rod" value="Kerry"/>
<entry key="Rob" value="Sally"/>
</map>
</property>
</bean>
<bean id="childWithMapOfRefs" parent="parentWithMap">
<property name="someMap">
<map merge="true">
<entry key="Rob">
<bean class="org.springframework.tests.sample.beans.TestBean">
<property name="name" value="Sally"/>
</bean>
</entry>
</map>
</property>
</bean>
<bean id="parentWithProps" class="org.springframework.tests.sample.beans.TestBean">
<property name="someProperties">
<props>
<prop key="Rob">Sall</prop>
<prop key="Rod">Kerry</prop>
</props>
</property>
</bean>
<bean id="childWithProps" parent="parentWithProps">
<property name="someProperties">
<props merge="true">
<prop key="Juergen">Eva</prop>
<prop key="Rob">Sally</prop>
</props>
</property>
</bean>
<bean id="parentWithListInConstructor" class="org.springframework.tests.sample.beans.TestBean">
<constructor-arg index="0">
<list>
<value>Rob Harrop</value>
<value>Rod Johnson</value>
</list>
</constructor-arg>
</bean>
<bean id="childWithListInConstructor" parent="parentWithListInConstructor">
<constructor-arg index="0">
<list merge="true">
<value>Juergen Hoeller</value>
</list>
</constructor-arg>
</bean>
<bean id="childWithListOfRefsInConstructor" parent="parentWithListInConstructor">
<constructor-arg index="0">
<list merge="true">
<bean class="org.springframework.tests.sample.beans.TestBean"/>
</list>
</constructor-arg>
</bean>
<bean id="parentWithSetInConstructor" class="org.springframework.tests.sample.beans.TestBean">
<constructor-arg index="0">
<set>
<value>Rob Harrop</value>
</set>
</constructor-arg>
</bean>
<bean id="childWithSetInConstructor" parent="parentWithSetInConstructor">
<constructor-arg index="0">
<set merge="true">
<value>Sally Greenwood</value>
</set>
</constructor-arg>
</bean>
<bean id="childWithSetOfRefsInConstructor" parent="parentWithSetInConstructor">
<constructor-arg index="0">
<set merge="true">
<bean class="org.springframework.tests.sample.beans.TestBean">
<property name="name" value="Sally"/>
</bean>
</set>
</constructor-arg>
</bean>
<bean id="parentWithMapInConstructor" class="org.springframework.tests.sample.beans.TestBean">
<constructor-arg index="0">
<map>
<entry key="Rob" value="Sall"/>
<entry key="Juergen" value="Eva"/>
</map>
</constructor-arg>
</bean>
<bean id="childWithMapInConstructor" parent="parentWithMapInConstructor">
<constructor-arg index="0">
<map merge="true">
<entry key="Rod" value="Kerry"/>
<entry key="Rob" value="Sally"/>
</map>
</constructor-arg>
</bean>
<bean id="childWithMapOfRefsInConstructor" parent="parentWithMapInConstructor">
<constructor-arg index="0">
<map merge="true">
<entry key="Rob">
<bean class="org.springframework.tests.sample.beans.TestBean">
<property name="name" value="Sally"/>
</bean>
</entry>
</map>
</constructor-arg>
</bean>
<bean id="parentWithPropsInConstructor" class="org.springframework.tests.sample.beans.TestBean">
<constructor-arg index="0">
<props>
<prop key="Rob">Sall</prop>
<prop key="Rod">Kerry</prop>
</props>
</constructor-arg>
</bean>
<bean id="childWithPropsInConstructor" parent="parentWithPropsInConstructor">
<constructor-arg index="0">
<props merge="true">
<prop key="Juergen">Eva</prop>
<prop key="Rob">Sally</prop>
</props>
</constructor-arg>
</bean>
</beans>

View File

@@ -0,0 +1,411 @@
<?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.2.xsd">
<bean id="jenny" class="org.springframework.tests.sample.beans.TestBean">
<property name="name"><value>Jenny</value></property>
<property name="age"><value>30</value></property>
<property name="spouse">
<!-- Could use id and href -->
<ref bean="david"/>
</property>
</bean>
<bean id="david" class="org.springframework.tests.sample.beans.TestBean">
<description>
Simple bean, without any collections.
</description>
<property name="name">
<description>The name of the user</description>
<value>David</value>
</property>
<property name="age"><value>27</value></property>
</bean>
<bean id="rod" class="org.springframework.tests.sample.beans.TestBean">
<property name="name"><value>Rod</value></property>
<property name="age"><value>32</value></property>
<property name="friends">
<description>List of Rod's friends</description>
<list>
<ref bean="jenny"/>
<ref bean="david"/>
</list>
</property>
</bean>
<bean id="pJenny" class="org.springframework.tests.sample.beans.DerivedTestBean" scope="prototype">
<property name="name"><value>Jenny</value></property>
<property name="age"><value>30</value></property>
<property name="spouse">
<ref bean="david"/>
</property>
</bean>
<bean id="pDavid" class="org.springframework.tests.sample.beans.DerivedTestBean" scope="prototype">
<property name="name"><value>David</value></property>
<property name="age"><value>27</value></property>
<property name="actualSpouse" value="Jen"/>
</bean>
<bean id="pRod" class="org.springframework.tests.sample.beans.TestBean" scope="prototype">
<property name="name"><value>Rod</value></property>
<property name="age"><value>32</value></property>
<property name="friends">
<list>
<ref bean="pJenny"/>
<ref bean="pDavid"/>
</list>
</property>
</bean>
<!--
Try setting a collection property to a single value
-->
<bean id="loner" class="org.springframework.tests.sample.beans.TestBean">
<property name="name"><value>loner</value></property>
<property name="age"><value>26</value></property>
<property name="friends">
<list>
<description>My List</description>
<ref bean="david"/>
</list>
</property>
</bean>
<bean id="jumble" class="org.springframework.beans.factory.xml.MixedCollectionBean">
<property name="jumble">
<list>
<ref bean="david"/>
<value>literal</value>
<ref bean="jenny"/>
<idref bean="rod"/>
<array>
<ref bean="david"/>
<value>literal2</value>
</array>
</list>
</property>
</bean>
<bean id="jumble2" class="org.springframework.beans.factory.xml.MixedCollectionBean" lazy-init="true">
<property name="jumble">
<list>
<ref bean="david"/>
<value>literal</value>
<ref bean="jenny"/>
<idref bean="rod"/>
<idref bean="rod2"/>
</list>
</property>
</bean>
<bean id="verbose" class="org.springframework.tests.sample.beans.TestBean">
<property name="name"><value>verbose</value></property>
</bean>
<bean id="verbose2" class="org.springframework.tests.sample.beans.TestBean">
<property name="name"><idref bean="verbose"/></property>
</bean>
<bean id="verbose3" class="org.springframework.tests.sample.beans.TestBean">
<property name="name"><idref bean="verbose"/></property>
</bean>
<bean id="emptyMap" class="org.springframework.tests.sample.beans.HasMap">
<property name="map">
<map>
</map>
</property>
</bean>
<bean id="literalMap" class="org.springframework.tests.sample.beans.HasMap">
<property name="map">
<map>
<entry key="foo" value="bar"/>
<entry key="fi" value="fum"/>
<entry key="fa"><null/></entry>
</map>
</property>
</bean>
<bean id="mixedMap" class="org.springframework.tests.sample.beans.HasMap">
<property name="map">
<map value-type="java.lang.Integer">
<entry key-ref="fooKey">
<value type="java.lang.Integer">10</value>
</entry>
<entry>
<key>
<ref bean="jennyKey"/>
</key>
<ref bean="jenny"/>
</entry>
<entry>
<key>
<bean class="java.lang.Integer">
<constructor-arg value="5"/>
</bean>
</key>
<idref bean="david"/>
</entry>
<entry key="bar" value="100" value-type="java.lang.Long"/>
<entry key="baz" value="200"/>
</map>
</property>
</bean>
<!-- The <description> element below caused parsing exception prior to resolution of SPR-8563 -->
<bean id="mapWithDescriptionInEntry" class="org.springframework.tests.sample.beans.HasMap">
<property name="map">
<map>
<entry key="e1">
<description>A map entry with a description</description>
<value>v1</value>
</entry>
</map>
</property>
</bean>
<bean id="fooKey" class="java.lang.String">
<constructor-arg value="foo"/>
</bean>
<bean id="jennyKey" class="java.lang.String">
<constructor-arg value="jenny"/>
</bean>
<bean id="pMixedMap" class="org.springframework.tests.sample.beans.HasMap" scope="prototype">
<property name="map">
<map>
<entry key="foo" value="bar"/>
<entry key="jenny" value-ref="pJenny"/>
</map>
</property>
</bean>
<bean id="mixedMapWithList" class="org.springframework.tests.sample.beans.HasMap">
<property name="map">
<map>
<entry>
<key><null/></key>
<value>bar</value>
</entry>
<entry key="jenny"><ref bean="jenny"/></entry>
<entry key="list">
<list>
<value>zero</value>
<map>
<entry key="fo"><value>bar</value></entry>
<entry key="jen"><ref bean="jenny"/></entry>
</map>
<list>
<ref bean="jenny"/>
<value>ba</value>
</list>
<null/>
</list>
</entry>
<entry key="map">
<map>
<entry key="foo"><value>bar</value></entry>
<entry key="jenny"><ref bean="jenny"/></entry>
</map>
</entry>
</map>
</property>
</bean>
<bean id="emptySet" class="org.springframework.tests.sample.beans.HasMap">
<property name="set">
<set>
</set>
</property>
</bean>
<bean id="set" class="org.springframework.tests.sample.beans.HasMap">
<property name="set">
<set>
<value>bar</value>
<ref bean="jenny"/>
<null/>
</set>
</property>
</bean>
<bean id="concurrentSet" class="org.springframework.tests.sample.beans.HasMap">
<property name="concurrentSet">
<set>
<value>bar</value>
<ref bean="jenny"/>
<null/>
</set>
</property>
</bean>
<bean id="identityMap" class="org.springframework.tests.sample.beans.HasMap">
<property name="identityMap">
<map>
<entry key="foo" value="bar"/>
<entry key="jenny" value-ref="pJenny"/>
</map>
</property>
</bean>
<bean id="emptyProps" class="org.springframework.tests.sample.beans.HasMap">
<property name="props">
<props>
</props>
</property>
</bean>
<bean id="props" class="org.springframework.tests.sample.beans.HasMap">
<property name="props">
<props>
<prop key="foo">bar</prop>
<prop key="2">TWO</prop>
</props>
</property>
</bean>
<bean id="propsViaMap" class="org.springframework.tests.sample.beans.HasMap">
<property name="props">
<map>
<entry key="foo" value="bar"/>
<entry key="2" value="TWO"/>
</map>
</property>
</bean>
<bean id="objectArray" class="org.springframework.tests.sample.beans.HasMap">
<property name="objectArray">
<list>
<value>one</value>
<ref bean="jenny"/>
</list>
</property>
</bean>
<bean id="integerArray" class="org.springframework.tests.sample.beans.HasMap">
<property name="integerArray">
<list>
<value>0</value>
<value>1</value>
<value>2</value>
</list>
</property>
</bean>
<bean id="classArray" class="org.springframework.tests.sample.beans.HasMap">
<property name="classArray" value="java.lang.String,java.lang.Exception"/>
</bean>
<bean id="classList" class="org.springframework.tests.sample.beans.HasMap">
<property name="classList" value="java.lang.String,java.lang.Exception"/>
</bean>
<bean id="listFactory" class="org.springframework.beans.factory.config.ListFactoryBean">
<property name="sourceList">
<list>
<value>bar</value>
<value>jenny</value>
</list>
</property>
<property name="targetListClass">
<value>java.util.LinkedList</value>
</property>
</bean>
<bean id="pListFactory" class="org.springframework.beans.factory.config.ListFactoryBean">
<property name="sourceList">
<list>
<value>bar</value>
<value>jenny</value>
</list>
</property>
<property name="targetListClass">
<value>java.util.LinkedList</value>
</property>
<property name="singleton">
<value>true</value>
</property>
</bean>
<bean id="setFactory" class="org.springframework.beans.factory.config.SetFactoryBean">
<property name="sourceSet">
<set>
<value>bar</value>
<value>jenny</value>
</set>
</property>
<property name="targetSetClass">
<value>java.util.TreeSet</value>
</property>
</bean>
<bean id="pSetFactory" class="org.springframework.beans.factory.config.SetFactoryBean">
<property name="sourceSet">
<set>
<value>bar</value>
<value>jenny</value>
</set>
</property>
<property name="targetSetClass">
<value>java.util.TreeSet</value>
</property>
<property name="singleton">
<value>true</value>
</property>
</bean>
<bean id="mapFactory" class="org.springframework.beans.factory.config.MapFactoryBean">
<property name="sourceMap">
<map>
<entry key="foo"><value>bar</value></entry>
<entry key="jen"><value>jenny</value></entry>
</map>
</property>
<property name="targetMapClass">
<value>java.util.TreeMap</value>
</property>
</bean>
<bean id="pMapFactory" class="org.springframework.beans.factory.config.MapFactoryBean">
<property name="sourceMap">
<map>
<entry key="foo"><value>bar</value></entry>
<entry key="jen"><value>jenny</value></entry>
</map>
</property>
<property name="targetMapClass">
<value>java.util.TreeMap</value>
</property>
<property name="singleton">
<value>true</value>
</property>
</bean>
<bean id="setAndMap" class="org.springframework.beans.factory.xml.XmlBeanCollectionTests$MapAndSet">
<constructor-arg>
<map>
<description>My Map</description>
<entry key="key1" value="val1"/>
<entry key="key2" value="val2"/>
<entry key="key3" value="val3"/>
</map>
</constructor-arg>
</bean>
<bean id="enumSetFactory" class="org.springframework.beans.factory.config.SetFactoryBean">
<property name="sourceSet">
<set>
<description>My Set</description>
<value type="java.lang.String">ONE</value>
<value type="java.lang.String">TWO</value>
</set>
</property>
</bean>
</beans>

View File

@@ -0,0 +1,78 @@
<?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">
<bean id="testBean" class="org.springframework.tests.sample.beans.TestBean">
<property name="someList">
<list value-type="java.lang.Integer">
<value>1</value>
<value>2</value>
<value>3</value>
</list>
</property>
<property name="someSet">
<set value-type="java.lang.Integer">
<value>1</value>
<value>2</value>
<value>3</value>
</set>
</property>
<property name="someMap">
<map key-type="java.lang.Integer" value-type="java.lang.Boolean">
<entry key="1" value="true"/>
<entry key="2" value="false"/>
<entry key="3" value="false"/>
<entry key="4" value="true"/>
</map>
</property>
</bean>
<bean id="testBean2" class="org.springframework.tests.sample.beans.TestBean">
<property name="someMap">
<map key-type="java.lang.Integer" value-type="java.lang.Boolean">
<entry>
<key>
<value>1</value>
</key>
<value>true</value>
</entry>
<entry>
<key>
<value>2</value>
</key>
<value>false</value>
</entry>
<entry>
<key>
<value>3</value>
</key>
<value>false</value>
</entry>
<entry>
<key>
<value>4</value>
</key>
<value>true</value>
</entry>
</map>
</property>
</bean>
<bean id="jumble" class="org.springframework.beans.factory.xml.MixedCollectionBean">
<property name="jumble">
<list value-type="java.lang.String">
<value>literal</value>
<array value-type="java.lang.Integer">
<value>2</value>
<value>4</value>
</array>
<array value-type="int">
<value>3</value>
<value>5</value>
</array>
</list>
</property>
</bean>
</beans>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans default-init-method="init" default-destroy-method="destroy">
<bean id="lifecycleAware" class="org.springframework.beans.factory.xml.DefaultLifecycleMethodsTests$LifecycleAwareBean"/>
<bean id="lifecycleMethodsDisabled" class="org.springframework.beans.factory.xml.DefaultLifecycleMethodsTests$LifecycleAwareBean"
init-method="" destroy-method=""/>
<bean id="overrideLifecycleMethods" class="org.springframework.beans.factory.xml.DefaultLifecycleMethodsTests$LifecycleAwareBean"
init-method="customInit" destroy-method="customDestroy"/>
</beans>

View File

@@ -0,0 +1,159 @@
<?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">
<bean id="default" class="org.springframework.beans.factory.xml.FactoryMethods"
factory-method="defaultInstance">
<!-- No constructor-arg elements -->
<property name="stringValue"><value>setterString</value></property>
</bean>
<bean id="defaultTestBean" factory-bean="default" factory-method="getTestBean"
init-method="haveBirthday" destroy-method="destroy"/>
<bean id="defaultTestBeanWithInvalidDestroyMethod" factory-bean="default" factory-method="getTestBean"
init-method="haveBirthday" destroy-method="xxx" lazy-init="true"/>
<bean id="defaultTestBean.protected" factory-bean="default" factory-method="protectedGetTestBean"
init-method="haveBirthday" destroy-method="destroy"/>
<bean id="defaultTestBean.private" factory-bean="default" factory-method="privateGetTestBean"
init-method="haveBirthday" destroy-method="destroy"/>
<bean id="testBeanOnly" class="org.springframework.beans.factory.xml.FactoryMethods"
factory-method="newInstance">
<constructor-arg><ref bean="juergen"/></constructor-arg>
</bean>
<bean id="null" class="org.springframework.beans.factory.xml.FactoryMethods"
factory-method="nullInstance"/>
<bean id="nullWithProperty" class="org.springframework.beans.factory.xml.FactoryMethods"
factory-method="nullInstance" init-method="getName" scope="prototype">
<property name="stringValue"><value>setterString</value></property>
</bean>
<bean id="full" class="org.springframework.beans.factory.xml.FactoryMethods"
factory-method="newInstance">
<constructor-arg index="0"><ref bean="juergen"/></constructor-arg>
<constructor-arg index="1"><value>27</value></constructor-arg>
<constructor-arg index="2"><value>gotcha</value></constructor-arg>
</bean>
<bean id="fullWithNull" class="org.springframework.beans.factory.xml.FactoryMethods"
factory-method="newInstance" lazy-init="true">
<constructor-arg index="2" type="java.lang.Integer"><null/></constructor-arg>
<constructor-arg index="0"><ref bean="juergen"/></constructor-arg>
<constructor-arg index="1"><value>27</value></constructor-arg>
</bean>
<bean id="fullWithGenericNull" class="org.springframework.beans.factory.xml.FactoryMethods"
factory-method="newInstance" lazy-init="true">
<constructor-arg type="java.lang.Integer"><null/></constructor-arg>
<constructor-arg><ref bean="juergen"/></constructor-arg>
<constructor-arg type="int"><value>27</value></constructor-arg>
</bean>
<bean id="fullWithNamedNull" class="org.springframework.beans.factory.xml.FactoryMethods"
factory-method="newInstance" lazy-init="true">
<constructor-arg name="something"><null/></constructor-arg>
<constructor-arg name="tb"><ref bean="juergen"/></constructor-arg>
<constructor-arg name="num"><value>27</value></constructor-arg>
</bean>
<bean id="fullWithAutowire" class="org.springframework.beans.factory.xml.FactoryMethods"
factory-method="newInstance" autowire="constructor">
<constructor-arg index="0" ref="juergen"/>
<constructor-arg index="1" value="27"/>
</bean>
<bean id="stringToBeAutowired" class="java.lang.String">
<constructor-arg value="gotchaAutowired"/>
</bean>
<bean id="defaultPrototype" class="org.springframework.beans.factory.xml.FactoryMethods"
scope="prototype" factory-method="defaultInstance">
<!-- No constructor-arg elements -->
<property name="stringValue"><value>setterString</value></property>
</bean>
<bean id="testBeanOnlyPrototype" class="org.springframework.beans.factory.xml.FactoryMethods"
factory-method="newInstance" scope="prototype">
<constructor-arg><ref bean="juergen"/></constructor-arg>
<property name="stringValue"><value>testBeanOnlyPrototypeDISetterString</value></property>
</bean>
<bean id="invalidPrototype" class="org.springframework.beans.factory.xml.FactoryMethods"
factory-method="nonExisting" scope="prototype">
<constructor-arg><ref bean="juergen"/></constructor-arg>
</bean>
<bean id="fullPrototype" class="org.springframework.beans.factory.xml.FactoryMethods"
factory-method="newInstance" scope="prototype">
<constructor-arg type="int"><value>27</value></constructor-arg>
<constructor-arg><value>gotcha</value></constructor-arg>
<constructor-arg><ref bean="juergen"/></constructor-arg>
</bean>
<bean id="noMatchPrototype" class="org.springframework.beans.factory.xml.FactoryMethods"
factory-method="newInstance" scope="prototype">
<constructor-arg index="0"><ref bean="juergen"/></constructor-arg>
<constructor-arg index="1"><value>27</value></constructor-arg>
<constructor-arg index="2"><value>gotcha</value></constructor-arg>
<constructor-arg index="3"><value>bogus</value></constructor-arg>
</bean>
<bean id="listInstance" class="org.springframework.beans.factory.xml.FactoryMethods"
factory-method="listInstance"/>
<bean id="juergen" class="org.springframework.tests.sample.beans.TestBean">
<property name="name"><value>Juergen</value></property>
</bean>
<!--
The class is the factory class, not the created class.
-->
<bean id="externalFactoryMethodWithoutArgs"
class="org.springframework.beans.factory.xml.TestBeanCreator"
factory-method="createTestBean">
</bean>
<bean id="externalFactoryMethodWithArgs" class="org.springframework.beans.factory.xml.TestBeanCreator"
factory-method="createTestBean">
<constructor-arg index="0"><value>Rod</value></constructor-arg>
<constructor-arg><value type="java.lang.Integer">33</value></constructor-arg>
</bean>
<bean id="instanceFactoryMethodWithoutArgs" factory-bean="instanceFactory" factory-method="defaultInstance"/>
<!-- Unnamed bean with factory-bean declaration -->
<bean factory-bean="instanceFactory" factory-method="defaultInstance"/>
<bean id="testBeanWithInnerFactoryMethod" class="org.springframework.tests.sample.beans.TestBean">
<property name="friends">
<list>
<!-- Unnamed bean with factory-bean declaration -->
<bean factory-bean="instanceFactory" factory-method="defaultInstance"/>
</list>
</property>
</bean>
<bean id="instanceFactory" class="org.springframework.beans.factory.xml.InstanceFactory" scope="singleton">
<property name="factoryBeanProperty"><value>instanceFactory</value></property>
</bean>
<bean name="javaMailSession" class="org.springframework.beans.factory.xml.MailSession"
factory-method="getDefaultInstance">
<constructor-arg>
<props>
<prop key="mail.smtp.auth">true</prop>
<prop key="mail.smtp.host"></prop>
<prop key="mail.smtp.port"></prop>
<prop key="mail.smtp.user">someuser</prop>
<prop key="mail.smtp.password">somepw</prop>
</props>
</constructor-arg>
</bean>
</beans>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans default-init-method="foo" default-destroy-method="bar">
<bean id="foo" class="org.springframework.beans.factory.xml.DefaultLifecycleMethodsTests$LifecycleAwareBean"/>
</beans>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<import resource="classpath:/org/springframework/beans/factory/xml/test.xml"/>
</beans>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<import resource="classpath*:/org/springframework/beans/factory/xml/test.xml"/>
</beans>

View File

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

View File

@@ -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.tests.sample.beans.TestBean"/>
<bean id="fooBean" class="org.springframework.tests.sample.beans.TestBean">
<property name="spouse">
<bean class="org.springframework.tests.sample.beans.TestBean"/>
</property>
<property name="friends">
<list>
<bean class="org.springframework.tests.sample.beans.TestBean"/>
<bean class="org.springframework.tests.sample.beans.TestBean"/>
</list>
</property>
</bean>
</beans>

View File

@@ -0,0 +1,47 @@
<?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:c="http://www.springframework.org/schema/c"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<!--
<bean id="simple1" class="org.springframework.tests.sample.beans.DummyBean">
<constructor-arg value="name"/>
</bean>
-->
<bean id="simple" class="org.springframework.tests.sample.beans.DummyBean" c:_="simple"/>
<!--
<bean id="simple1-ref" class="org.springframework.tests.sample.beans.DummyBean">
<constructor-arg ref="name"/>
</bean>
-->
<bean id="simple-ref" class="org.springframework.tests.sample.beans.DummyBean" c:_-ref="name"/>
<bean id="name" class="java.lang.String">
<constructor-arg type="java.lang.String" value="some-name" index="0"/>
</bean>
<!--
<bean id="name-value1" class="org.springframework.tests.sample.beans.TestBean">
<constructor-arg name="name" value="foo"/>
<constructor-arg name="age" value="10"/>
</bean>
-->
<bean id="name-value" class="org.springframework.tests.sample.beans.TestBean" c:age="10" c:name="name-value"/>
<!--
<bean id="name-ref1" class="org.springframework.tests.sample.beans.DummyBean">
<constructor-arg name="name" ref="name"/>
<constructor-arg name="spouse" ref="name-value"/>
</bean>
-->
<bean id="name-ref" class="org.springframework.tests.sample.beans.DummyBean" c:name-ref="name" c:spouse-ref="name-value"/>
<bean id="indexed-value" class="org.springframework.tests.sample.beans.DummyBean" c:_1="austria" c:_0="at" c:_2="10"/>
<bean id="indexed-ref" class="org.springframework.tests.sample.beans.DummyBean" c:_0-ref="name" c:_1-ref="name-value"/>
<bean id="beanWithRefConstructorArg" class="org.springframework.tests.sample.beans.DummyBean" c:nameRef="silly name" c:ageRef="10"/>
</beans>

View File

@@ -0,0 +1,10 @@
<?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.xsd">
<bean id="error" class="org.springframework.tests.sample.beans.TestBean" c:name="error-bean">
<constructor-arg name="name" value="error-bean"/>
</bean>
</beans>

View File

@@ -0,0 +1,23 @@
<?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:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="rob" class="org.springframework.tests.sample.beans.TestBean" p:name="Rob Harrop" p:spouse-ref="sally">
<property name="age" value="24"/>
</bean>
<bean id="sally" class="org.springframework.tests.sample.beans.TestBean" p:name="Sally Greenwood" p:spouse-ref="rob"/>
<bean id="sally2" class="org.springframework.tests.sample.beans.TestBean">
<property name="spouse">
<bean id="rob2" class="org.springframework.tests.sample.beans.TestBean" p:name="Rob Harrop" p:spouse-ref="sally2">
<property name="age" value="24"/>
</bean>
</property>
</bean>
<bean id="derivedSally" class="org.springframework.tests.sample.beans.DerivedTestBean" p:name="Sally Greenwood" p:spouseRef="r"/>
</beans>

View File

@@ -0,0 +1,13 @@
<?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:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="rob" class="org.springframework.tests.sample.beans.TestBean" p:name="Rob Harrop" p:spouse-ref="sally">
<property name="name" value="Rob Harrop"/>
</bean>
<bean id="sally" class="org.springframework.tests.sample.beans.TestBean" p:name="Sally Greenwood" p:spouse-ref="rob"/>
</beans>

View File

@@ -0,0 +1,127 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<bean id="validEmptyWithDescription" class="org.springframework.tests.sample.beans.TestBean">
<description>
I have no properties and I'm happy without them.
</description>
</bean>
<!--
Check automatic creation of alias, to allow for names that are illegal as XML ids.
-->
<bean id="aliased" class=" org.springframework.tests.sample.beans.TestBean " name="myalias">
<property name="name"><value>aliased</value></property>
</bean>
<alias name="aliased" alias="youralias"/>
<alias name="multiAliased" alias="alias3"/>
<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.tests.sample.beans.TestBean" name="aliasWithoutId1,aliasWithoutId2,aliasWithoutId3">
<property name="name"><value>aliased</value></property>
</bean>
<bean class="org.springframework.tests.sample.beans.TestBean">
<property name="name"><null/></property>
</bean>
<bean class="org.springframework.beans.factory.xml.DummyReferencer"/>
<bean class="org.springframework.beans.factory.xml.DummyReferencer"/>
<bean class="org.springframework.beans.factory.xml.DummyReferencer"/>
<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>
<property name="touchy"><value/></property>
</bean>
<bean id="roderick" parent="rod">
<property name="name"><value>Roderick<!-- a comment --></value></property>
<!-- Should inherit age -->
</bean>
<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 bean="rod"/></property>
<property name="touchy"><value></value></property>
</bean>
<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.tests.sample.beans.TestBean" scope="prototype">
<property name="name"><value>typeMismatch</value></property>
<property name="age"><value>34x</value></property>
<property name="spouse"><ref bean="rod"/></property>
</bean>
<!-- Test of lifecycle callbacks -->
<bean id="mustBeInitialized" class="org.springframework.tests.sample.beans.MustBeInitialized"/>
<bean id="lifecycle" class="org.springframework.tests.sample.beans.LifecycleBean"
init-method="declaredInitMethod">
<property name="initMethodDeclared"><value>true</value></property>
</bean>
<bean id="protectedLifecycle" class="org.springframework.beans.factory.xml.ProtectedLifecycleBean"
init-method="declaredInitMethod">
<property name="initMethodDeclared"><value>true</value></property>
</bean>
<!-- Factory beans are automatically treated differently -->
<bean id="singletonFactory" class="org.springframework.tests.sample.beans.factory.DummyFactory">
</bean>
<bean id="prototypeFactory" class="org.springframework.tests.sample.beans.factory.DummyFactory">
<property name="singleton"><value>false</value></property>
</bean>
<!-- Check that the circular reference resolution mechanism doesn't break
repeated references to the same FactoryBean -->
<bean id="factoryReferencer" class="org.springframework.beans.factory.xml.DummyReferencer">
<property name="testBean1"><ref bean="singletonFactory"/></property>
<property name="testBean2"><ref bean="singletonFactory"/></property>
<property name="dummyFactory"><ref bean="&amp;singletonFactory"/></property>
</bean>
<bean id="factoryReferencerWithConstructor" class="org.springframework.beans.factory.xml.DummyReferencer">
<constructor-arg><ref bean="&amp;singletonFactory"/></constructor-arg>
<property name="testBean1"><ref bean="singletonFactory"/></property>
<property name="testBean2"><ref bean="singletonFactory"/></property>
</bean>
<!-- Check that the circular reference resolution mechanism doesn't break
prototype instantiation -->
<bean id="prototypeReferencer" class="org.springframework.beans.factory.xml.DummyReferencer" scope="prototype">
<property name="testBean1"><ref bean="kathy"/></property>
<property name="testBean2"><ref bean="kathy"/></property>
</bean>
<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.tests.sample.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>
</beans>

View File

@@ -0,0 +1,197 @@
<?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-4.1.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.1.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.tests.sample.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/xml/util.properties"/>
</property>
</bean>
<bean id="constructedTestBean" class="org.springframework.tests.sample.beans.TestBean">
<constructor-arg index="0">
<util:property-path path="configuredBean.name"/>
</constructor-arg>
</bean>
<bean id="configuredBean" class="org.springframework.tests.sample.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:map id="mapWithTypes" map-class="org.springframework.util.LinkedCaseInsensitiveMap"
key-type="java.lang.String" value-type="org.springframework.tests.sample.beans.TestBean">
<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.tests.sample.beans.TestBean" scope="prototype">
<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="nestedShortcutCollections" class="org.springframework.tests.sample.beans.TestBean" scope="prototype">
<property name="stringArray" value="fooStr"/>
<property name="someList" value="foo"/>
<property name="someSet" value="bar"/>
</bean>
<bean id="nestedCustomTagBean" class="org.springframework.tests.sample.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.Thread$State.NEW"/>
<util:constant static-field="java.lang.Thread.State.RUNNABLE"/>
</set>
</property>
<property name="someMap">
<map>
<entry>
<key><value>min</value></key>
<util:constant static-field="org.springframework.tests.sample.beans.CustomEnum.VALUE_1"/>
</entry>
</map>
</property>
</bean>
<bean id="circularCollectionsBean" class="org.springframework.tests.sample.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.tests.sample.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/xml/util.properties"/>
<util:properties id="myScopedProperties"
location="classpath:/org/springframework/beans/factory/xml/util.properties,classpath:override.properties"
ignore-resource-not-found="true" scope="prototype"/>
<util:properties id="myLocalProperties">
<prop key="foo2">bar2</prop>
</util:properties>
<util:properties id="myMergedProperties"
location="classpath:/org/springframework/beans/factory/xml/util.properties">
<prop key="foo2">bar2</prop>
</util:properties>
<util:properties id="defaultLocalOverrideProperties"
location="classpath:/org/springframework/beans/factory/xml/util.properties">
<prop key="foo">local</prop>
<prop key="foo2">local2</prop>
</util:properties>
<util:properties id="trueLocalOverrideProperties"
location="classpath:/org/springframework/beans/factory/xml/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/xml/util.properties"
local-override="false">
<prop key="foo">local</prop>
<prop key="foo2">local2</prop>
</util:properties>
</beans>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This is a top level block comment
-->
<!-- here is a line comment -->
<!-- trying --> <!-- to trick --> <!--
the parser now --> <!-- <beans>
-->
<!-- more trickery--> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd"><!-- some nasty stuff -->
<beans>
<bean id="testBean" class="org.springframework.tests.sample.beans.TestBean"/>
</beans>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This is a top level block comment
-->
<!-- here is a line comment -->
<!-- trying --> <!-- to trick --> <!--
the parser now --> <!-- <beans>
-->
<!-- more trickery--><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"><!-- end -->
<bean id="testBean" class="org.springframework.tests.sample.beans.TestBean"/>
</beans>

View File

@@ -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.tests.sample.beans.TestBean">
<spring:meta key="foo" value="bar"/>
</spring:bean>
<spring:bean id="testBean2" class="org.springframework.tests.sample.beans.TestBean" parent="testBean1">
<spring:meta key="abc" value="123"/>
</spring:bean>
<spring:bean id="testBean3" class="org.springframework.tests.sample.beans.TestBean">
<spring:property name="name" value="Rob">
<spring:meta key="surname" value="Harrop"/>
</spring:property>
</spring:bean>
</spring:beans>