diff --git a/org.springframework.context.support/.classpath b/org.springframework.context.support/.classpath
index 95e7932fe10..228d1223e1b 100644
--- a/org.springframework.context.support/.classpath
+++ b/org.springframework.context.support/.classpath
@@ -26,5 +26,6 @@
Implements InitializingBean interface, so we can check that + * factories get this lifecycle callback if they want. + * + * @author Rod Johnson + * @since 10.03.2003 + */ +public class DummyFactory + implements FactoryBean, BeanNameAware, BeanFactoryAware, InitializingBean, DisposableBean { + + public static final String SINGLETON_NAME = "Factory singleton"; + + private static boolean prototypeCreated; + + /** + * Clear static state. + */ + public static void reset() { + prototypeCreated = false; + } + + + /** + * Default is for factories to return a singleton instance. + */ + private boolean singleton = true; + + private String beanName; + + private AutowireCapableBeanFactory beanFactory; + + private boolean postProcessed; + + private boolean initialized; + + private TestBean testBean; + + private TestBean otherTestBean; + + + public DummyFactory() { + this.testBean = new TestBean(); + this.testBean.setName(SINGLETON_NAME); + this.testBean.setAge(25); + } + + /** + * Return if the bean managed by this factory is a singleton. + * @see org.springframework.beans.factory.FactoryBean#isSingleton() + */ + public boolean isSingleton() { + return this.singleton; + } + + /** + * Set if the bean managed by this factory is a singleton. + */ + public void setSingleton(boolean singleton) { + this.singleton = singleton; + } + + public void setBeanName(String beanName) { + this.beanName = beanName; + } + + public String getBeanName() { + return beanName; + } + + public void setBeanFactory(BeanFactory beanFactory) { + this.beanFactory = (AutowireCapableBeanFactory) beanFactory; + this.beanFactory.applyBeanPostProcessorsBeforeInitialization(this.testBean, this.beanName); + } + + public BeanFactory getBeanFactory() { + return beanFactory; + } + + public void setPostProcessed(boolean postProcessed) { + this.postProcessed = postProcessed; + } + + public boolean isPostProcessed() { + return postProcessed; + } + + public void setOtherTestBean(TestBean otherTestBean) { + this.otherTestBean = otherTestBean; + this.testBean.setSpouse(otherTestBean); + } + + public TestBean getOtherTestBean() { + return otherTestBean; + } + + public void afterPropertiesSet() { + if (initialized) { + throw new RuntimeException("Cannot call afterPropertiesSet twice on the one bean"); + } + this.initialized = true; + } + + /** + * Was this initialized by invocation of the + * afterPropertiesSet() method from the InitializingBean interface? + */ + public boolean wasInitialized() { + return initialized; + } + + public static boolean wasPrototypeCreated() { + return prototypeCreated; + } + + + /** + * Return the managed object, supporting both singleton + * and prototype mode. + * @see org.springframework.beans.factory.FactoryBean#getObject() + */ + public Object getObject() throws BeansException { + if (isSingleton()) { + return this.testBean; + } + else { + TestBean prototype = new TestBean("prototype created at " + System.currentTimeMillis(), 11); + if (this.beanFactory != null) { + this.beanFactory.applyBeanPostProcessorsBeforeInitialization(prototype, this.beanName); + } + prototypeCreated = true; + return prototype; + } + } + + public Class getObjectType() { + return TestBean.class; + } + + + public void destroy() { + if (this.testBean != null) { + this.testBean.setName(null); + } + } + +} diff --git a/org.springframework.context.support/src/test/java/org/springframework/beans/factory/LifecycleBean.java b/org.springframework.context.support/src/test/java/org/springframework/beans/factory/LifecycleBean.java new file mode 100644 index 00000000000..19b7da62f8d --- /dev/null +++ b/org.springframework.context.support/src/test/java/org/springframework/beans/factory/LifecycleBean.java @@ -0,0 +1,158 @@ +/* + * Copyright 2002-2007 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 org.springframework.beans.factory; + +import org.springframework.beans.BeansException; +import org.springframework.beans.factory.config.BeanPostProcessor; + +/** + * Simple test of BeanFactory initialization and lifecycle callbacks. + * + * @author Rod Johnson + * @author Colin Sampaleanu + * @since 12.03.2003 + */ +public class LifecycleBean implements BeanNameAware, BeanFactoryAware, InitializingBean, DisposableBean { + + protected boolean initMethodDeclared = false; + + protected String beanName; + + protected BeanFactory owningFactory; + + protected boolean postProcessedBeforeInit; + + protected boolean inited; + + protected boolean initedViaDeclaredInitMethod; + + protected boolean postProcessedAfterInit; + + protected boolean destroyed; + + + public void setInitMethodDeclared(boolean initMethodDeclared) { + this.initMethodDeclared = initMethodDeclared; + } + + public boolean isInitMethodDeclared() { + return initMethodDeclared; + } + + public void setBeanName(String name) { + this.beanName = name; + } + + public String getBeanName() { + return beanName; + } + + public void setBeanFactory(BeanFactory beanFactory) { + this.owningFactory = beanFactory; + } + + public void postProcessBeforeInit() { + if (this.inited || this.initedViaDeclaredInitMethod) { + throw new RuntimeException("Factory called postProcessBeforeInit after afterPropertiesSet"); + } + if (this.postProcessedBeforeInit) { + throw new RuntimeException("Factory called postProcessBeforeInit twice"); + } + this.postProcessedBeforeInit = true; + } + + public void afterPropertiesSet() { + if (this.owningFactory == null) { + throw new RuntimeException("Factory didn't call setBeanFactory before afterPropertiesSet on lifecycle bean"); + } + if (!this.postProcessedBeforeInit) { + throw new RuntimeException("Factory didn't call postProcessBeforeInit before afterPropertiesSet on lifecycle bean"); + } + if (this.initedViaDeclaredInitMethod) { + throw new RuntimeException("Factory initialized via declared init method before initializing via afterPropertiesSet"); + } + if (this.inited) { + throw new RuntimeException("Factory called afterPropertiesSet twice"); + } + this.inited = true; + } + + public void declaredInitMethod() { + if (!this.inited) { + throw new RuntimeException("Factory didn't call afterPropertiesSet before declared init method"); + } + + if (this.initedViaDeclaredInitMethod) { + throw new RuntimeException("Factory called declared init method twice"); + } + this.initedViaDeclaredInitMethod = true; + } + + public void postProcessAfterInit() { + if (!this.inited) { + throw new RuntimeException("Factory called postProcessAfterInit before afterPropertiesSet"); + } + if (this.initMethodDeclared && !this.initedViaDeclaredInitMethod) { + throw new RuntimeException("Factory called postProcessAfterInit before calling declared init method"); + } + if (this.postProcessedAfterInit) { + throw new RuntimeException("Factory called postProcessAfterInit twice"); + } + this.postProcessedAfterInit = true; + } + + /** + * Dummy business method that will fail unless the factory + * managed the bean's lifecycle correctly + */ + public void businessMethod() { + if (!this.inited || (this.initMethodDeclared && !this.initedViaDeclaredInitMethod) || + !this.postProcessedAfterInit) { + throw new RuntimeException("Factory didn't initialize lifecycle object correctly"); + } + } + + public void destroy() { + if (this.destroyed) { + throw new IllegalStateException("Already destroyed"); + } + this.destroyed = true; + } + + public boolean isDestroyed() { + return destroyed; + } + + + public static class PostProcessor implements BeanPostProcessor { + + public Object postProcessBeforeInitialization(Object bean, String name) throws BeansException { + if (bean instanceof LifecycleBean) { + ((LifecycleBean) bean).postProcessBeforeInit(); + } + return bean; + } + + public Object postProcessAfterInitialization(Object bean, String name) throws BeansException { + if (bean instanceof LifecycleBean) { + ((LifecycleBean) bean).postProcessAfterInit(); + } + return bean; + } + } + +} \ No newline at end of file diff --git a/org.springframework.context.support/src/test/java/org/springframework/beans/factory/MustBeInitialized.java b/org.springframework.context.support/src/test/java/org/springframework/beans/factory/MustBeInitialized.java new file mode 100644 index 00000000000..1dedf6624c2 --- /dev/null +++ b/org.springframework.context.support/src/test/java/org/springframework/beans/factory/MustBeInitialized.java @@ -0,0 +1,44 @@ +/* + * 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 org.springframework.beans.factory; + +/** + * Simple test of BeanFactory initialization + * @author Rod Johnson + * @since 12.03.2003 + */ +public class MustBeInitialized implements InitializingBean { + + private boolean inited; + + /** + * @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet() + */ + public void afterPropertiesSet() throws Exception { + this.inited = true; + } + + /** + * Dummy business method that will fail unless the factory + * managed the bean's lifecycle correctly + */ + public void businessMethod() { + if (!this.inited) + throw new RuntimeException("Factory didn't call afterPropertiesSet() on MustBeInitialized object"); + } + +} diff --git a/org.springframework.context.support/src/test/java/org/springframework/context/ACATester.java b/org.springframework.context.support/src/test/java/org/springframework/context/ACATester.java new file mode 100644 index 00000000000..1bda64a785f --- /dev/null +++ b/org.springframework.context.support/src/test/java/org/springframework/context/ACATester.java @@ -0,0 +1,48 @@ +/* + * 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 org.springframework.context; + +import java.util.Locale; + +public class ACATester implements ApplicationContextAware { + + private ApplicationContext ac; + + public void setApplicationContext(ApplicationContext ctx) throws ApplicationContextException { + // check reinitialization + if (this.ac != null) { + throw new IllegalStateException("Already initialized"); + } + + // check message source availability + if (ctx != null) { + try { + ctx.getMessage("code1", null, Locale.getDefault()); + } + catch (NoSuchMessageException ex) { + // expected + } + } + + this.ac = ctx; + } + + public ApplicationContext getApplicationContext() { + return ac; + } + +} diff --git a/org.springframework.context.support/src/test/java/org/springframework/context/AbstractApplicationContextTests.java b/org.springframework.context.support/src/test/java/org/springframework/context/AbstractApplicationContextTests.java new file mode 100644 index 00000000000..d014d770e16 --- /dev/null +++ b/org.springframework.context.support/src/test/java/org/springframework/context/AbstractApplicationContextTests.java @@ -0,0 +1,157 @@ +/* + * 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 org.springframework.context; + +import java.util.Locale; + +import org.springframework.beans.TestBean; +import org.springframework.beans.factory.AbstractListableBeanFactoryTests; +import org.springframework.beans.factory.BeanFactory; +import org.springframework.beans.factory.LifecycleBean; + +/** + * @author Rod Johnson + * @author Juergen Hoeller + */ +public abstract class AbstractApplicationContextTests extends AbstractListableBeanFactoryTests { + + /** Must be supplied as XML */ + public static final String TEST_NAMESPACE = "testNamespace"; + + protected ConfigurableApplicationContext applicationContext; + + /** Subclass must register this */ + protected TestListener listener = new TestListener(); + + protected TestListener parentListener = new TestListener(); + + protected void setUp() throws Exception { + this.applicationContext = createContext(); + } + + protected BeanFactory getBeanFactory() { + return applicationContext; + } + + protected ApplicationContext getApplicationContext() { + return applicationContext; + } + + /** + * Must register a TestListener. + * Must register standard beans. + * Parent must register rod with name Roderick + * and father with name Albert. + */ + protected abstract ConfigurableApplicationContext createContext() throws Exception; + + public void testContextAwareSingletonWasCalledBack() throws Exception { + ACATester aca = (ACATester) applicationContext.getBean("aca"); + assertTrue("has had context set", aca.getApplicationContext() == applicationContext); + Object aca2 = applicationContext.getBean("aca"); + assertTrue("Same instance", aca == aca2); + assertTrue("Says is singleton", applicationContext.isSingleton("aca")); + } + + public void testContextAwarePrototypeWasCalledBack() throws Exception { + ACATester aca = (ACATester) applicationContext.getBean("aca-prototype"); + assertTrue("has had context set", aca.getApplicationContext() == applicationContext); + Object aca2 = applicationContext.getBean("aca-prototype"); + assertTrue("NOT Same instance", aca != aca2); + assertTrue("Says is prototype", !applicationContext.isSingleton("aca-prototype")); + } + + public void testParentNonNull() { + assertTrue("parent isn't null", applicationContext.getParent() != null); + } + + public void testGrandparentNull() { + assertTrue("grandparent is null", applicationContext.getParent().getParent() == null); + } + + public void testOverrideWorked() throws Exception { + TestBean rod = (TestBean) applicationContext.getParent().getBean("rod"); + assertTrue("Parent's name differs", rod.getName().equals("Roderick")); + } + + public void testGrandparentDefinitionFound() throws Exception { + TestBean dad = (TestBean) applicationContext.getBean("father"); + assertTrue("Dad has correct name", dad.getName().equals("Albert")); + } + + public void testGrandparentTypedDefinitionFound() throws Exception { + TestBean dad = (TestBean) applicationContext.getBean("father", TestBean.class); + assertTrue("Dad has correct name", dad.getName().equals("Albert")); + } + + public void testCloseTriggersDestroy() { + LifecycleBean lb = (LifecycleBean) applicationContext.getBean("lifecycle"); + assertTrue("Not destroyed", !lb.isDestroyed()); + applicationContext.close(); + if (applicationContext.getParent() != null) { + ((ConfigurableApplicationContext) applicationContext.getParent()).close(); + } + assertTrue("Destroyed", lb.isDestroyed()); + applicationContext.close(); + if (applicationContext.getParent() != null) { + ((ConfigurableApplicationContext) applicationContext.getParent()).close(); + } + assertTrue("Destroyed", lb.isDestroyed()); + } + + public void testMessageSource() throws NoSuchMessageException { + assertEquals("message1", applicationContext.getMessage("code1", null, Locale.getDefault())); + assertEquals("message2", applicationContext.getMessage("code2", null, Locale.getDefault())); + + try { + applicationContext.getMessage("code0", null, Locale.getDefault()); + fail("looking for code0 should throw a NoSuchMessageException"); + } + catch (NoSuchMessageException ex) { + // that's how it should be + } + } + + public void testEvents() throws Exception { + listener.zeroCounter(); + parentListener.zeroCounter(); + assertTrue("0 events before publication", listener.getEventCount() == 0); + assertTrue("0 parent events before publication", parentListener.getEventCount() == 0); + this.applicationContext.publishEvent(new MyEvent(this)); + assertTrue("1 events after publication, not " + listener.getEventCount(), listener.getEventCount() == 1); + assertTrue("1 parent events after publication", parentListener.getEventCount() == 1); + } + + public void testBeanAutomaticallyHearsEvents() throws Exception { + //String[] listenerNames = ((ListableBeanFactory) applicationContext).getBeanDefinitionNames(ApplicationListener.class); + //assertTrue("listeners include beanThatListens", Arrays.asList(listenerNames).contains("beanThatListens")); + BeanThatListens b = (BeanThatListens) applicationContext.getBean("beanThatListens"); + b.zero(); + assertTrue("0 events before publication", b.getEventCount() == 0); + this.applicationContext.publishEvent(new MyEvent(this)); + assertTrue("1 events after publication, not " + b.getEventCount(), b.getEventCount() == 1); + } + + + public static class MyEvent extends ApplicationEvent { + + public MyEvent(Object source) { + super(source); + } + } + +} diff --git a/org.springframework.context.support/src/test/java/org/springframework/context/BeanThatBroadcasts.java b/org.springframework.context.support/src/test/java/org/springframework/context/BeanThatBroadcasts.java new file mode 100644 index 00000000000..f525d38fe16 --- /dev/null +++ b/org.springframework.context.support/src/test/java/org/springframework/context/BeanThatBroadcasts.java @@ -0,0 +1,36 @@ +/* + * Copyright 2002-2007 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 org.springframework.context; + +/** + * @author Juergen Hoeller + */ +public class BeanThatBroadcasts implements ApplicationContextAware { + + public ApplicationContext applicationContext; + + public int receivedCount; + + + public void setApplicationContext(ApplicationContext applicationContext) { + this.applicationContext = applicationContext; + if (applicationContext.getDisplayName().indexOf("listener") != -1) { + applicationContext.getBean("listener"); + } + } + +} diff --git a/org.springframework.context.support/src/test/java/org/springframework/context/BeanThatListens.java b/org.springframework.context.support/src/test/java/org/springframework/context/BeanThatListens.java new file mode 100644 index 00000000000..9ab3f8ea40d --- /dev/null +++ b/org.springframework.context.support/src/test/java/org/springframework/context/BeanThatListens.java @@ -0,0 +1,61 @@ +/* + * Copyright 2002-2007 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 org.springframework.context; + +import java.util.Map; + +/** + * A stub {@link ApplicationListener}. + * + * @author Thomas Risberg + * @author Juergen Hoeller + */ +public class BeanThatListens implements ApplicationListener { + + private BeanThatBroadcasts beanThatBroadcasts; + + private int eventCount; + + + public BeanThatListens() { + } + + public BeanThatListens(BeanThatBroadcasts beanThatBroadcasts) { + this.beanThatBroadcasts = beanThatBroadcasts; + Map beans = beanThatBroadcasts.applicationContext.getBeansOfType(BeanThatListens.class); + if (!beans.isEmpty()) { + throw new IllegalStateException("Shouldn't have found any BeanThatListens instances"); + } + } + + + public void onApplicationEvent(ApplicationEvent event) { + eventCount++; + if (beanThatBroadcasts != null) { + beanThatBroadcasts.receivedCount++; + } + } + + public int getEventCount() { + return eventCount; + } + + public void zero() { + eventCount = 0; + } + +} diff --git a/org.springframework.context.support/src/test/java/org/springframework/context/LifecycleContextBean.java b/org.springframework.context.support/src/test/java/org/springframework/context/LifecycleContextBean.java new file mode 100644 index 00000000000..c3aba92b5f8 --- /dev/null +++ b/org.springframework.context.support/src/test/java/org/springframework/context/LifecycleContextBean.java @@ -0,0 +1,52 @@ +/* + * 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 org.springframework.context; + +import org.springframework.beans.BeansException; +import org.springframework.beans.factory.BeanFactory; +import org.springframework.beans.factory.LifecycleBean; + +/** + * Simple bean to test ApplicationContext lifecycle methods for beans + * + * @author Colin Sampaleanu + * @since 03.07.2004 + */ +public class LifecycleContextBean extends LifecycleBean implements ApplicationContextAware { + + protected ApplicationContext owningContext; + + public void setBeanFactory(BeanFactory beanFactory) { + super.setBeanFactory(beanFactory); + if (this.owningContext != null) + throw new RuntimeException("Factory called setBeanFactory after setApplicationContext"); + } + + public void afterPropertiesSet() { + super.afterPropertiesSet(); + if (this.owningContext == null) + throw new RuntimeException("Factory didn't call setAppliationContext before afterPropertiesSet on lifecycle bean"); + } + + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { + if (this.owningFactory == null) + throw new RuntimeException("Factory called setApplicationContext before setBeanFactory"); + + this.owningContext = applicationContext; + } + +} diff --git a/org.springframework.context.support/src/test/java/org/springframework/context/TestListener.java b/org.springframework.context.support/src/test/java/org/springframework/context/TestListener.java new file mode 100644 index 00000000000..b9f57f73087 --- /dev/null +++ b/org.springframework.context.support/src/test/java/org/springframework/context/TestListener.java @@ -0,0 +1,41 @@ +/* + * Copyright 2002-2007 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 org.springframework.context; + +/** + * Listener that maintains a global count of events. + * + * @author Rod Johnson + * @since January 21, 2001 + */ +public class TestListener implements ApplicationListener { + + private int eventCount; + + public int getEventCount() { + return eventCount; + } + + public void zeroCounter() { + eventCount = 0; + } + + public void onApplicationEvent(ApplicationEvent e) { + ++eventCount; + } + +} diff --git a/org.springframework.testsuite/src/test/java/org/springframework/context/support/Assembler.java b/org.springframework.context.support/src/test/java/org/springframework/context/support/Assembler.java similarity index 100% rename from org.springframework.testsuite/src/test/java/org/springframework/context/support/Assembler.java rename to org.springframework.context.support/src/test/java/org/springframework/context/support/Assembler.java diff --git a/org.springframework.testsuite/src/test/java/org/springframework/context/support/AutowiredService.java b/org.springframework.context.support/src/test/java/org/springframework/context/support/AutowiredService.java similarity index 100% rename from org.springframework.testsuite/src/test/java/org/springframework/context/support/AutowiredService.java rename to org.springframework.context.support/src/test/java/org/springframework/context/support/AutowiredService.java diff --git a/org.springframework.testsuite/src/test/java/org/springframework/context/support/ClassPathXmlApplicationContextTests.java b/org.springframework.context.support/src/test/java/org/springframework/context/support/ClassPathXmlApplicationContextTests.java similarity index 100% rename from org.springframework.testsuite/src/test/java/org/springframework/context/support/ClassPathXmlApplicationContextTests.java rename to org.springframework.context.support/src/test/java/org/springframework/context/support/ClassPathXmlApplicationContextTests.java diff --git a/org.springframework.testsuite/src/test/java/org/springframework/context/support/FactoryBeanAndApplicationListener.java b/org.springframework.context.support/src/test/java/org/springframework/context/support/FactoryBeanAndApplicationListener.java similarity index 100% rename from org.springframework.testsuite/src/test/java/org/springframework/context/support/FactoryBeanAndApplicationListener.java rename to org.springframework.context.support/src/test/java/org/springframework/context/support/FactoryBeanAndApplicationListener.java diff --git a/org.springframework.testsuite/src/test/java/org/springframework/context/support/Logic.java b/org.springframework.context.support/src/test/java/org/springframework/context/support/Logic.java similarity index 100% rename from org.springframework.testsuite/src/test/java/org/springframework/context/support/Logic.java rename to org.springframework.context.support/src/test/java/org/springframework/context/support/Logic.java diff --git a/org.springframework.testsuite/src/test/java/org/springframework/context/support/ResourceBundleMessageSourceTests.java b/org.springframework.context.support/src/test/java/org/springframework/context/support/ResourceBundleMessageSourceTests.java similarity index 100% rename from org.springframework.testsuite/src/test/java/org/springframework/context/support/ResourceBundleMessageSourceTests.java rename to org.springframework.context.support/src/test/java/org/springframework/context/support/ResourceBundleMessageSourceTests.java diff --git a/org.springframework.testsuite/src/test/java/org/springframework/context/support/Service.java b/org.springframework.context.support/src/test/java/org/springframework/context/support/Service.java similarity index 100% rename from org.springframework.testsuite/src/test/java/org/springframework/context/support/Service.java rename to org.springframework.context.support/src/test/java/org/springframework/context/support/Service.java diff --git a/org.springframework.testsuite/src/test/java/org/springframework/context/support/StaticApplicationContextMulticasterTests.java b/org.springframework.context.support/src/test/java/org/springframework/context/support/StaticApplicationContextMulticasterTests.java similarity index 100% rename from org.springframework.testsuite/src/test/java/org/springframework/context/support/StaticApplicationContextMulticasterTests.java rename to org.springframework.context.support/src/test/java/org/springframework/context/support/StaticApplicationContextMulticasterTests.java diff --git a/org.springframework.testsuite/src/test/java/org/springframework/context/support/StaticApplicationContextTests.java b/org.springframework.context.support/src/test/java/org/springframework/context/support/StaticApplicationContextTests.java similarity index 100% rename from org.springframework.testsuite/src/test/java/org/springframework/context/support/StaticApplicationContextTests.java rename to org.springframework.context.support/src/test/java/org/springframework/context/support/StaticApplicationContextTests.java diff --git a/org.springframework.testsuite/src/test/java/org/springframework/context/support/StaticMessageSourceTests.java b/org.springframework.context.support/src/test/java/org/springframework/context/support/StaticMessageSourceTests.java similarity index 100% rename from org.springframework.testsuite/src/test/java/org/springframework/context/support/StaticMessageSourceTests.java rename to org.springframework.context.support/src/test/java/org/springframework/context/support/StaticMessageSourceTests.java diff --git a/org.springframework.testsuite/src/test/java/org/springframework/context/support/TestIF.java b/org.springframework.context.support/src/test/java/org/springframework/context/support/TestIF.java similarity index 100% rename from org.springframework.testsuite/src/test/java/org/springframework/context/support/TestIF.java rename to org.springframework.context.support/src/test/java/org/springframework/context/support/TestIF.java diff --git a/org.springframework.testsuite/src/test/java/org/springframework/context/support/aliasForParent.xml b/org.springframework.context.support/src/test/java/org/springframework/context/support/aliasForParent.xml similarity index 100% rename from org.springframework.testsuite/src/test/java/org/springframework/context/support/aliasForParent.xml rename to org.springframework.context.support/src/test/java/org/springframework/context/support/aliasForParent.xml diff --git a/org.springframework.testsuite/src/test/java/org/springframework/context/support/aliasThatOverridesParent.xml b/org.springframework.context.support/src/test/java/org/springframework/context/support/aliasThatOverridesParent.xml similarity index 100% rename from org.springframework.testsuite/src/test/java/org/springframework/context/support/aliasThatOverridesParent.xml rename to org.springframework.context.support/src/test/java/org/springframework/context/support/aliasThatOverridesParent.xml diff --git a/org.springframework.testsuite/src/test/java/org/springframework/context/support/childWithProxy.xml b/org.springframework.context.support/src/test/java/org/springframework/context/support/childWithProxy.xml similarity index 100% rename from org.springframework.testsuite/src/test/java/org/springframework/context/support/childWithProxy.xml rename to org.springframework.context.support/src/test/java/org/springframework/context/support/childWithProxy.xml diff --git a/org.springframework.testsuite/src/test/java/org/springframework/context/support/classWithPlaceholder.xml b/org.springframework.context.support/src/test/java/org/springframework/context/support/classWithPlaceholder.xml similarity index 100% rename from org.springframework.testsuite/src/test/java/org/springframework/context/support/classWithPlaceholder.xml rename to org.springframework.context.support/src/test/java/org/springframework/context/support/classWithPlaceholder.xml diff --git a/org.springframework.testsuite/src/test/java/org/springframework/context/support/invalidClass.xml b/org.springframework.context.support/src/test/java/org/springframework/context/support/invalidClass.xml similarity index 100% rename from org.springframework.testsuite/src/test/java/org/springframework/context/support/invalidClass.xml rename to org.springframework.context.support/src/test/java/org/springframework/context/support/invalidClass.xml diff --git a/org.springframework.testsuite/src/test/java/org/springframework/context/support/invalidValueType.xml b/org.springframework.context.support/src/test/java/org/springframework/context/support/invalidValueType.xml similarity index 100% rename from org.springframework.testsuite/src/test/java/org/springframework/context/support/invalidValueType.xml rename to org.springframework.context.support/src/test/java/org/springframework/context/support/invalidValueType.xml diff --git a/org.springframework.testsuite/src/test/java/org/springframework/context/support/messages.properties b/org.springframework.context.support/src/test/java/org/springframework/context/support/messages.properties similarity index 100% rename from org.springframework.testsuite/src/test/java/org/springframework/context/support/messages.properties rename to org.springframework.context.support/src/test/java/org/springframework/context/support/messages.properties diff --git a/org.springframework.testsuite/src/test/java/org/springframework/context/support/messages_de.properties b/org.springframework.context.support/src/test/java/org/springframework/context/support/messages_de.properties similarity index 100% rename from org.springframework.testsuite/src/test/java/org/springframework/context/support/messages_de.properties rename to org.springframework.context.support/src/test/java/org/springframework/context/support/messages_de.properties diff --git a/org.springframework.testsuite/src/test/java/org/springframework/context/support/messages_de_AT.properties b/org.springframework.context.support/src/test/java/org/springframework/context/support/messages_de_AT.properties similarity index 100% rename from org.springframework.testsuite/src/test/java/org/springframework/context/support/messages_de_AT.properties rename to org.springframework.context.support/src/test/java/org/springframework/context/support/messages_de_AT.properties diff --git a/org.springframework.testsuite/src/test/java/org/springframework/context/support/messages_de_AT_oo.properties b/org.springframework.context.support/src/test/java/org/springframework/context/support/messages_de_AT_oo.properties similarity index 100% rename from org.springframework.testsuite/src/test/java/org/springframework/context/support/messages_de_AT_oo.properties rename to org.springframework.context.support/src/test/java/org/springframework/context/support/messages_de_AT_oo.properties diff --git a/org.springframework.testsuite/src/test/java/org/springframework/context/support/messages_de_DE.xml b/org.springframework.context.support/src/test/java/org/springframework/context/support/messages_de_DE.xml similarity index 100% rename from org.springframework.testsuite/src/test/java/org/springframework/context/support/messages_de_DE.xml rename to org.springframework.context.support/src/test/java/org/springframework/context/support/messages_de_DE.xml diff --git a/org.springframework.testsuite/src/test/java/org/springframework/context/support/more-messages.properties b/org.springframework.context.support/src/test/java/org/springframework/context/support/more-messages.properties similarity index 100% rename from org.springframework.testsuite/src/test/java/org/springframework/context/support/more-messages.properties rename to org.springframework.context.support/src/test/java/org/springframework/context/support/more-messages.properties diff --git a/org.springframework.testsuite/src/test/java/org/springframework/context/support/override.properties b/org.springframework.context.support/src/test/java/org/springframework/context/support/override.properties similarity index 100% rename from org.springframework.testsuite/src/test/java/org/springframework/context/support/override.properties rename to org.springframework.context.support/src/test/java/org/springframework/context/support/override.properties diff --git a/org.springframework.testsuite/src/test/java/org/springframework/context/support/placeholder.properties b/org.springframework.context.support/src/test/java/org/springframework/context/support/placeholder.properties similarity index 100% rename from org.springframework.testsuite/src/test/java/org/springframework/context/support/placeholder.properties rename to org.springframework.context.support/src/test/java/org/springframework/context/support/placeholder.properties diff --git a/org.springframework.testsuite/src/test/java/org/springframework/context/support/simpleContext.xml b/org.springframework.context.support/src/test/java/org/springframework/context/support/simpleContext.xml similarity index 100% rename from org.springframework.testsuite/src/test/java/org/springframework/context/support/simpleContext.xml rename to org.springframework.context.support/src/test/java/org/springframework/context/support/simpleContext.xml diff --git a/org.springframework.testsuite/src/test/java/org/springframework/context/support/test.properties b/org.springframework.context.support/src/test/java/org/springframework/context/support/test.properties similarity index 100% rename from org.springframework.testsuite/src/test/java/org/springframework/context/support/test.properties rename to org.springframework.context.support/src/test/java/org/springframework/context/support/test.properties diff --git a/org.springframework.testsuite/src/test/java/org/springframework/context/support/test/aliased-contextC.xml b/org.springframework.context.support/src/test/java/org/springframework/context/support/test/aliased-contextC.xml similarity index 100% rename from org.springframework.testsuite/src/test/java/org/springframework/context/support/test/aliased-contextC.xml rename to org.springframework.context.support/src/test/java/org/springframework/context/support/test/aliased-contextC.xml diff --git a/org.springframework.testsuite/src/test/java/org/springframework/context/support/test/contextA.xml b/org.springframework.context.support/src/test/java/org/springframework/context/support/test/contextA.xml similarity index 100% rename from org.springframework.testsuite/src/test/java/org/springframework/context/support/test/contextA.xml rename to org.springframework.context.support/src/test/java/org/springframework/context/support/test/contextA.xml diff --git a/org.springframework.testsuite/src/test/java/org/springframework/context/support/test/contextB.xml b/org.springframework.context.support/src/test/java/org/springframework/context/support/test/contextB.xml similarity index 100% rename from org.springframework.testsuite/src/test/java/org/springframework/context/support/test/contextB.xml rename to org.springframework.context.support/src/test/java/org/springframework/context/support/test/contextB.xml diff --git a/org.springframework.testsuite/src/test/java/org/springframework/context/support/test/contextC.xml b/org.springframework.context.support/src/test/java/org/springframework/context/support/test/contextC.xml similarity index 100% rename from org.springframework.testsuite/src/test/java/org/springframework/context/support/test/contextC.xml rename to org.springframework.context.support/src/test/java/org/springframework/context/support/test/contextC.xml diff --git a/org.springframework.testsuite/src/test/java/org/springframework/context/support/test/import1.xml b/org.springframework.context.support/src/test/java/org/springframework/context/support/test/import1.xml similarity index 100% rename from org.springframework.testsuite/src/test/java/org/springframework/context/support/test/import1.xml rename to org.springframework.context.support/src/test/java/org/springframework/context/support/test/import1.xml diff --git a/org.springframework.testsuite/src/test/java/org/springframework/context/support/test/subtest/import2.xml b/org.springframework.context.support/src/test/java/org/springframework/context/support/test/subtest/import2.xml similarity index 100% rename from org.springframework.testsuite/src/test/java/org/springframework/context/support/test/subtest/import2.xml rename to org.springframework.context.support/src/test/java/org/springframework/context/support/test/subtest/import2.xml diff --git a/org.springframework.testsuite/src/test/java/org/springframework/context/support/testBeans.properties b/org.springframework.context.support/src/test/java/org/springframework/context/support/testBeans.properties similarity index 100% rename from org.springframework.testsuite/src/test/java/org/springframework/context/support/testBeans.properties rename to org.springframework.context.support/src/test/java/org/springframework/context/support/testBeans.properties