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 ef4bda8402b..7033765c0b3 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 @@ -58,7 +58,7 @@ import org.springframework.context.ConfigurableApplicationContext; * {@link org.springframework.context.annotation.Bean @Bean}-methods * * - * Consult the Javadoc for + *

Consult the Javadoc for * {@link org.springframework.context.annotation.Configuration @Configuration} and * {@link org.springframework.context.annotation.Bean @Bean} * for further information regarding the configuration and semantics of @@ -270,16 +270,25 @@ public @interface ContextConfiguration { * 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 + *

The default concrete implementation chosen at runtime will be either * {@link org.springframework.test.context.support.DelegatingSmartContextLoader - * DelegatingSmartContextLoader}. For further details on the default behavior - * of various concrete {@code ContextLoaders}, check out the Javadoc for + * DelegatingSmartContextLoader} or + * {@link org.springframework.test.context.web.WebDelegatingSmartContextLoader + * WebDelegatingSmartContextLoader} depending on the absence or presence of + * {@link org.springframework.test.context.web.WebAppConfiguration + * @WebAppConfiguration}. For further details on the default behavior + * of various concrete {@code SmartContextLoaders}, check out the Javadoc for * {@link org.springframework.test.context.support.AbstractContextLoader * AbstractContextLoader}, * {@link org.springframework.test.context.support.GenericXmlContextLoader - * GenericXmlContextLoader}, and + * GenericXmlContextLoader}, * {@link org.springframework.test.context.support.AnnotationConfigContextLoader - * AnnotationConfigContextLoader}. + * AnnotationConfigContextLoader}, + * {@link org.springframework.test.context.web.GenericXmlWebContextLoader + * GenericXmlWebContextLoader}, and + * {@link org.springframework.test.context.web.AnnotationConfigWebContextLoader + * AnnotationConfigWebContextLoader}. + * * @since 2.5 */ Class loader() default ContextLoader.class; 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 e9a68af8295..7eac62d6e5d 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 @@ -28,11 +28,11 @@ import java.lang.annotation.Target; * a hierarchy of {@link org.springframework.context.ApplicationContext * ApplicationContexts} for integration tests. * - *

Examples

+ *

Examples

*

The following JUnit-based examples demonstrate common configuration * scenarios for integration tests that require the use of context hierarchies. * - *

Single Test Class with Context Hierarchy

+ *

Single Test Class with Context Hierarchy

*

{@code ControllerIntegrationTests} represents a typical integration testing * scenario for a Spring MVC web application by declaring a context hierarchy * consisting of two levels, one for the root {@code WebApplicationContext} @@ -56,7 +56,7 @@ import java.lang.annotation.Target; * // ... * } * - *

Class Hierarchy with Implicit Parent Context

+ *

Class Hierarchy with Implicit Parent Context

*

The following test classes define a context hierarchy within a test class * hierarchy. {@code AbstractWebTests} declares the configuration for a root * {@code WebApplicationContext} in a Spring-powered web application. Note, @@ -82,7 +82,7 @@ import java.lang.annotation.Target; * @ContextHierarchy(@ContextConfiguration("/spring/rest-ws-config.xml") * public class RestWebServiceTests extends AbstractWebTests {} * - *

Class Hierarchy with Merged Context Hierarchy Configuration

+ *

Class Hierarchy with Merged Context Hierarchy Configuration

*

The following classes demonstrate the use of named hierarchy levels * in order to merge the configuration for specific levels in a context * hierarchy. {@code BaseTests} defines two levels in the hierarchy, {@code parent} @@ -110,7 +110,7 @@ import java.lang.annotation.Target; * ) * public class ExtendedTests extends BaseTests {} * - *

Class Hierarchy with Overridden Context Hierarchy Configuration

+ *

Class Hierarchy with Overridden Context Hierarchy Configuration

*

In contrast to the previous example, this example demonstrates how to * override the configuration for a given named level in a context hierarchy * by setting the {@link ContextConfiguration#inheritLocations} flag to {@code false}.