diff --git a/org.springframework.context/src/test/java/org/springframework/context/annotation/configuration/AbstractBeanDefinitionConfigurationClassTests.java b/org.springframework.context/src/test/java/org/springframework/context/annotation/configuration/AbstractBeanDefinitionConfigurationClassTests.java index 148f6f0819..675d0b3de2 100644 --- a/org.springframework.context/src/test/java/org/springframework/context/annotation/configuration/AbstractBeanDefinitionConfigurationClassTests.java +++ b/org.springframework.context/src/test/java/org/springframework/context/annotation/configuration/AbstractBeanDefinitionConfigurationClassTests.java @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.springframework.context.annotation.configuration; import static org.junit.Assert.*; diff --git a/org.springframework.context/src/test/java/org/springframework/context/annotation/configuration/AbstractJavaConfigTests.java b/org.springframework.context/src/test/java/org/springframework/context/annotation/configuration/AbstractJavaConfigTests.java deleted file mode 100644 index 101b0a2cca..0000000000 --- a/org.springframework.context/src/test/java/org/springframework/context/annotation/configuration/AbstractJavaConfigTests.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.springframework.context.annotation.configuration; - -import org.junit.Before; - - -public abstract class AbstractJavaConfigTests { - - @Before - public void setUp() { - - } - - // protected - -} diff --git a/org.springframework.context/src/test/java/org/springframework/context/annotation/configuration/AutowiredConfigurationTests.java b/org.springframework.context/src/test/java/org/springframework/context/annotation/configuration/AutowiredConfigurationTests.java index 9b2bdd00b7..cacb17f224 100644 --- a/org.springframework.context/src/test/java/org/springframework/context/annotation/configuration/AutowiredConfigurationTests.java +++ b/org.springframework.context/src/test/java/org/springframework/context/annotation/configuration/AutowiredConfigurationTests.java @@ -1,3 +1,19 @@ +/* + * Copyright 2002-2009 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.annotation.configuration; import static org.hamcrest.CoreMatchers.*; @@ -19,6 +35,13 @@ import test.beans.Colour; import test.beans.TestBean; +/** + * System tests covering use of {@link Autowired} and {@link Value} within + * {@link Configuration} classes. + * + * + * @author Chris Beams + */ public class AutowiredConfigurationTests { @Test diff --git a/org.springframework.context/src/test/java/org/springframework/context/annotation/configuration/AspectTests.java b/org.springframework.context/src/test/java/org/springframework/context/annotation/configuration/ConfigurationClassAspectIntegrationTests.java similarity index 61% rename from org.springframework.context/src/test/java/org/springframework/context/annotation/configuration/AspectTests.java rename to org.springframework.context/src/test/java/org/springframework/context/annotation/configuration/ConfigurationClassAspectIntegrationTests.java index 80f3013049..68379d78d3 100644 --- a/org.springframework.context/src/test/java/org/springframework/context/annotation/configuration/AspectTests.java +++ b/org.springframework.context/src/test/java/org/springframework/context/annotation/configuration/ConfigurationClassAspectIntegrationTests.java @@ -1,3 +1,19 @@ +/* + * Copyright 2002-2009 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.annotation.configuration; import static org.hamcrest.CoreMatchers.*; @@ -17,10 +33,22 @@ import org.springframework.core.io.ClassPathResource; import test.beans.TestBean; -public class AspectTests { +/** + * System tests covering use of AspectJ {@link Aspect}s in conjunction with {@link Configuration} classes. + * {@link Bean} methods may return aspects, or Configuration classes may themselves be annotated with Aspect. + * In the latter case, advice methods are declared inline within the Configuration class. This makes for a + * particularly convenient syntax requiring no extra artifact for the aspect. + * + *

Currently it is assumed that the user is bootstrapping Configuration class processing via XML (using + * annotation-config or component-scan), and thus will also use {@literal } to enable + * processing of the Aspect annotation. + * + * @author Chris Beams + */ +public class ConfigurationClassAspectIntegrationTests { private void assertAdviceWasApplied(Class configClass) { GenericApplicationContext ctx = new GenericApplicationContext( - new XmlBeanFactory(new ClassPathResource("aspectj-autoproxy-config.xml", AspectTests.class))); + new XmlBeanFactory(new ClassPathResource("aspectj-autoproxy-config.xml", ConfigurationClassAspectIntegrationTests.class))); ctx.addBeanFactoryPostProcessor(new ConfigurationClassPostProcessor()); ctx.registerBeanDefinition("config", new RootBeanDefinition(configClass)); ctx.refresh(); diff --git a/org.springframework.context/src/test/java/org/springframework/context/annotation/configuration/BasicTests.java b/org.springframework.context/src/test/java/org/springframework/context/annotation/configuration/ConfigurationClassProcessingTests.java similarity index 85% rename from org.springframework.context/src/test/java/org/springframework/context/annotation/configuration/BasicTests.java rename to org.springframework.context/src/test/java/org/springframework/context/annotation/configuration/ConfigurationClassProcessingTests.java index 9cfe880ada..171366e1fa 100644 --- a/org.springframework.context/src/test/java/org/springframework/context/annotation/configuration/BasicTests.java +++ b/org.springframework.context/src/test/java/org/springframework/context/annotation/configuration/ConfigurationClassProcessingTests.java @@ -1,3 +1,19 @@ +/* + * Copyright 2002-2009 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.annotation.configuration; import static org.hamcrest.CoreMatchers.*; @@ -21,7 +37,13 @@ import test.beans.ITestBean; import test.beans.TestBean; -public class BasicTests { +/** + * Miscellaneous system tests covering {@link Bean} naming, aliases, scoping and error + * handling within {@link Configuration} class definitions. + * + * @author Chris Beams + */ +public class ConfigurationClassProcessingTests { /** * Creates a new {@link BeanFactory}, populates it with a {@link BeanDefinition} for diff --git a/org.springframework.context/src/test/java/org/springframework/context/annotation/configuration/ImportTests.java b/org.springframework.context/src/test/java/org/springframework/context/annotation/configuration/ImportTests.java index 1076a026f7..78fe0f3ee9 100644 --- a/org.springframework.context/src/test/java/org/springframework/context/annotation/configuration/ImportTests.java +++ b/org.springframework.context/src/test/java/org/springframework/context/annotation/configuration/ImportTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2009 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. @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.springframework.context.annotation.configuration; import static org.hamcrest.CoreMatchers.*; diff --git a/org.springframework.context/src/test/java/org/springframework/context/annotation/configuration/PolymorphicConfigurationTests.java b/org.springframework.context/src/test/java/org/springframework/context/annotation/configuration/PolymorphicConfigurationTests.java index 0624f28547..e6a7f996e8 100644 --- a/org.springframework.context/src/test/java/org/springframework/context/annotation/configuration/PolymorphicConfigurationTests.java +++ b/org.springframework.context/src/test/java/org/springframework/context/annotation/configuration/PolymorphicConfigurationTests.java @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.springframework.context.annotation.configuration; import java.lang.annotation.Inherited;