polishing .beans tests

This commit is contained in:
Chris Beams 2008-12-24 19:34:04 +00:00
parent 670bfd5ee2
commit 751daf95a1
83 changed files with 252 additions and 236 deletions

View File

@ -1,40 +0,0 @@
/*
* Copyright 2002-2005 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package common.beans.core;
/**
* Bean that changes state on a business invocation, so that
* we can check whether it's been invoked
* @author Rod Johnson
*/
public class SideEffectBean {
private int count;
public void setCount(int count) {
this.count = count;
}
public int getCount() {
return this.count;
}
public void doWork() {
++count;
}
}

View File

@ -31,6 +31,8 @@ import org.springframework.core.io.Resource;
import org.springframework.core.io.ResourceEditor; import org.springframework.core.io.ResourceEditor;
import test.beans.DerivedTestBean; import test.beans.DerivedTestBean;
import test.beans.ITestBean;
import test.beans.TestBean;
/** /**
* Unit tests for {@link BeanUtils}. * Unit tests for {@link BeanUtils}.

View File

@ -39,6 +39,9 @@ import org.springframework.core.io.Resource;
import org.springframework.core.io.UrlResource; import org.springframework.core.io.UrlResource;
import test.beans.GenericBean; import test.beans.GenericBean;
import test.beans.GenericIntegerBean;
import test.beans.GenericSetOfIntegerBean;
import test.beans.TestBean;
/** /**
* @author Juergen Hoeller * @author Juergen Hoeller

View File

@ -49,6 +49,10 @@ import org.springframework.util.StopWatch;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import test.beans.BooleanTestBean; import test.beans.BooleanTestBean;
import test.beans.ITestBean;
import test.beans.IndexedTestBean;
import test.beans.NumberTestBean;
import test.beans.TestBean;
/** /**
* @author Rod Johnson * @author Rod Johnson

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2007 the original author or authors. * Copyright 2002-2008 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -21,6 +21,8 @@ import static org.junit.Assert.*;
import org.junit.Test; import org.junit.Test;
import org.springframework.core.OverridingClassLoader; import org.springframework.core.OverridingClassLoader;
import test.beans.TestBean;
/** /**
* @author Juergen Hoeller * @author Juergen Hoeller
* @author Chris Beams * @author Chris Beams
@ -35,7 +37,7 @@ public final class CachedIntrospectionResultsTests {
assertTrue(CachedIntrospectionResults.classCache.containsKey(TestBean.class)); assertTrue(CachedIntrospectionResults.classCache.containsKey(TestBean.class));
ClassLoader child = new OverridingClassLoader(getClass().getClassLoader()); ClassLoader child = new OverridingClassLoader(getClass().getClassLoader());
Class<?> tbClass = child.loadClass("org.springframework.beans.TestBean"); Class<?> tbClass = child.loadClass("test.beans.TestBean");
assertFalse(CachedIntrospectionResults.classCache.containsKey(tbClass)); assertFalse(CachedIntrospectionResults.classCache.containsKey(tbClass));
CachedIntrospectionResults.acceptClassLoader(child); CachedIntrospectionResults.acceptClassLoader(child);
bw = new BeanWrapperImpl(tbClass); bw = new BeanWrapperImpl(tbClass);

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2005 the original author or authors. * Copyright 2002-2008 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2006 the original author or authors. * Copyright 2002-2008 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -39,7 +39,7 @@ import org.springframework.beans.factory.support.DefaultListableBeanFactory;
* @author Chris Beams * @author Chris Beams
* @since 2.0 * @since 2.0
*/ */
public class RequiredAnnotationBeanPostProcessorTests { public final class RequiredAnnotationBeanPostProcessorTests {
@Test @Test
public void testWithRequiredPropertyOmitted() { public void testWithRequiredPropertyOmitted() {

View File

@ -24,9 +24,10 @@ import junit.framework.Assert;
import org.springframework.beans.BeansException; import org.springframework.beans.BeansException;
import org.springframework.beans.PropertyBatchUpdateException; import org.springframework.beans.PropertyBatchUpdateException;
import org.springframework.beans.TestBean;
import org.springframework.beans.factory.config.ConfigurableBeanFactory; import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import test.beans.TestBean;
/** /**
* Subclasses must implement setUp() to initialize bean factory * Subclasses must implement setUp() to initialize bean factory
* and any other variables they need. * and any other variables they need.

View File

@ -18,7 +18,7 @@ package org.springframework.beans.factory;
import junit.framework.Assert; import junit.framework.Assert;
import org.springframework.beans.TestBean; import test.beans.TestBean;
/** /**
* @author Rod Johnson * @author Rod Johnson

View File

@ -26,15 +26,16 @@ import net.sf.cglib.proxy.NoOp;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.springframework.beans.ITestBean;
import org.springframework.beans.IndexedTestBean;
import org.springframework.beans.TestBean;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.support.StaticListableBeanFactory; import org.springframework.beans.factory.support.StaticListableBeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory; import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.ClassPathResource;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import test.beans.ITestBean;
import test.beans.IndexedTestBean;
import test.beans.TestBean;
/** /**
* @author Rod Johnson * @author Rod Johnson
* @author Juergen Hoeller * @author Juergen Hoeller

View File

@ -16,7 +16,7 @@
package org.springframework.beans.factory; package org.springframework.beans.factory;
import org.springframework.beans.TestBean; import test.beans.TestBean;
/** /**
* @author Juergen Hoeller * @author Juergen Hoeller

View File

@ -39,14 +39,11 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.junit.Test; import org.junit.Test;
import org.springframework.beans.BeansException; import org.springframework.beans.BeansException;
import org.springframework.beans.ITestBean;
import org.springframework.beans.MutablePropertyValues; import org.springframework.beans.MutablePropertyValues;
import org.springframework.beans.NestedTestBean;
import org.springframework.beans.NotWritablePropertyException; import org.springframework.beans.NotWritablePropertyException;
import org.springframework.beans.PropertyEditorRegistrar; import org.springframework.beans.PropertyEditorRegistrar;
import org.springframework.beans.PropertyEditorRegistry; import org.springframework.beans.PropertyEditorRegistry;
import org.springframework.beans.PropertyValue; import org.springframework.beans.PropertyValue;
import org.springframework.beans.TestBean;
import org.springframework.beans.TypeConverter; import org.springframework.beans.TypeConverter;
import org.springframework.beans.TypeMismatchException; import org.springframework.beans.TypeMismatchException;
import org.springframework.beans.factory.config.AutowireCapableBeanFactory; import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
@ -73,8 +70,9 @@ import org.springframework.core.io.UrlResource;
import org.springframework.util.StopWatch; import org.springframework.util.StopWatch;
import test.beans.DerivedTestBean; import test.beans.DerivedTestBean;
import test.beans.ITestBean;
import common.beans.core.SideEffectBean; import test.beans.NestedTestBean;
import test.beans.TestBean;
/** /**
* Tests properties population and autowire behavior. * Tests properties population and autowire behavior.
@ -452,7 +450,7 @@ public class DefaultListableBeanFactoryTests {
public void testPropertiesPopulationWithNullPrefix() { public void testPropertiesPopulationWithNullPrefix() {
DefaultListableBeanFactory lbf = new DefaultListableBeanFactory(); DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
Properties p = new Properties(); Properties p = new Properties();
p.setProperty("test.(class)", "org.springframework.beans.TestBean"); p.setProperty("test.(class)", TestBean.class.getName());
p.setProperty("test.name", "Tony"); p.setProperty("test.name", "Tony");
p.setProperty("test.age", "48"); p.setProperty("test.age", "48");
int count = (new PropertiesBeanDefinitionReader(lbf)).registerBeanDefinitions(p); int count = (new PropertiesBeanDefinitionReader(lbf)).registerBeanDefinitions(p);
@ -465,7 +463,7 @@ public class DefaultListableBeanFactoryTests {
String PREFIX = "beans."; String PREFIX = "beans.";
DefaultListableBeanFactory lbf = new DefaultListableBeanFactory(); DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
Properties p = new Properties(); Properties p = new Properties();
p.setProperty(PREFIX + "test.(class)", "org.springframework.beans.TestBean"); p.setProperty(PREFIX + "test.(class)", TestBean.class.getName());
p.setProperty(PREFIX + "test.name", "Tony"); p.setProperty(PREFIX + "test.name", "Tony");
p.setProperty(PREFIX + "test.age", "0x30"); p.setProperty(PREFIX + "test.age", "0x30");
int count = (new PropertiesBeanDefinitionReader(lbf)).registerBeanDefinitions(p, PREFIX); int count = (new PropertiesBeanDefinitionReader(lbf)).registerBeanDefinitions(p, PREFIX);
@ -479,10 +477,10 @@ public class DefaultListableBeanFactoryTests {
DefaultListableBeanFactory lbf = new DefaultListableBeanFactory(); DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
Properties p = new Properties(); Properties p = new Properties();
p.setProperty(PREFIX + "rod.(class)", "org.springframework.beans.TestBean"); p.setProperty(PREFIX + "rod.(class)", TestBean.class.getName());
p.setProperty(PREFIX + "rod.name", "Rod"); p.setProperty(PREFIX + "rod.name", "Rod");
p.setProperty(PREFIX + "kerry.(class)", "org.springframework.beans.TestBean"); p.setProperty(PREFIX + "kerry.(class)", TestBean.class.getName());
p.setProperty(PREFIX + "kerry.name", "Kerry"); p.setProperty(PREFIX + "kerry.name", "Kerry");
p.setProperty(PREFIX + "kerry.age", "35"); p.setProperty(PREFIX + "kerry.age", "35");
p.setProperty(PREFIX + "kerry.spouse(ref)", "rod"); p.setProperty(PREFIX + "kerry.spouse(ref)", "rod");
@ -502,7 +500,7 @@ public class DefaultListableBeanFactoryTests {
DefaultListableBeanFactory lbf = new DefaultListableBeanFactory(); DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
Properties p = new Properties(); Properties p = new Properties();
p.setProperty("tb.(class)", "org.springframework.beans.TestBean"); p.setProperty("tb.(class)", TestBean.class.getName());
p.setProperty("tb.someMap[my.key]", "my.value"); p.setProperty("tb.someMap[my.key]", "my.value");
int count = (new PropertiesBeanDefinitionReader(lbf)).registerBeanDefinitions(p); int count = (new PropertiesBeanDefinitionReader(lbf)).registerBeanDefinitions(p);
@ -520,7 +518,7 @@ public class DefaultListableBeanFactoryTests {
Properties p = new Properties(); Properties p = new Properties();
try { try {
p.setProperty(PREFIX + "kerry.(class)", "org.springframework.beans.TestBean"); p.setProperty(PREFIX + "kerry.(class)", TestBean.class.getName());
p.setProperty(PREFIX + "kerry.name", "Kerry"); p.setProperty(PREFIX + "kerry.name", "Kerry");
p.setProperty(PREFIX + "kerry.age", "35"); p.setProperty(PREFIX + "kerry.age", "35");
p.setProperty(PREFIX + "kerry.spouse(ref)", "rod"); p.setProperty(PREFIX + "kerry.spouse(ref)", "rod");
@ -569,7 +567,7 @@ public class DefaultListableBeanFactoryTests {
public void testPrototype() { public void testPrototype() {
DefaultListableBeanFactory lbf = new DefaultListableBeanFactory(); DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
Properties p = new Properties(); Properties p = new Properties();
p.setProperty("kerry.(class)", "org.springframework.beans.TestBean"); p.setProperty("kerry.(class)", TestBean.class.getName());
p.setProperty("kerry.age", "35"); p.setProperty("kerry.age", "35");
(new PropertiesBeanDefinitionReader(lbf)).registerBeanDefinitions(p); (new PropertiesBeanDefinitionReader(lbf)).registerBeanDefinitions(p);
TestBean kerry1 = (TestBean) lbf.getBean("kerry"); TestBean kerry1 = (TestBean) lbf.getBean("kerry");
@ -579,7 +577,7 @@ public class DefaultListableBeanFactoryTests {
lbf = new DefaultListableBeanFactory(); lbf = new DefaultListableBeanFactory();
p = new Properties(); p = new Properties();
p.setProperty("kerry.(class)", "org.springframework.beans.TestBean"); p.setProperty("kerry.(class)", TestBean.class.getName());
p.setProperty("kerry.(scope)", "prototype"); p.setProperty("kerry.(scope)", "prototype");
p.setProperty("kerry.age", "35"); p.setProperty("kerry.age", "35");
(new PropertiesBeanDefinitionReader(lbf)).registerBeanDefinitions(p); (new PropertiesBeanDefinitionReader(lbf)).registerBeanDefinitions(p);
@ -590,7 +588,7 @@ public class DefaultListableBeanFactoryTests {
lbf = new DefaultListableBeanFactory(); lbf = new DefaultListableBeanFactory();
p = new Properties(); p = new Properties();
p.setProperty("kerry.(class)", "org.springframework.beans.TestBean"); p.setProperty("kerry.(class)", TestBean.class.getName());
p.setProperty("kerry.(scope)", "singleton"); p.setProperty("kerry.(scope)", "singleton");
p.setProperty("kerry.age", "35"); p.setProperty("kerry.age", "35");
(new PropertiesBeanDefinitionReader(lbf)).registerBeanDefinitions(p); (new PropertiesBeanDefinitionReader(lbf)).registerBeanDefinitions(p);
@ -604,11 +602,11 @@ public class DefaultListableBeanFactoryTests {
public void testPrototypeCircleLeadsToException() { public void testPrototypeCircleLeadsToException() {
DefaultListableBeanFactory lbf = new DefaultListableBeanFactory(); DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
Properties p = new Properties(); Properties p = new Properties();
p.setProperty("kerry.(class)", "org.springframework.beans.TestBean"); p.setProperty("kerry.(class)", TestBean.class.getName());
p.setProperty("kerry.(singleton)", "false"); p.setProperty("kerry.(singleton)", "false");
p.setProperty("kerry.age", "35"); p.setProperty("kerry.age", "35");
p.setProperty("kerry.spouse", "*rod"); p.setProperty("kerry.spouse", "*rod");
p.setProperty("rod.(class)", "org.springframework.beans.TestBean"); p.setProperty("rod.(class)", TestBean.class.getName());
p.setProperty("rod.(singleton)", "false"); p.setProperty("rod.(singleton)", "false");
p.setProperty("rod.age", "34"); p.setProperty("rod.age", "34");
p.setProperty("rod.spouse", "*kerry"); p.setProperty("rod.spouse", "*kerry");
@ -628,7 +626,7 @@ public class DefaultListableBeanFactoryTests {
public void testPrototypeExtendsPrototype() { public void testPrototypeExtendsPrototype() {
DefaultListableBeanFactory lbf = new DefaultListableBeanFactory(); DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
Properties p = new Properties(); Properties p = new Properties();
p.setProperty("wife.(class)", "org.springframework.beans.TestBean"); p.setProperty("wife.(class)", TestBean.class.getName());
p.setProperty("wife.name", "kerry"); p.setProperty("wife.name", "kerry");
p.setProperty("kerry.(parent)", "wife"); p.setProperty("kerry.(parent)", "wife");
@ -642,7 +640,7 @@ public class DefaultListableBeanFactoryTests {
lbf = new DefaultListableBeanFactory(); lbf = new DefaultListableBeanFactory();
p = new Properties(); p = new Properties();
p.setProperty("wife.(class)", "org.springframework.beans.TestBean"); p.setProperty("wife.(class)", TestBean.class.getName());
p.setProperty("wife.name", "kerry"); p.setProperty("wife.name", "kerry");
p.setProperty("wife.(singleton)", "false"); p.setProperty("wife.(singleton)", "false");
p.setProperty("kerry.(parent)", "wife"); p.setProperty("kerry.(parent)", "wife");
@ -657,7 +655,7 @@ public class DefaultListableBeanFactoryTests {
lbf = new DefaultListableBeanFactory(); lbf = new DefaultListableBeanFactory();
p = new Properties(); p = new Properties();
p.setProperty("kerry.(class)", "org.springframework.beans.TestBean"); p.setProperty("kerry.(class)", TestBean.class.getName());
p.setProperty("kerry.(singleton)", "true"); p.setProperty("kerry.(singleton)", "true");
p.setProperty("kerry.age", "35"); p.setProperty("kerry.age", "35");
(new PropertiesBeanDefinitionReader(lbf)).registerBeanDefinitions(p); (new PropertiesBeanDefinitionReader(lbf)).registerBeanDefinitions(p);
@ -696,7 +694,7 @@ public class DefaultListableBeanFactoryTests {
public void testNameAlreadyBound() { public void testNameAlreadyBound() {
DefaultListableBeanFactory lbf = new DefaultListableBeanFactory(); DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
Properties p = new Properties(); Properties p = new Properties();
p.setProperty("kerry.(class)", "org.springframework.beans.TestBean"); p.setProperty("kerry.(class)", TestBean.class.getName());
p.setProperty("kerry.age", "35"); p.setProperty("kerry.age", "35");
(new PropertiesBeanDefinitionReader(lbf)).registerBeanDefinitions(p); (new PropertiesBeanDefinitionReader(lbf)).registerBeanDefinitions(p);
try { try {
@ -883,7 +881,7 @@ public class DefaultListableBeanFactoryTests {
public void testRegisterExistingSingletonWithReference() { public void testRegisterExistingSingletonWithReference() {
DefaultListableBeanFactory lbf = new DefaultListableBeanFactory(); DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
Properties p = new Properties(); Properties p = new Properties();
p.setProperty("test.(class)", "org.springframework.beans.TestBean"); p.setProperty("test.(class)", TestBean.class.getName());
p.setProperty("test.name", "Tony"); p.setProperty("test.name", "Tony");
p.setProperty("test.age", "48"); p.setProperty("test.age", "48");
p.setProperty("test.spouse(ref)", "singletonObject"); p.setProperty("test.spouse(ref)", "singletonObject");
@ -910,11 +908,11 @@ public class DefaultListableBeanFactoryTests {
public void testRegisterExistingSingletonWithNameOverriding() { public void testRegisterExistingSingletonWithNameOverriding() {
DefaultListableBeanFactory lbf = new DefaultListableBeanFactory(); DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
Properties p = new Properties(); Properties p = new Properties();
p.setProperty("test.(class)", "org.springframework.beans.TestBean"); p.setProperty("test.(class)", TestBean.class.getName());
p.setProperty("test.name", "Tony"); p.setProperty("test.name", "Tony");
p.setProperty("test.age", "48"); p.setProperty("test.age", "48");
p.setProperty("test.spouse(ref)", "singletonObject"); p.setProperty("test.spouse(ref)", "singletonObject");
p.setProperty("singletonObject.(class)", "org.springframework.beans.factory.config.PropertiesFactoryBean"); p.setProperty("singletonObject.(class)", org.springframework.beans.factory.config.PropertiesFactoryBean.class.getName());
(new PropertiesBeanDefinitionReader(lbf)).registerBeanDefinitions(p); (new PropertiesBeanDefinitionReader(lbf)).registerBeanDefinitions(p);
Object singletonObject = new TestBean(); Object singletonObject = new TestBean();
lbf.registerSingleton("singletonObject", singletonObject); lbf.registerSingleton("singletonObject", singletonObject);
@ -2348,5 +2346,28 @@ public class DefaultListableBeanFactoryTests {
return this.userName; return this.userName;
} }
} }
/**
* Bean that changes state on a business invocation, so that
* we can check whether it's been invoked
* @author Rod Johnson
*/
private static class SideEffectBean {
private int count;
public void setCount(int count) {
this.count = count;
}
public int getCount() {
return this.count;
}
public void doWork() {
++count;
}
}
} }

View File

@ -17,9 +17,10 @@
package org.springframework.beans.factory; package org.springframework.beans.factory;
import org.springframework.beans.BeansException; import org.springframework.beans.BeansException;
import org.springframework.beans.TestBean;
import org.springframework.beans.factory.config.AutowireCapableBeanFactory; import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
import test.beans.TestBean;
/** /**
* Simple factory to allow testing of FactoryBean support in AbstractBeanFactory. * Simple factory to allow testing of FactoryBean support in AbstractBeanFactory.
* Depending on whether its singleton property is set, it will return a singleton * Depending on whether its singleton property is set, it will return a singleton

View File

@ -21,10 +21,10 @@ import java.util.Arrays;
import junit.framework.TestCase; import junit.framework.TestCase;
import org.springframework.beans.BeansException; import org.springframework.beans.BeansException;
import org.springframework.beans.TestBean;
import org.springframework.beans.factory.support.DefaultSingletonBeanRegistry; import org.springframework.beans.factory.support.DefaultSingletonBeanRegistry;
import test.beans.DerivedTestBean; import test.beans.DerivedTestBean;
import test.beans.TestBean;
/** /**
* @author Juergen Hoeller * @author Juergen Hoeller

View File

@ -26,10 +26,6 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import org.junit.Test; import org.junit.Test;
import org.springframework.beans.ITestBean;
import org.springframework.beans.IndexedTestBean;
import org.springframework.beans.NestedTestBean;
import org.springframework.beans.TestBean;
import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.BeanCreationException;
import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.FactoryBean; import org.springframework.beans.factory.FactoryBean;
@ -38,6 +34,11 @@ import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.support.GenericBeanDefinition; import org.springframework.beans.factory.support.GenericBeanDefinition;
import org.springframework.beans.factory.support.RootBeanDefinition; import org.springframework.beans.factory.support.RootBeanDefinition;
import test.beans.ITestBean;
import test.beans.IndexedTestBean;
import test.beans.NestedTestBean;
import test.beans.TestBean;
/** /**
* @author Juergen Hoeller * @author Juergen Hoeller
* @author Mark Fisher * @author Mark Fisher

View File

@ -30,11 +30,12 @@ import org.springframework.beans.FatalBeanException;
import org.springframework.beans.MutablePropertyValues; import org.springframework.beans.MutablePropertyValues;
import org.springframework.beans.PropertyEditorRegistrar; import org.springframework.beans.PropertyEditorRegistrar;
import org.springframework.beans.PropertyEditorRegistry; import org.springframework.beans.PropertyEditorRegistry;
import org.springframework.beans.TestBean;
import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.support.RootBeanDefinition; import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.beans.propertyeditors.CustomDateEditor; import org.springframework.beans.propertyeditors.CustomDateEditor;
import test.beans.TestBean;
/** /**
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 31.07.2004 * @since 31.07.2004

View File

@ -20,11 +20,12 @@ import java.sql.Connection;
import junit.framework.TestCase; import junit.framework.TestCase;
import org.springframework.beans.TestBean;
import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader; import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.ClassPathResource;
import test.beans.TestBean;
/** /**
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 31.07.2004 * @since 31.07.2004

View File

@ -18,11 +18,12 @@ package org.springframework.beans.factory.config;
import junit.framework.TestCase; import junit.framework.TestCase;
import org.springframework.beans.ITestBean;
import org.springframework.beans.TestBean;
import org.springframework.beans.factory.xml.XmlBeanFactory; import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.ClassPathResource;
import test.beans.ITestBean;
import test.beans.TestBean;
/** /**
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 04.10.2004 * @since 04.10.2004

View File

@ -28,9 +28,7 @@ import java.util.prefs.Preferences;
import org.junit.Before; import org.junit.Before;
import org.junit.Ignore; import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
import org.springframework.beans.IndexedTestBean;
import org.springframework.beans.MutablePropertyValues; import org.springframework.beans.MutablePropertyValues;
import org.springframework.beans.TestBean;
import org.springframework.beans.factory.BeanDefinitionStoreException; import org.springframework.beans.factory.BeanDefinitionStoreException;
import org.springframework.beans.factory.BeanInitializationException; import org.springframework.beans.factory.BeanInitializationException;
import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.beans.factory.support.BeanDefinitionBuilder;
@ -43,6 +41,9 @@ import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource; import org.springframework.core.io.Resource;
import test.beans.IndexedTestBean;
import test.beans.TestBean;
/** /**
* Unit tests for various {@link PropertyResourceConfigurer} implementations including: * Unit tests for various {@link PropertyResourceConfigurer} implementations including:
* {@link PropertyPlaceholderConfigurer}, {@link PropertyOverrideConfigurer} and * {@link PropertyPlaceholderConfigurer}, {@link PropertyOverrideConfigurer} and

View File

@ -23,11 +23,12 @@ import java.util.List;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.springframework.beans.TestBean;
import org.springframework.beans.factory.ObjectFactory; import org.springframework.beans.factory.ObjectFactory;
import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader; import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import test.beans.TestBean;
/** /**
* Simple test to illustrate and verify scope usage. * Simple test to illustrate and verify scope usage.
* *

View File

@ -5,6 +5,6 @@
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd"> http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd">
<bean id="usesScope" class="org.springframework.beans.TestBean" scope="myScope"/> <bean id="usesScope" class="test.beans.TestBean" scope="myScope"/>
</beans> </beans>

View File

@ -3,7 +3,7 @@
<beans> <beans>
<bean id="test3" class="org.springframework.beans.TestBean" scope="prototype"> <bean id="test3" class="test.beans.TestBean" scope="prototype">
<property name="name"><value>custom</value></property> <property name="name"><value>custom</value></property>
<property name="age"><value>25</value></property> <property name="age"><value>25</value></property>
</bean> </bean>

View File

@ -4,7 +4,7 @@
<beans> <beans>
<!-- Simple target --> <!-- Simple target -->
<bean id="test" class="org.springframework.beans.TestBean"> <bean id="test" class="test.beans.TestBean">
<property name="name"><value>custom</value></property> <property name="name"><value>custom</value></property>
<property name="age"><value>666</value></property> <property name="age"><value>666</value></property>
</bean> </bean>
@ -13,7 +13,7 @@
Check that invoker is automatically added to wrap target. Check that invoker is automatically added to wrap target.
Non pointcut bean name should be wrapped in invoker. Non pointcut bean name should be wrapped in invoker.
--> -->
<bean id="numberTestBean" class="org.springframework.beans.NumberTestBean"/> <bean id="numberTestBean" class="test.beans.NumberTestBean"/>
</beans> </beans>

View File

@ -21,11 +21,12 @@ import java.util.List;
import junit.framework.TestCase; import junit.framework.TestCase;
import org.springframework.beans.TestBean;
import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader; import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.ClassPathResource;
import test.beans.TestBean;
/** /**
* @author Rob Harrop * @author Rob Harrop
* @since 2.0 * @since 2.0

View File

@ -6,12 +6,12 @@
<!-- <!--
Just included for the count: not to mean anything in particular Just included for the count: not to mean anything in particular
--> -->
<bean id="something" class="org.springframework.beans.GenericIntegerBean"/> <bean id="something" class="test.beans.GenericIntegerBean"/>
<bean id="indexedBean" class="org.springframework.beans.IndexedTestBean"/> <bean id="indexedBean" class="test.beans.IndexedTestBean"/>
<!-- Overridden by next factory --> <!-- Overridden by next factory -->
<bean id="test" class="org.springframework.beans.TestBean"> <bean id="test" class="test.beans.TestBean">
<property name="name"><value>custom</value></property> <property name="name"><value>custom</value></property>
<property name="age"><value>25</value></property> <property name="age"><value>25</value></property>
</bean> </bean>

View File

@ -20,7 +20,7 @@ import java.util.Arrays;
import junit.framework.TestCase; import junit.framework.TestCase;
import org.springframework.beans.TestBean; import test.beans.TestBean;
/** /**
* @author Rod Johnson * @author Rod Johnson

View File

@ -18,9 +18,10 @@ package org.springframework.beans.factory.support;
import junit.framework.TestCase; import junit.framework.TestCase;
import org.springframework.beans.TestBean;
import org.springframework.beans.factory.config.BeanDefinitionHolder; import org.springframework.beans.factory.config.BeanDefinitionHolder;
import test.beans.TestBean;
/** /**
* @author Juergen Hoeller * @author Juergen Hoeller
*/ */

View File

@ -31,8 +31,6 @@ import java.util.Map;
import java.util.Set; import java.util.Set;
import org.junit.Test; import org.junit.Test;
import org.springframework.beans.GenericIntegerBean;
import org.springframework.beans.GenericSetOfIntegerBean;
import org.springframework.beans.PropertyEditorRegistrar; import org.springframework.beans.PropertyEditorRegistrar;
import org.springframework.beans.PropertyEditorRegistry; import org.springframework.beans.PropertyEditorRegistry;
import org.springframework.beans.factory.xml.XmlBeanFactory; import org.springframework.beans.factory.xml.XmlBeanFactory;
@ -41,6 +39,8 @@ import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.UrlResource; import org.springframework.core.io.UrlResource;
import test.beans.GenericBean; import test.beans.GenericBean;
import test.beans.GenericIntegerBean;
import test.beans.GenericSetOfIntegerBean;
/** /**
* @author Juergen Hoeller * @author Juergen Hoeller

View File

@ -18,10 +18,11 @@ package org.springframework.beans.factory.support;
import junit.framework.TestCase; import junit.framework.TestCase;
import org.springframework.beans.TestBean;
import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.RuntimeBeanReference; import org.springframework.beans.factory.config.RuntimeBeanReference;
import test.beans.TestBean;
/** /**
* @author Rob Harrop * @author Rob Harrop
*/ */

View File

@ -18,7 +18,8 @@ package org.springframework.beans.factory.support;
import junit.framework.TestCase; import junit.framework.TestCase;
import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.ClassPathResource;
import org.springframework.beans.TestBean;
import test.beans.TestBean;
/** /**
* @author Rob Harrop * @author Rob Harrop

View File

@ -43,7 +43,7 @@
autowire="constructor"> autowire="constructor">
</bean> </bean>
<bean id="integerBean" class="org.springframework.beans.GenericIntegerBean"> <bean id="integerBean" class="test.beans.GenericIntegerBean">
<property name="genericProperty" value="10"/> <property name="genericProperty" value="10"/>
<property name="genericListProperty"> <property name="genericListProperty">
<list> <list>
@ -53,7 +53,7 @@
</property> </property>
</bean> </bean>
<bean id="setOfIntegerBean" class="org.springframework.beans.GenericSetOfIntegerBean"> <bean id="setOfIntegerBean" class="test.beans.GenericSetOfIntegerBean">
<property name="genericProperty" value="10"/> <property name="genericProperty" value="10"/>
<property name="genericListProperty"> <property name="genericListProperty">
<list> <list>

View File

@ -19,11 +19,12 @@ package org.springframework.beans.factory.wiring;
import junit.framework.TestCase; import junit.framework.TestCase;
import org.easymock.MockControl; import org.easymock.MockControl;
import org.springframework.beans.TestBean;
import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import test.beans.TestBean;
/** /**
* @author Rick Evans * @author Rick Evans
* @author Juergen Hoeller * @author Juergen Hoeller

View File

@ -19,7 +19,6 @@ package org.springframework.beans.factory.xml;
import junit.framework.TestCase; import junit.framework.TestCase;
import junit.framework.Assert; import junit.framework.Assert;
import org.springframework.beans.TestBean;
import org.springframework.beans.factory.CountingFactory; import org.springframework.beans.factory.CountingFactory;
import org.springframework.beans.factory.config.PropertiesFactoryBean; import org.springframework.beans.factory.config.PropertiesFactoryBean;
import org.springframework.beans.factory.config.RuntimeBeanReference; import org.springframework.beans.factory.config.RuntimeBeanReference;
@ -28,6 +27,8 @@ import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.support.RootBeanDefinition; import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.ClassPathResource;
import test.beans.TestBean;
/** /**
* @author Rob Harrop * @author Rob Harrop
* @author Juergen Hoeller * @author Juergen Hoeller

View File

@ -24,11 +24,12 @@ import java.util.Set;
import junit.framework.TestCase; import junit.framework.TestCase;
import org.springframework.beans.TestBean;
import org.springframework.beans.factory.support.BeanDefinitionReader; import org.springframework.beans.factory.support.BeanDefinitionReader;
import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.ClassPathResource;
import test.beans.TestBean;
/** /**
* Unit and integration tests for the collection merging support. * Unit and integration tests for the collection merging support.
* *

View File

@ -2,7 +2,8 @@ package org.springframework.beans.factory.xml;
import junit.framework.TestCase; import junit.framework.TestCase;
import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.ClassPathResource;
import org.springframework.beans.TestBean;
import test.beans.TestBean;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;

View File

@ -18,8 +18,8 @@ package org.springframework.beans.factory.xml;
import java.io.Serializable; import java.io.Serializable;
import org.springframework.beans.IndexedTestBean; import test.beans.IndexedTestBean;
import org.springframework.beans.TestBean; import test.beans.TestBean;
/** /**
* Simple bean used to check constructor dependency checking. * Simple bean used to check constructor dependency checking.

View File

@ -16,10 +16,11 @@
package org.springframework.beans.factory.xml; package org.springframework.beans.factory.xml;
import org.springframework.beans.TestBean;
import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware; import org.springframework.beans.factory.BeanFactoryAware;
import test.beans.TestBean;
/** /**
* Simple bean used to test dependency checking. * Simple bean used to test dependency checking.
* *

View File

@ -16,9 +16,10 @@
package org.springframework.beans.factory.xml; package org.springframework.beans.factory.xml;
import org.springframework.beans.TestBean;
import org.springframework.beans.factory.DummyFactory; import org.springframework.beans.factory.DummyFactory;
import test.beans.TestBean;
/** /**
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 21.07.2003 * @since 21.07.2003

View File

@ -24,12 +24,13 @@ import java.util.List;
import java.util.Properties; import java.util.Properties;
import org.junit.Test; import org.junit.Test;
import org.springframework.beans.TestBean;
import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.BeanCreationException;
import org.springframework.beans.factory.BeanDefinitionStoreException; import org.springframework.beans.factory.BeanDefinitionStoreException;
import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.ClassPathResource;
import test.beans.TestBean;
/** /**
* @author Juergen Hoeller * @author Juergen Hoeller
* @author Chris Beams * @author Chris Beams

View File

@ -19,7 +19,7 @@ package org.springframework.beans.factory.xml;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import org.springframework.beans.TestBean; import test.beans.TestBean;
/** /**
* Test class for Spring's ability to create objects using static * Test class for Spring's ability to create objects using static

View File

@ -16,7 +16,7 @@
package org.springframework.beans.factory.xml; package org.springframework.beans.factory.xml;
import org.springframework.beans.TestBean; import test.beans.TestBean;
/** /**
* Test class for Spring's ability to create objects using * Test class for Spring's ability to create objects using

View File

@ -20,10 +20,11 @@ import junit.framework.TestCase;
import org.xml.sax.SAXParseException; import org.xml.sax.SAXParseException;
import org.springframework.beans.BeansException; import org.springframework.beans.BeansException;
import org.springframework.beans.TestBean;
import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.ClassPathResource;
import test.beans.TestBean;
/** /**
* @author Rob Harrop * @author Rob Harrop
*/ */

View File

@ -18,11 +18,12 @@ package org.springframework.beans.factory.xml;
import junit.framework.TestCase; import junit.framework.TestCase;
import org.springframework.beans.ITestBean;
import org.springframework.beans.TestBean;
import org.springframework.beans.factory.BeanDefinitionStoreException; import org.springframework.beans.factory.BeanDefinitionStoreException;
import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.ClassPathResource;
import test.beans.ITestBean;
import test.beans.TestBean;
/** /**
* @author Rob Harrop * @author Rob Harrop
* @author Juergen Hoeller * @author Juergen Hoeller

View File

@ -16,7 +16,7 @@
package org.springframework.beans.factory.xml; package org.springframework.beans.factory.xml;
import org.springframework.beans.TestBean; import test.beans.TestBean;
/** /**
* Test class for Spring's ability to create * Test class for Spring's ability to create

View File

@ -25,7 +25,6 @@ import java.util.TreeMap;
import junit.framework.TestCase; import junit.framework.TestCase;
import org.springframework.beans.TestBean;
import org.springframework.beans.factory.parsing.CollectingReaderEventListener; import org.springframework.beans.factory.parsing.CollectingReaderEventListener;
import org.springframework.beans.factory.parsing.ComponentDefinition; import org.springframework.beans.factory.parsing.ComponentDefinition;
import org.springframework.beans.factory.support.AbstractBeanDefinition; import org.springframework.beans.factory.support.AbstractBeanDefinition;
@ -35,6 +34,8 @@ import org.springframework.beans.factory.config.PropertiesFactoryBean;
import org.springframework.beans.factory.config.FieldRetrievingFactoryBean; import org.springframework.beans.factory.config.FieldRetrievingFactoryBean;
import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.ClassPathResource;
import test.beans.TestBean;
/** /**
* @author Rob Harrop * @author Rob Harrop
* @author Juergen Hoeller * @author Juergen Hoeller

View File

@ -31,7 +31,6 @@ import java.util.TreeMap;
import java.util.TreeSet; import java.util.TreeSet;
import org.junit.Test; import org.junit.Test;
import org.springframework.beans.TestBean;
import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.BeanCreationException;
import org.springframework.beans.factory.BeanDefinitionStoreException; import org.springframework.beans.factory.BeanDefinitionStoreException;
import org.springframework.beans.factory.HasMap; import org.springframework.beans.factory.HasMap;
@ -40,6 +39,8 @@ import org.springframework.beans.factory.config.MapFactoryBean;
import org.springframework.beans.factory.config.SetFactoryBean; import org.springframework.beans.factory.config.SetFactoryBean;
import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.ClassPathResource;
import test.beans.TestBean;
/** /**
* Tests for collections in XML bean definitions. * Tests for collections in XML bean definitions.
* *

View File

@ -21,7 +21,6 @@ import java.util.Arrays;
import junit.framework.TestCase; import junit.framework.TestCase;
import org.xml.sax.InputSource; import org.xml.sax.InputSource;
import org.springframework.beans.TestBean;
import org.springframework.beans.factory.BeanDefinitionStoreException; import org.springframework.beans.factory.BeanDefinitionStoreException;
import org.springframework.beans.factory.support.BeanDefinitionRegistry; import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.beans.factory.support.DefaultListableBeanFactory;
@ -30,6 +29,8 @@ import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.InputStreamResource; import org.springframework.core.io.InputStreamResource;
import org.springframework.core.io.Resource; import org.springframework.core.io.Resource;
import test.beans.TestBean;
/** /**
* @author Rick Evans * @author Rick Evans
* @author Juergen Hoeller * @author Juergen Hoeller

View File

@ -24,9 +24,7 @@ import java.util.Map;
import junit.framework.Assert; import junit.framework.Assert;
import org.springframework.beans.BeansException; import org.springframework.beans.BeansException;
import org.springframework.beans.ITestBean;
import org.springframework.beans.MutablePropertyValues; import org.springframework.beans.MutablePropertyValues;
import org.springframework.beans.TestBean;
import org.springframework.beans.factory.AbstractListableBeanFactoryTests; import org.springframework.beans.factory.AbstractListableBeanFactoryTests;
import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.DummyFactory; import org.springframework.beans.factory.DummyFactory;
@ -36,6 +34,9 @@ import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.support.RootBeanDefinition; import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.ClassPathResource;
import test.beans.ITestBean;
import test.beans.TestBean;
/** /**
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 09.11.2003 * @since 09.11.2003

View File

@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"> xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<bean id="jenny" class="org.springframework.beans.TestBean"> <bean id="jenny" class="test.beans.TestBean">
<property name="name"><value>Jenny</value></property> <property name="name"><value>Jenny</value></property>
<property name="age"><value>30</value></property> <property name="age"><value>30</value></property>
<property name="spouse"> <property name="spouse">
@ -12,7 +12,7 @@
</property> </property>
</bean> </bean>
<bean id="david" class="org.springframework.beans.TestBean"> <bean id="david" class="test.beans.TestBean">
<description> <description>
Simple bean, without any collections. Simple bean, without any collections.
</description> </description>
@ -23,7 +23,7 @@
<property name="age"><value>27</value></property> <property name="age"><value>27</value></property>
</bean> </bean>
<bean id="rod" class="org.springframework.beans.TestBean"> <bean id="rod" class="test.beans.TestBean">
<property name="name"><value>Rod</value></property> <property name="name"><value>Rod</value></property>
<property name="age"><value>32</value></property> <property name="age"><value>32</value></property>
<property name="friends"> <property name="friends">
@ -35,7 +35,7 @@
</property> </property>
</bean> </bean>
<bean id="pJenny" class="org.springframework.beans.TestBean" scope="prototype"> <bean id="pJenny" class="test.beans.TestBean" scope="prototype">
<property name="name"><value>Jenny</value></property> <property name="name"><value>Jenny</value></property>
<property name="age"><value>30</value></property> <property name="age"><value>30</value></property>
<property name="spouse"> <property name="spouse">
@ -44,12 +44,12 @@
</property> </property>
</bean> </bean>
<bean id="pDavid" class="org.springframework.beans.TestBean" scope="prototype"> <bean id="pDavid" class="test.beans.TestBean" scope="prototype">
<property name="name"><value>David</value></property> <property name="name"><value>David</value></property>
<property name="age"><value>27</value></property> <property name="age"><value>27</value></property>
</bean> </bean>
<bean id="pRod" class="org.springframework.beans.TestBean" scope="prototype"> <bean id="pRod" class="test.beans.TestBean" scope="prototype">
<property name="name"><value>Rod</value></property> <property name="name"><value>Rod</value></property>
<property name="age"><value>32</value></property> <property name="age"><value>32</value></property>
<property name="friends"> <property name="friends">
@ -63,7 +63,7 @@
<!-- <!--
Try setting a collection property to a single value Try setting a collection property to a single value
--> -->
<bean id="loner" class="org.springframework.beans.TestBean"> <bean id="loner" class="test.beans.TestBean">
<property name="name"><value>loner</value></property> <property name="name"><value>loner</value></property>
<property name="age"><value>26</value></property> <property name="age"><value>26</value></property>
<property name="friends"> <property name="friends">
@ -97,15 +97,15 @@
</property> </property>
</bean> </bean>
<bean id="verbose" class="org.springframework.beans.TestBean"> <bean id="verbose" class="test.beans.TestBean">
<property name="name"><value>verbose</value></property> <property name="name"><value>verbose</value></property>
</bean> </bean>
<bean id="verbose2" class="org.springframework.beans.TestBean"> <bean id="verbose2" class="test.beans.TestBean">
<property name="name"><idref local="verbose"/></property> <property name="name"><idref local="verbose"/></property>
</bean> </bean>
<bean id="verbose3" class="org.springframework.beans.TestBean"> <bean id="verbose3" class="test.beans.TestBean">
<property name="name"><idref bean="verbose"/></property> <property name="name"><idref bean="verbose"/></property>
</bean> </bean>

View File

@ -92,7 +92,7 @@
<bean id="listInstance" class="org.springframework.beans.factory.xml.FactoryMethods" <bean id="listInstance" class="org.springframework.beans.factory.xml.FactoryMethods"
factory-method="listInstance"/> factory-method="listInstance"/>
<bean id="juergen" class="org.springframework.beans.TestBean"> <bean id="juergen" class="test.beans.TestBean">
<property name="name"><value>Juergen</value></property> <property name="name"><value>Juergen</value></property>
</bean> </bean>
@ -117,7 +117,7 @@
<!-- Unnamed bean with factory-bean declaration --> <!-- Unnamed bean with factory-bean declaration -->
<bean factory-bean="instanceFactory" factory-method="defaultInstance"/> <bean factory-bean="instanceFactory" factory-method="defaultInstance"/>
<bean id="testBeanWithInnerFactoryMethod" class="org.springframework.beans.TestBean"> <bean id="testBeanWithInnerFactoryMethod" class="test.beans.TestBean">
<property name="friends"> <property name="friends">
<list> <list>
<!-- Unnamed bean with factory-bean declaration --> <!-- Unnamed bean with factory-bean declaration -->

View File

@ -42,14 +42,14 @@ import org.junit.Test;
import org.springframework.beans.BeanWrapper; import org.springframework.beans.BeanWrapper;
import org.springframework.beans.BeanWrapperImpl; import org.springframework.beans.BeanWrapperImpl;
import org.springframework.beans.BeansException; import org.springframework.beans.BeansException;
import org.springframework.beans.ITestBean;
import org.springframework.beans.IndexedTestBean;
import org.springframework.beans.MutablePropertyValues; import org.springframework.beans.MutablePropertyValues;
import org.springframework.beans.NumberTestBean;
import org.springframework.beans.PropertyValue; import org.springframework.beans.PropertyValue;
import org.springframework.beans.TestBean;
import test.beans.BooleanTestBean; import test.beans.BooleanTestBean;
import test.beans.ITestBean;
import test.beans.IndexedTestBean;
import test.beans.NumberTestBean;
import test.beans.TestBean;
/** /**
* Unit tests for the various PropertyEditors in Spring. * Unit tests for the various PropertyEditors in Spring.
@ -572,9 +572,9 @@ public class CustomEditorTests {
@Test @Test
public void testClassEditor() { public void testClassEditor() {
PropertyEditor classEditor = new ClassEditor(); PropertyEditor classEditor = new ClassEditor();
classEditor.setAsText("org.springframework.beans.TestBean"); classEditor.setAsText(TestBean.class.getName());
assertEquals(TestBean.class, classEditor.getValue()); assertEquals(TestBean.class, classEditor.getValue());
assertEquals("org.springframework.beans.TestBean", classEditor.getAsText()); assertEquals(TestBean.class.getName(), classEditor.getAsText());
classEditor.setAsText(null); classEditor.setAsText(null);
assertEquals("", classEditor.getAsText()); assertEquals("", classEditor.getAsText());
@ -593,9 +593,9 @@ public class CustomEditorTests {
@Test @Test
public void testClassEditorWithArray() { public void testClassEditorWithArray() {
PropertyEditor classEditor = new ClassEditor(); PropertyEditor classEditor = new ClassEditor();
classEditor.setAsText("org.springframework.beans.TestBean[]"); classEditor.setAsText("test.beans.TestBean[]");
assertEquals(TestBean[].class, classEditor.getValue()); assertEquals(TestBean[].class, classEditor.getValue());
assertEquals("org.springframework.beans.TestBean[]", classEditor.getAsText()); assertEquals("test.beans.TestBean[]", classEditor.getAsText());
} }
/* /*

View File

@ -27,7 +27,8 @@ import junit.framework.TestCase;
import org.springframework.beans.BeanWrapper; import org.springframework.beans.BeanWrapper;
import org.springframework.beans.BeanWrapperImpl; import org.springframework.beans.BeanWrapperImpl;
import org.springframework.beans.TestBean;
import test.beans.TestBean;
/** /**
* @author Juergen Hoeller * @author Juergen Hoeller

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.beans; package test.beans;
import org.springframework.core.enums.ShortCodedLabeledEnum; import org.springframework.core.enums.ShortCodedLabeledEnum;

View File

@ -18,7 +18,6 @@ package test.beans;
import java.io.Serializable; import java.io.Serializable;
import org.springframework.beans.TestBean;
import org.springframework.beans.factory.BeanNameAware; import org.springframework.beans.factory.BeanNameAware;
import org.springframework.beans.factory.DisposableBean; import org.springframework.beans.factory.DisposableBean;

View File

@ -14,9 +14,8 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.beans; package test.beans;
import test.beans.GenericBean;
/** /**
* @author Juergen Hoeller * @author Juergen Hoeller

View File

@ -14,11 +14,10 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.beans; package test.beans;
import java.util.Set; import java.util.Set;
import test.beans.GenericBean;
/** /**
* @author Juergen Hoeller * @author Juergen Hoeller

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.beans; package test.beans;
public interface INestedTestBean { public interface INestedTestBean {

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.beans; package test.beans;
public interface IOther { public interface IOther {

View File

@ -14,12 +14,12 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.beans; package test.beans;
import java.io.IOException; import java.io.IOException;
/** /**
* Interface used for {@link org.springframework.beans.TestBean}. * Interface used for {@link test.beans.TestBean}.
* *
* <p>Two methods are the same as on Person, but if this * <p>Two methods are the same as on Person, but if this
* extends person it breaks quite a few tests.. * extends person it breaks quite a few tests..

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2006 the original author or authors. * Copyright 2002-2008 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.beans; package test.beans;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.beans; package test.beans;
/** /**
* Simple nested test bean used for testing bean factories, AOP framework etc. * Simple nested test bean used for testing bean factories, AOP framework etc.

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.beans; package test.beans;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.BigInteger; import java.math.BigInteger;

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.beans; package test.beans;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;

View File

@ -3,7 +3,7 @@
<beans> <beans>
<bean id="testBean" class="org.springframework.beans.TestBean"> <bean id="testBean" class="test.beans.TestBean">
<property name="someIntegerArray"> <property name="someIntegerArray">
<list> <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"/>

View File

@ -3,19 +3,19 @@
<beans> <beans>
<bean id="tb" class="org.springframework.beans.TestBean" scope="prototype"> <bean id="tb" class="test.beans.TestBean" scope="prototype">
<property name="age"><value>10</value></property> <property name="age"><value>10</value></property>
<property name="spouse"> <property name="spouse">
<bean class="org.springframework.beans.TestBean"> <bean class="test.beans.TestBean">
<property name="age"><value>11</value></property> <property name="age"><value>11</value></property>
</bean> </bean>
</property> </property>
</bean> </bean>
<bean id="otb" class="org.springframework.beans.TestBean"> <bean id="otb" class="test.beans.TestBean">
<property name="age"><value>98</value></property> <property name="age"><value>98</value></property>
<property name="spouse"> <property name="spouse">
<bean class="org.springframework.beans.TestBean"> <bean class="test.beans.TestBean">
<property name="age"><value>99</value></property> <property name="age"><value>99</value></property>
</bean> </bean>
</property> </property>
@ -23,7 +23,7 @@
<bean id="propertyPath1" class="org.springframework.beans.factory.config.PropertyPathFactoryBean"> <bean id="propertyPath1" class="org.springframework.beans.factory.config.PropertyPathFactoryBean">
<property name="targetObject"> <property name="targetObject">
<bean class="org.springframework.beans.TestBean"> <bean class="test.beans.TestBean">
<property name="age"><value>12</value></property> <property name="age"><value>12</value></property>
</bean> </bean>
</property> </property>
@ -46,10 +46,10 @@
<bean id="propertyPath3" 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="targetBeanName"><value>tb</value></property>
<property name="propertyPath"><value>spouse</value></property> <property name="propertyPath"><value>spouse</value></property>
<property name="resultType"><value>org.springframework.beans.TestBean</value></property> <property name="resultType"><value>test.beans.TestBean</value></property>
</bean> </bean>
<bean id="tbWithInner" class="org.springframework.beans.TestBean"> <bean id="tbWithInner" class="test.beans.TestBean">
<property name="age" value="10"/> <property name="age" value="10"/>
<property name="spouse"> <property name="spouse">
<bean name="otb.spouse" class="org.springframework.beans.factory.config.PropertyPathFactoryBean"/> <bean name="otb.spouse" class="org.springframework.beans.factory.config.PropertyPathFactoryBean"/>

View File

@ -6,7 +6,7 @@
<bean id="invalidClass" class="some.class.that.does.not.Exist"/> <bean id="invalidClass" class="some.class.that.does.not.Exist"/>
<bean id="invalidMapDefinition" class="org.springframework.beans.TestBean"> <bean id="invalidMapDefinition" class="test.beans.TestBean">
<property name="someMap"> <property name="someMap">
<map> <map>
<entry/> <entry/>
@ -14,9 +14,9 @@
</property> </property>
</bean> </bean>
<bean id="nestedBeanErrors" class="org.springframework.beans.TestBean"> <bean id="nestedBeanErrors" class="test.beans.TestBean">
<property name="spouse"> <property name="spouse">
<bean class="org.springframework.beans.TestBean"> <bean class="test.beans.TestBean">
<property name="someMap"> <property name="someMap">
<map> <map>
<entry/> <entry/>
@ -26,5 +26,5 @@
</property> </property>
</bean> </bean>
<bean id="validBean" class="org.springframework.beans.TestBean"/> <bean id="validBean" class="test.beans.TestBean"/>
</beans> </beans>

View File

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

View File

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

View File

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

View File

@ -3,9 +3,9 @@
<beans> <beans>
<bean id="rob" class="org.springframework.beans.TestBean" scope="prototype" autowire="constructor"/> <bean id="rob" class="test.beans.TestBean" scope="prototype" autowire="constructor"/>
<bean id="sally" class="org.springframework.beans.TestBean" scope="prototype"/> <bean id="sally" class="test.beans.TestBean" scope="prototype"/>
<bean id="props1" class="org.springframework.beans.factory.config.PropertiesFactoryBean"> <bean id="props1" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<property name="properties"> <property name="properties">

View File

@ -3,9 +3,9 @@
<beans> <beans>
<bean id="rob" class="org.springframework.beans.TestBean" autowire="byType"/> <bean id="rob" class="test.beans.TestBean" autowire="byType"/>
<bean id="sally" class="org.springframework.beans.TestBean"/> <bean id="sally" class="test.beans.TestBean"/>
<bean id="props1" class="org.springframework.beans.factory.config.PropertiesFactoryBean"> <bean id="props1" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<property name="properties"> <property name="properties">

View File

@ -4,9 +4,9 @@
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"
default-autowire-candidates=""> default-autowire-candidates="">
<bean id="rob" class="org.springframework.beans.TestBean" autowire="byType"/> <bean id="rob" class="test.beans.TestBean" autowire="byType"/>
<bean id="sally" class="org.springframework.beans.TestBean" autowire-candidate="true"/> <bean id="sally" class="test.beans.TestBean" autowire-candidate="true"/>
<bean id="props1" class="org.springframework.beans.factory.config.PropertiesFactoryBean" autowire-candidate="true"> <bean id="props1" class="org.springframework.beans.factory.config.PropertiesFactoryBean" autowire-candidate="true">
<property name="properties"> <property name="properties">

View File

@ -4,9 +4,9 @@
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"
default-autowire-candidates="props*,*ly"> default-autowire-candidates="props*,*ly">
<bean id="rob" class="org.springframework.beans.TestBean" autowire="byType"/> <bean id="rob" class="test.beans.TestBean" autowire="byType"/>
<bean id="sally" class="org.springframework.beans.TestBean"/> <bean id="sally" class="test.beans.TestBean"/>
<bean id="props1" class="org.springframework.beans.factory.config.PropertiesFactoryBean"> <bean id="props1" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<property name="properties"> <property name="properties">

View File

@ -10,22 +10,22 @@
<alias name="testBean" alias="testBeanAlias2"/> <alias name="testBean" alias="testBeanAlias2"/>
<bean id="testBean" class="org.springframework.beans.TestBean"> <bean id="testBean" class="test.beans.TestBean">
<constructor-arg type="java.lang.String" value="Rob Harrop"/> <constructor-arg type="java.lang.String" value="Rob Harrop"/>
<property name="friends"> <property name="friends">
<ref bean="testBean2"/> <ref bean="testBean2"/>
</property> </property>
<property name="doctor"> <property name="doctor">
<bean class="org.springframework.beans.NestedTestBean"> <bean class="test.beans.NestedTestBean">
<constructor-arg type="java.lang.String" value="ACME"/> <constructor-arg type="java.lang.String" value="ACME"/>
</bean> </bean>
</property> </property>
</bean> </bean>
<bean id="testBean2" class="org.springframework.beans.TestBean"> <bean id="testBean2" class="test.beans.TestBean">
<property name="name" value="Juergen Hoeller"/> <property name="name" value="Juergen Hoeller"/>
<property name="spouse"> <property name="spouse">
<bean class="org.springframework.beans.TestBean"> <bean class="test.beans.TestBean">
<property name="name" value="Eva Schallmeiner"/> <property name="name" value="Eva Schallmeiner"/>
</bean> </bean>
</property> </property>

View File

@ -3,7 +3,7 @@
<beans> <beans>
<bean id="parentWithList" class="org.springframework.beans.TestBean"> <bean id="parentWithList" class="test.beans.TestBean">
<property name="someList"> <property name="someList">
<list> <list>
<value>Rob Harrop</value> <value>Rob Harrop</value>
@ -23,12 +23,12 @@
<bean id="childWithListOfRefs" parent="parentWithList"> <bean id="childWithListOfRefs" parent="parentWithList">
<property name="someList"> <property name="someList">
<list merge="true"> <list merge="true">
<bean class="org.springframework.beans.TestBean"/> <bean class="test.beans.TestBean"/>
</list> </list>
</property> </property>
</bean> </bean>
<bean id="parentWithSet" class="org.springframework.beans.TestBean"> <bean id="parentWithSet" class="test.beans.TestBean">
<property name="someSet"> <property name="someSet">
<set> <set>
<value>Rob Harrop</value> <value>Rob Harrop</value>
@ -47,14 +47,14 @@
<bean id="childWithSetOfRefs" parent="parentWithSet"> <bean id="childWithSetOfRefs" parent="parentWithSet">
<property name="someSet"> <property name="someSet">
<set merge="true"> <set merge="true">
<bean class="org.springframework.beans.TestBean"> <bean class="test.beans.TestBean">
<property name="name" value="Sally"/> <property name="name" value="Sally"/>
</bean> </bean>
</set> </set>
</property> </property>
</bean> </bean>
<bean id="parentWithMap" class="org.springframework.beans.TestBean"> <bean id="parentWithMap" class="test.beans.TestBean">
<property name="someMap"> <property name="someMap">
<map> <map>
<entry key="Rob" value="Sall"/> <entry key="Rob" value="Sall"/>
@ -76,7 +76,7 @@
<property name="someMap"> <property name="someMap">
<map merge="true"> <map merge="true">
<entry key="Rob"> <entry key="Rob">
<bean class="org.springframework.beans.TestBean"> <bean class="test.beans.TestBean">
<property name="name" value="Sally"/> <property name="name" value="Sally"/>
</bean> </bean>
</entry> </entry>
@ -84,7 +84,7 @@
</property> </property>
</bean> </bean>
<bean id="parentWithProps" class="org.springframework.beans.TestBean"> <bean id="parentWithProps" class="test.beans.TestBean">
<property name="someProperties"> <property name="someProperties">
<props> <props>
<prop key="Rob">Sall</prop> <prop key="Rob">Sall</prop>
@ -103,7 +103,7 @@
</bean> </bean>
<bean id="parentWithListInConstructor" class="org.springframework.beans.TestBean"> <bean id="parentWithListInConstructor" class="test.beans.TestBean">
<constructor-arg index="0"> <constructor-arg index="0">
<list> <list>
<value>Rob Harrop</value> <value>Rob Harrop</value>
@ -123,12 +123,12 @@
<bean id="childWithListOfRefsInConstructor" parent="parentWithListInConstructor"> <bean id="childWithListOfRefsInConstructor" parent="parentWithListInConstructor">
<constructor-arg index="0"> <constructor-arg index="0">
<list merge="true"> <list merge="true">
<bean class="org.springframework.beans.TestBean"/> <bean class="test.beans.TestBean"/>
</list> </list>
</constructor-arg> </constructor-arg>
</bean> </bean>
<bean id="parentWithSetInConstructor" class="org.springframework.beans.TestBean"> <bean id="parentWithSetInConstructor" class="test.beans.TestBean">
<constructor-arg index="0"> <constructor-arg index="0">
<set> <set>
<value>Rob Harrop</value> <value>Rob Harrop</value>
@ -147,14 +147,14 @@
<bean id="childWithSetOfRefsInConstructor" parent="parentWithSetInConstructor"> <bean id="childWithSetOfRefsInConstructor" parent="parentWithSetInConstructor">
<constructor-arg index="0"> <constructor-arg index="0">
<set merge="true"> <set merge="true">
<bean class="org.springframework.beans.TestBean"> <bean class="test.beans.TestBean">
<property name="name" value="Sally"/> <property name="name" value="Sally"/>
</bean> </bean>
</set> </set>
</constructor-arg> </constructor-arg>
</bean> </bean>
<bean id="parentWithMapInConstructor" class="org.springframework.beans.TestBean"> <bean id="parentWithMapInConstructor" class="test.beans.TestBean">
<constructor-arg index="0"> <constructor-arg index="0">
<map> <map>
<entry key="Rob" value="Sall"/> <entry key="Rob" value="Sall"/>
@ -176,7 +176,7 @@
<constructor-arg index="0"> <constructor-arg index="0">
<map merge="true"> <map merge="true">
<entry key="Rob"> <entry key="Rob">
<bean class="org.springframework.beans.TestBean"> <bean class="test.beans.TestBean">
<property name="name" value="Sally"/> <property name="name" value="Sally"/>
</bean> </bean>
</entry> </entry>
@ -184,7 +184,7 @@
</constructor-arg> </constructor-arg>
</bean> </bean>
<bean id="parentWithPropsInConstructor" class="org.springframework.beans.TestBean"> <bean id="parentWithPropsInConstructor" class="test.beans.TestBean">
<constructor-arg index="0"> <constructor-arg index="0">
<props> <props>
<prop key="Rob">Sall</prop> <prop key="Rob">Sall</prop>

View File

@ -3,7 +3,7 @@
"http://www.springframework.org/dtd/spring-beans-2.0.dtd"> "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans> <beans>
<bean id="testBean" class="org.springframework.beans.TestBean"> <bean id="testBean" class="test.beans.TestBean">
<property name="someList"> <property name="someList">
<list value-type="java.lang.Integer"> <list value-type="java.lang.Integer">
<value>1</value> <value>1</value>
@ -28,7 +28,7 @@
</property> </property>
</bean> </bean>
<bean id="testBean2" class="org.springframework.beans.TestBean"> <bean id="testBean2" class="test.beans.TestBean">
<property name="someMap"> <property name="someMap">
<map key-type="java.lang.Integer" value-type="java.lang.Boolean"> <map key-type="java.lang.Integer" value-type="java.lang.Boolean">
<entry> <entry>

View File

@ -3,16 +3,16 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> 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 xml:lang="en" id="testBean" class="test.beans.TestBean"/>
<bean id="fooBean" class="org.springframework.beans.TestBean"> <bean id="fooBean" class="test.beans.TestBean">
<property name="spouse"> <property name="spouse">
<bean class="org.springframework.beans.TestBean"/> <bean class="test.beans.TestBean"/>
</property> </property>
<property name="friends"> <property name="friends">
<list> <list>
<bean class="org.springframework.beans.TestBean"/> <bean class="test.beans.TestBean"/>
<bean class="org.springframework.beans.TestBean"/> <bean class="test.beans.TestBean"/>
</list> </list>
</property> </property>
</bean> </bean>

View File

@ -8,15 +8,15 @@
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.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"> 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"> <bean id="rob" class="test.beans.TestBean" p:name="Rob Harrop" p:spouse-ref="sally">
<property name="age" value="24"/> <property name="age" value="24"/>
</bean> </bean>
<bean id="sally" class="org.springframework.beans.TestBean" p:name="Sally Greenwood" p:spouse-ref="rob"/> <bean id="sally" class="test.beans.TestBean" p:name="Sally Greenwood" p:spouse-ref="rob"/>
<bean id="sally2" class="org.springframework.beans.TestBean"> <bean id="sally2" class="test.beans.TestBean">
<property name="spouse"> <property name="spouse">
<bean id="rob2" class="org.springframework.beans.TestBean" p:name="Rob Harrop" p:spouse-ref="sally2"> <bean id="rob2" class="test.beans.TestBean" p:name="Rob Harrop" p:spouse-ref="sally2">
<property name="age" value="24"/> <property name="age" value="24"/>
</bean> </bean>
</property> </property>

View File

@ -3,7 +3,7 @@
<beans> <beans>
<bean id="validEmptyWithDescription" class="org.springframework.beans.TestBean"> <bean id="validEmptyWithDescription" class="test.beans.TestBean">
<description> <description>
I have no properties and I'm happy without them. I have no properties and I'm happy without them.
</description> </description>
@ -12,7 +12,7 @@
<!-- <!--
Check automatic creation of alias, to allow for names that are illegal as XML ids. Check automatic creation of alias, to allow for names that are illegal as XML ids.
--> -->
<bean id="aliased" class=" org.springframework.beans.TestBean " name="myalias"> <bean id="aliased" class=" test.beans.TestBean " name="myalias">
<property name="name"><value>aliased</value></property> <property name="name"><value>aliased</value></property>
</bean> </bean>
@ -20,17 +20,17 @@
<alias name="multiAliased" alias="alias3"/> <alias name="multiAliased" alias="alias3"/>
<bean id="multiAliased" class="org.springframework.beans.TestBean" name="alias1,alias2"> <bean id="multiAliased" class="test.beans.TestBean" name="alias1,alias2">
<property name="name"><value>aliased</value></property> <property name="name"><value>aliased</value></property>
</bean> </bean>
<alias name="multiAliased" alias="alias4"/> <alias name="multiAliased" alias="alias4"/>
<bean class="org.springframework.beans.TestBean" name="aliasWithoutId1,aliasWithoutId2,aliasWithoutId3"> <bean class="test.beans.TestBean" name="aliasWithoutId1,aliasWithoutId2,aliasWithoutId3">
<property name="name"><value>aliased</value></property> <property name="name"><value>aliased</value></property>
</bean> </bean>
<bean class="org.springframework.beans.TestBean"> <bean class="test.beans.TestBean">
<property name="name"><null/></property> <property name="name"><null/></property>
</bean> </bean>
@ -40,7 +40,7 @@
<bean class="org.springframework.beans.factory.xml.DummyReferencer"/> <bean class="org.springframework.beans.factory.xml.DummyReferencer"/>
<bean id="rod" class="org.springframework.beans.TestBean"> <bean id="rod" class="test.beans.TestBean">
<property name="name"><value><!-- a comment -->Rod</value></property> <property name="name"><value><!-- a comment -->Rod</value></property>
<property name="age"><value>31</value></property> <property name="age"><value>31</value></property>
<property name="spouse"><ref bean="father"/></property> <property name="spouse"><ref bean="father"/></property>
@ -52,20 +52,20 @@
<!-- Should inherit age --> <!-- Should inherit age -->
</bean> </bean>
<bean id="kerry" class="org.springframework.beans.TestBean"> <bean id="kerry" class="test.beans.TestBean">
<property name="name"><value>Ker<!-- a comment -->ry</value></property> <property name="name"><value>Ker<!-- a comment -->ry</value></property>
<property name="age"><value>34</value></property> <property name="age"><value>34</value></property>
<property name="spouse"><ref local="rod"/></property> <property name="spouse"><ref local="rod"/></property>
<property name="touchy"><value></value></property> <property name="touchy"><value></value></property>
</bean> </bean>
<bean id="kathy" class="org.springframework.beans.TestBean" scope="prototype"> <bean id="kathy" class="test.beans.TestBean" scope="prototype">
<property name="name"><value>Kathy</value></property> <property name="name"><value>Kathy</value></property>
<property name="age"><value>28</value></property> <property name="age"><value>28</value></property>
<property name="spouse"><ref bean="father"/></property> <property name="spouse"><ref bean="father"/></property>
</bean> </bean>
<bean id="typeMismatch" class="org.springframework.beans.TestBean" scope="prototype"> <bean id="typeMismatch" class="test.beans.TestBean" scope="prototype">
<property name="name"><value>typeMismatch</value></property> <property name="name"><value>typeMismatch</value></property>
<property name="age"><value>34x</value></property> <property name="age"><value>34x</value></property>
<property name="spouse"><ref local="rod"/></property> <property name="spouse"><ref local="rod"/></property>
@ -113,14 +113,14 @@
<property name="testBean2"><ref bean="kathy"/></property> <property name="testBean2"><ref bean="kathy"/></property>
</bean> </bean>
<bean id="listenerVeto" class="org.springframework.beans.TestBean"> <bean id="listenerVeto" class="test.beans.TestBean">
<property name="name"><value>listenerVeto</value></property> <property name="name"><value>listenerVeto</value></property>
<property name="age"><value>66</value></property> <property name="age"><value>66</value></property>
</bean> </bean>
<bean id="validEmpty" class="org.springframework.beans.TestBean"/> <bean id="validEmpty" class="test.beans.TestBean"/>
<bean id="commentsInValue" class="org.springframework.beans.TestBean"> <bean id="commentsInValue" class="test.beans.TestBean">
<property name="name"><value>this is<!-- don't mind me --> a <![CDATA[<!--comment-->]]></value></property> <property name="name"><value>this is<!-- don't mind me --> a <![CDATA[<!--comment-->]]></value></property>
</bean> </bean>

View File

@ -17,7 +17,7 @@
name name
"/> "/>
<bean id="testBean" class="org.springframework.beans.TestBean" scope="prototype"> <bean id="testBean" class="test.beans.TestBean" scope="prototype">
<property name="name"> <property name="name">
<util:property-path path="configuredBean.name"/> <util:property-path path="configuredBean.name"/>
</property> </property>
@ -26,13 +26,13 @@
</property> </property>
</bean> </bean>
<bean id="constructedTestBean" class="org.springframework.beans.TestBean"> <bean id="constructedTestBean" class="test.beans.TestBean">
<constructor-arg index="0"> <constructor-arg index="0">
<util:property-path path="configuredBean.name"/> <util:property-path path="configuredBean.name"/>
</constructor-arg> </constructor-arg>
</bean> </bean>
<bean id="configuredBean" class="org.springframework.beans.TestBean"> <bean id="configuredBean" class="test.beans.TestBean">
<property name="name" value="Rob Harrop"/> <property name="name" value="Rob Harrop"/>
</bean> </bean>
@ -67,7 +67,7 @@
<value>Rob Harrop</value> <value>Rob Harrop</value>
</util:set> </util:set>
<bean id="nestedCollectionsBean" class="org.springframework.beans.TestBean"> <bean id="nestedCollectionsBean" class="test.beans.TestBean">
<property name="someList"> <property name="someList">
<util:list> <util:list>
<value>foo</value> <value>foo</value>
@ -89,7 +89,7 @@
</property> </property>
</bean> </bean>
<bean id="nestedCustomTagBean" class="org.springframework.beans.TestBean" scope="prototype"> <bean id="nestedCustomTagBean" class="test.beans.TestBean" scope="prototype">
<property name="someList"> <property name="someList">
<list> <list>
<util:constant static-field="java.lang.Integer.MIN_VALUE"/> <util:constant static-field="java.lang.Integer.MIN_VALUE"/>
@ -110,7 +110,7 @@
</property> </property>
</bean> </bean>
<bean id="circularCollectionsBean" class="org.springframework.beans.TestBean"> <bean id="circularCollectionsBean" class="test.beans.TestBean">
<property name="someList"> <property name="someList">
<util:list> <util:list>
<ref bean="circularCollectionsBean"/> <ref bean="circularCollectionsBean"/>
@ -140,7 +140,7 @@
<entry key="foo" value-ref="circularCollectionBeansBean"/> <entry key="foo" value-ref="circularCollectionBeansBean"/>
</util:map> </util:map>
<bean id="circularCollectionBeansBean" class="org.springframework.beans.TestBean"> <bean id="circularCollectionBeansBean" class="test.beans.TestBean">
<property name="someList" ref="circularList"/> <property name="someList" ref="circularList"/>
<property name="someSet" ref="circularSet"/> <property name="someSet" ref="circularSet"/>
<property name="someMap" ref="circularMap"/> <property name="someMap" ref="circularMap"/>

View File

@ -9,5 +9,5 @@ This is a top level block comment
<!-- more trickery--> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd"><!-- some nasty stuff --> <!-- 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> <beans>
<bean id="testBean" class="org.springframework.beans.TestBean"/> <bean id="testBean" class="test.beans.TestBean"/>
</beans> </beans>

View File

@ -7,5 +7,5 @@ This is a top level block comment
the parser now --> <!-- <beans> 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 --> <!-- 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.beans.TestBean"/> <bean id="testBean" class="test.beans.TestBean"/>
</beans> </beans>

View File

@ -4,15 +4,15 @@
xmlns:spring="http://www.springframework.org/schema/beans" 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"> 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:bean id="testBean1" class="test.beans.TestBean">
<spring:meta key="foo" value="bar"/> <spring:meta key="foo" value="bar"/>
</spring:bean> </spring:bean>
<spring:bean id="testBean2" class="org.springframework.beans.TestBean" parent="testBean1"> <spring:bean id="testBean2" class="test.beans.TestBean" parent="testBean1">
<spring:meta key="abc" value="123"/> <spring:meta key="abc" value="123"/>
</spring:bean> </spring:bean>
<spring:bean id="testBean3" class="org.springframework.beans.TestBean"> <spring:bean id="testBean3" class="test.beans.TestBean">
<spring:property name="name" value="Rob"> <spring:property name="name" value="Rob">
<spring:meta key="surname" value="Harrop"/> <spring:meta key="surname" value="Harrop"/>
</spring:property> </spring:property>