Skip to content

Commit ccdb482

Browse files
committed
Document context hierarchy support in the TCF
This commit polishes the Javadoc for @ContextHierarchy and @ContextConfiguration. Issue: SPR-10357
1 parent 4e7098d commit ccdb482

File tree

2 files changed

+20
-11
lines changed

2 files changed

+20
-11
lines changed

spring-test/src/main/java/org/springframework/test/context/ContextConfiguration.java

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
* {@link org.springframework.context.annotation.Bean @Bean}-methods</li>
5959
* </ul>
6060
*
61-
* Consult the Javadoc for
61+
* <p>Consult the Javadoc for
6262
* {@link org.springframework.context.annotation.Configuration @Configuration} and
6363
* {@link org.springframework.context.annotation.Bean @Bean}
6464
* for further information regarding the configuration and semantics of
@@ -270,16 +270,25 @@
270270
* explicit loader. If no class in the hierarchy specifies an explicit
271271
* loader, a default loader will be used instead.
272272
*
273-
* <p>The default concrete implementation chosen at runtime will be
273+
* <p>The default concrete implementation chosen at runtime will be either
274274
* {@link org.springframework.test.context.support.DelegatingSmartContextLoader
275-
* DelegatingSmartContextLoader}. For further details on the default behavior
276-
* of various concrete {@code ContextLoaders}, check out the Javadoc for
275+
* DelegatingSmartContextLoader} or
276+
* {@link org.springframework.test.context.web.WebDelegatingSmartContextLoader
277+
* WebDelegatingSmartContextLoader} depending on the absence or presence of
278+
* {@link org.springframework.test.context.web.WebAppConfiguration
279+
* &#064;WebAppConfiguration}. For further details on the default behavior
280+
* of various concrete {@code SmartContextLoaders}, check out the Javadoc for
277281
* {@link org.springframework.test.context.support.AbstractContextLoader
278282
* AbstractContextLoader},
279283
* {@link org.springframework.test.context.support.GenericXmlContextLoader
280-
* GenericXmlContextLoader}, and
284+
* GenericXmlContextLoader},
281285
* {@link org.springframework.test.context.support.AnnotationConfigContextLoader
282-
* AnnotationConfigContextLoader}.
286+
* AnnotationConfigContextLoader},
287+
* {@link org.springframework.test.context.web.GenericXmlWebContextLoader
288+
* GenericXmlWebContextLoader}, and
289+
* {@link org.springframework.test.context.web.AnnotationConfigWebContextLoader
290+
* AnnotationConfigWebContextLoader}.
291+
*
283292
* @since 2.5
284293
*/
285294
Class<? extends ContextLoader> loader() default ContextLoader.class;

spring-test/src/main/java/org/springframework/test/context/ContextHierarchy.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@
2828
* a hierarchy of {@link org.springframework.context.ApplicationContext
2929
* ApplicationContexts} for integration tests.
3030
*
31-
* <h2>Examples</h2>
31+
* <h3>Examples</h3>
3232
* <p>The following JUnit-based examples demonstrate common configuration
3333
* scenarios for integration tests that require the use of context hierarchies.
3434
*
35-
* <h3>Single Test Class with Context Hierarchy</h3>
35+
* <h4>Single Test Class with Context Hierarchy</h4>
3636
* <p>{@code ControllerIntegrationTests} represents a typical integration testing
3737
* scenario for a Spring MVC web application by declaring a context hierarchy
3838
* consisting of two levels, one for the <em>root</em> {@code WebApplicationContext}
@@ -56,7 +56,7 @@
5656
* // ...
5757
* }</pre>
5858
*
59-
* <h3>Class Hierarchy with Implicit Parent Context</h3>
59+
* <h4>Class Hierarchy with Implicit Parent Context</h4>
6060
* <p>The following test classes define a context hierarchy within a test class
6161
* hierarchy. {@code AbstractWebTests} declares the configuration for a root
6262
* {@code WebApplicationContext} in a Spring-powered web application. Note,
@@ -82,7 +82,7 @@
8282
* &#064;ContextHierarchy(&#064;ContextConfiguration("/spring/rest-ws-config.xml")
8383
* public class RestWebServiceTests extends AbstractWebTests {}</pre>
8484
*
85-
* <h3>Class Hierarchy with Merged Context Hierarchy Configuration</h3>
85+
* <h4>Class Hierarchy with Merged Context Hierarchy Configuration</h4>
8686
* <p>The following classes demonstrate the use of <em>named</em> hierarchy levels
8787
* in order to <em>merge</em> the configuration for specific levels in a context
8888
* hierarchy. {@code BaseTests} defines two levels in the hierarchy, {@code parent}
@@ -110,7 +110,7 @@
110110
* )
111111
* public class ExtendedTests extends BaseTests {}</pre>
112112
*
113-
* <h3>Class Hierarchy with Overridden Context Hierarchy Configuration</h3>
113+
* <h4>Class Hierarchy with Overridden Context Hierarchy Configuration</h4>
114114
* <p>In contrast to the previous example, this example demonstrates how to
115115
* <em>override</em> the configuration for a given named level in a context hierarchy
116116
* by setting the {@link ContextConfiguration#inheritLocations} flag to {@code false}.

0 commit comments

Comments
 (0)