diff --git a/spring-framework-reference/src/testing.xml b/spring-framework-reference/src/testing.xml index 87707b039f..acf7d8aa0b 100644 --- a/spring-framework-reference/src/testing.xml +++ b/spring-framework-reference/src/testing.xml @@ -1094,17 +1094,17 @@ public class MyTest { // class body... } - Note that support for dependency injection via + Dependency injection via @Autowired is provided by the DependencyInjectionTestExecutionListener - which is configured by default. + which is configured by default (see ). - In contrast to the deprecated JUnit 3.8 legacy class hierarchy, - test classes that use the TestContext framework do not need to - override any protected instance methods to + Test classes that use the TestContext framework do not need to + extend any particular class or implement a specific interface to configure their application context. Instead, configuration is - achieved merely by declaring the + achieved simply by declaring the @ContextConfiguration annotation at the class level. If your test class does not explicitly declare application context resource locations or @@ -1113,7 +1113,7 @@ public class MyTest { context from a default location or default configuration classes. - The following sections explain how to configure and manage an + The following sections explain how to configure an ApplicationContext via XML configuration files or @Configuration classes using Spring's @@ -1121,10 +1121,10 @@ public class MyTest { annotation.
- Context management with XML resources + Context configuration with XML resources To load an ApplicationContext - for your tests from XML configuration files, annotate your test + for your tests using XML configuration files, annotate your test class with @ContextConfiguration and configure the locations attribute with an array that contains the resource locations of XML configuration metadata. @@ -1187,15 +1187,15 @@ public class MyTest {
- Context management with @Configuration classes + Context configuration with @Configuration classes To load an ApplicationContext - for your tests from @Configuration + for your tests using @Configuration classes (see ), annotate your test class with @ContextConfiguration and configure the classes attribute with an array - that contains class references to configuration classes. - Alternatively, you can implement and configure your own custom + that contains references to configuration classes. Alternatively, + you can implement and configure your own custom ContextLoader or SmartContextLoader for advanced use cases. @@ -1352,7 +1352,7 @@ public class ExtendedTest extends BaseTest {
- Dependency Injection of test fixtures + Dependency injection of test fixtures When you use the DependencyInjectionTestExecutionListener