diff --git a/spring-test/src/main/java/org/springframework/test/context/ContextConfiguration.java b/spring-test/src/main/java/org/springframework/test/context/ContextConfiguration.java index f50c0e2a93..9087bdbeaf 100644 --- a/spring-test/src/main/java/org/springframework/test/context/ContextConfiguration.java +++ b/spring-test/src/main/java/org/springframework/test/context/ContextConfiguration.java @@ -91,10 +91,8 @@ public @interface ContextConfiguration { /** * Alias for {@link #locations}. - * *

This attribute may not be used in conjunction with * {@link #locations}, but it may be used instead of {@link #locations}. - * * @since 3.0 * @see #inheritLocations */ @@ -104,7 +102,6 @@ public @interface ContextConfiguration { /** * The resource locations to use for loading an * {@link org.springframework.context.ApplicationContext ApplicationContext}. - * *

Check out the Javadoc for * {@link org.springframework.test.context.support.AbstractContextLoader#modifyLocations * AbstractContextLoader.modifyLocations()} for details on how a location @@ -113,7 +110,6 @@ public @interface ContextConfiguration { * {@link org.springframework.test.context.support.AbstractContextLoader#generateDefaultLocations * AbstractContextLoader.generateDefaultLocations()} for details on the * default locations that are going to be used if none are specified. - * *

Note that the aforementioned default rules only apply for a standard * {@link org.springframework.test.context.support.AbstractContextLoader * AbstractContextLoader} subclass such as @@ -122,10 +118,8 @@ public @interface ContextConfiguration { * which are the effective default implementations used at runtime if * {@code locations} are configured. See the documentation for {@link #loader} * for further details regarding default loaders. - * *

This attribute may not be used in conjunction with * {@link #value}, but it may be used instead of {@link #value}. - * * @since 2.5 * @see #inheritLocations */ @@ -135,14 +129,12 @@ public @interface ContextConfiguration { /** * The annotated classes to use for loading an * {@link org.springframework.context.ApplicationContext ApplicationContext}. - * - *

Check out the Javadoc for + *

Check out the javadoc for * {@link org.springframework.test.context.support.AnnotationConfigContextLoader#detectDefaultConfigurationClasses * AnnotationConfigContextLoader.detectDefaultConfigurationClasses()} for details * on how default configuration classes will be detected if no * annotated classes are specified. See the documentation for * {@link #loader} for further details regarding default loaders. - * * @since 3.1 * @see org.springframework.context.annotation.Configuration * @see org.springframework.test.context.support.AnnotationConfigContextLoader @@ -153,16 +145,13 @@ public @interface ContextConfiguration { /** * The application context initializer classes to use for initializing * a {@link ConfigurableApplicationContext}. - * *

The concrete {@code ConfigurableApplicationContext} type supported by each * declared initializer must be compatible with the type of {@code ApplicationContext} * created by the {@link SmartContextLoader} in use. - * *

{@code SmartContextLoader} implementations typically detect whether * Spring's {@link org.springframework.core.Ordered Ordered} interface has been * implemented or if the @{@link org.springframework.core.annotation.Order Order} * annotation is present and sort instances accordingly prior to invoking them. - * * @since 3.2 * @see org.springframework.context.ApplicationContextInitializer * @see org.springframework.context.ConfigurableApplicationContext @@ -174,7 +163,6 @@ public @interface ContextConfiguration { /** * Whether or not {@link #locations resource locations} or annotated * classes from test superclasses should be inherited. - * *

The default value is {@code true}. This means that an annotated * class will inherit the resource locations or annotated classes * defined by test superclasses. Specifically, the resource locations or @@ -182,12 +170,10 @@ public @interface ContextConfiguration { * resource locations or annotated classes defined by test superclasses. * Thus, subclasses have the option of extending the list of resource * locations or annotated classes. - * *

If {@code inheritLocations} is set to {@code false}, the * resource locations or annotated classes for the annotated class * will shadow and effectively replace any resource locations * or annotated classes defined by superclasses. - * *

In the following example that uses path-based resource locations, the * {@link org.springframework.context.ApplicationContext ApplicationContext} * for {@code ExtendedTest} will be loaded from @@ -206,7 +192,6 @@ public @interface ContextConfiguration { * // ... * } * - * *

Similarly, in the following example that uses annotated * classes, the * {@link org.springframework.context.ApplicationContext ApplicationContext} @@ -233,18 +218,15 @@ public @interface ContextConfiguration { /** * Whether or not {@linkplain #initializers context initializers} from test * superclasses should be inherited. - * *

The default value is {@code true}. This means that an annotated * class will inherit the application context initializers defined * by test superclasses. Specifically, the initializers for a given test * class will be added to the set of initializers defined by test * superclasses. Thus, subclasses have the option of extending the * set of initializers. - * *

If {@code inheritInitializers} is set to {@code false}, the * initializers for the annotated class will shadow and effectively * replace any initializers defined by superclasses. - * *

In the following example, the * {@link org.springframework.context.ApplicationContext ApplicationContext} * for {@code ExtendedTest} will be initialized using @@ -272,12 +254,10 @@ public @interface ContextConfiguration { * The type of {@link SmartContextLoader} (or {@link ContextLoader}) to use * for loading an {@link org.springframework.context.ApplicationContext * ApplicationContext}. - * *

If not specified, the loader will be inherited from the first superclass * that is annotated with {@code @ContextConfiguration} and specifies an * explicit loader. If no class in the hierarchy specifies an explicit * loader, a default loader will be used instead. - * *

The default concrete implementation chosen at runtime will be either * {@link org.springframework.test.context.support.DelegatingSmartContextLoader * DelegatingSmartContextLoader} or @@ -293,23 +273,19 @@ public @interface ContextConfiguration { * {@link org.springframework.test.context.web.GenericXmlWebContextLoader GenericXmlWebContextLoader}, * {@link org.springframework.test.context.web.GenericGroovyXmlWebContextLoader GenericGroovyXmlWebContextLoader}, and * {@link org.springframework.test.context.web.AnnotationConfigWebContextLoader AnnotationConfigWebContextLoader}. - * * @since 2.5 */ Class loader() default ContextLoader.class; /** * The name of the context hierarchy level represented by this configuration. - * *

If not specified the name will be inferred based on the numerical level * within all declared contexts within the hierarchy. - * *

This attribute is only applicable when used within a test class hierarchy * that is configured using {@code @ContextHierarchy}, in which case the name * can be used for merging or overriding this configuration * with configuration of the same name in hierarchy levels defined in superclasses. * See the Javadoc for {@link ContextHierarchy @ContextHierarchy} for details. - * * @since 3.2.2 */ String name() default ""; diff --git a/spring-test/src/main/java/org/springframework/test/context/ContextHierarchy.java b/spring-test/src/main/java/org/springframework/test/context/ContextHierarchy.java index 813fd30672..61b2fa8cf6 100644 --- a/spring-test/src/main/java/org/springframework/test/context/ContextHierarchy.java +++ b/spring-test/src/main/java/org/springframework/test/context/ContextHierarchy.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2015 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. @@ -148,7 +148,6 @@ public @interface ContextHierarchy { /** * A list of {@link ContextConfiguration @ContextConfiguration} instances, * each of which defines a level in the context hierarchy. - * *

If you need to merge or override the configuration for a given level * of the context hierarchy within a test class hierarchy, you must explicitly * name that level by supplying the same value to the {@link ContextConfiguration#name diff --git a/spring-test/src/main/java/org/springframework/test/context/ContextLoader.java b/spring-test/src/main/java/org/springframework/test/context/ContextLoader.java index 71faf5e522..3a2b0c300e 100644 --- a/spring-test/src/main/java/org/springframework/test/context/ContextLoader.java +++ b/spring-test/src/main/java/org/springframework/test/context/ContextLoader.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2015 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. @@ -33,8 +33,7 @@ import org.springframework.context.ApplicationContext; * The results of {@link #processLocations(Class, String...) processLocations()} * should then be supplied to {@link #loadContext(String...) loadContext()}. * - *

Concrete implementations must provide a {@code public} no-args - * constructor. + *

Concrete implementations must provide a {@code public} no-args constructor. * *

Spring provides the following out-of-the-box implementations: *