From e65366012ddb944e6df88091563a7a7fccae8d8c Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Wed, 12 Oct 2011 21:34:02 +0000 Subject: [PATCH] [SPR-8401] Added documentation for @ActiveProfiles in the "Annotations" section. --- spring-framework-reference/src/testing.xml | 42 ++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/spring-framework-reference/src/testing.xml b/spring-framework-reference/src/testing.xml index c7c92f4fc7f..a08944853f4 100644 --- a/spring-framework-reference/src/testing.xml +++ b/spring-framework-reference/src/testing.xml @@ -460,7 +460,8 @@ public class ConfigClassApplicationContextTests { @ContextConfiguration provides support for inheriting resource - locations or configuration classes by default. + locations or configuration classes declared by superclasses by + default. See Context @@ -468,6 +469,41 @@ public class ConfigClassApplicationContextTests { details. + + @ActiveProfiles + + A class-level annotation that is used to declare which + bean definition profiles should be active + when loading an ApplicationContext + for test classes. + + @ContextConfiguration +@ActiveProfiles("dev") +public class DeveloperTests { + // class body... +} + + @ContextConfiguration +@ActiveProfiles({"dev", "integration"}) +public class DeveloperIntegrationTests { + // class body... +} + + + @ActiveProfiles provides + support for inheriting active bean + definition profiles declared by superclasses classes by + default. + + + See Context + configuration with environment profiles and the Javadoc for + @ActiveProfiles for examples and + further details. + + @DirtiesContext @@ -1052,7 +1088,7 @@ public void testProcessRepeatedly() { - The following three sections explain how to configure the + The following sections explain how to configure the TestContext framework through annotations and provide working examples of how to write unit and integration tests with the framework. @@ -1563,6 +1599,8 @@ public class TransferServiceTest { we specify all three configuration classes via the @ContextConfiguration annotation. The body of the test class itself remains completely unchanged. + +