diff --git a/org.springframework.test/src/main/java/org/springframework/test/context/ContextConfiguration.java b/org.springframework.test/src/main/java/org/springframework/test/context/ContextConfiguration.java
index b2728c83bb1..c84abc94059 100644
--- a/org.springframework.test/src/main/java/org/springframework/test/context/ContextConfiguration.java
+++ b/org.springframework.test/src/main/java/org/springframework/test/context/ContextConfiguration.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2009 the original author or authors.
+ * Copyright 2002-2011 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.
@@ -79,7 +79,7 @@ public @interface ContextConfiguration {
* defined by an annotated superclass. Thus, subclasses have the option of
* extending the list of resource locations. In the following
* example, the {@link org.springframework.context.ApplicationContext ApplicationContext}
- * for ExtendedTest will be loaded from
+ * for ExtendedTest will be loaded from
* "base-context.xml" and
* "extended-context.xml", in that order. Beans defined in
* "extended-context.xml" may therefore override those defined in
@@ -106,8 +106,8 @@ public @interface ContextConfiguration {
* {@link org.springframework.context.ApplicationContext ApplicationContext}.
*
If not specified, the loader will be inherited from the first superclass
* which is annotated with @ContextConfiguration and specifies
- * an explicit loader. If no class in the hierarchy specifies an explicit
- * loader, a default loader will be used instead.
+ * 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
* {@link org.springframework.test.context.support.GenericXmlContextLoader GenericXmlContextLoader}.
* Also check out {@link org.springframework.test.context.support.AbstractContextLoader AbstractContextLoader}'s
diff --git a/org.springframework.test/src/main/java/org/springframework/test/context/ContextLoaderUtils.java b/org.springframework.test/src/main/java/org/springframework/test/context/ContextLoaderUtils.java
index bbf848f0afc..8ca43ff18a0 100644
--- a/org.springframework.test/src/main/java/org/springframework/test/context/ContextLoaderUtils.java
+++ b/org.springframework.test/src/main/java/org/springframework/test/context/ContextLoaderUtils.java
@@ -25,6 +25,7 @@ import org.apache.commons.logging.LogFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.context.ApplicationContext;
import org.springframework.core.annotation.AnnotationUtils;
+import org.springframework.test.context.ResourceTypeAwareContextLoader.ResourceType;
import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
@@ -101,8 +102,9 @@ public abstract class ContextLoaderUtils {
Class For example, if the supplied class is Can be overridden by subclasses.
*/
- public boolean supportsStringResources() {
- return true;
- }
-
- /**
- * TODO Document supportsClassResources() implementations.
- *
- * @return Furthermore, by extending {@link SpringJUnit4ClassRunnerAppCtxTests},
+ * this class also verifies support for several basic features of the
+ * Spring TestContext Framework. See JavaDoc in
+ * Configuration will be loaded from {@link PojoAndStringConfig}.
*
* @author Sam Brannen
* @since 3.1
diff --git a/org.springframework.test/src/test/java/org/springframework/test/context/junit4/annotation/AnnotationConfigSuiteTests.java b/org.springframework.test/src/test/java/org/springframework/test/context/junit4/annotation/AnnotationConfigTestSuite.java
similarity index 87%
rename from org.springframework.test/src/test/java/org/springframework/test/context/junit4/annotation/AnnotationConfigSuiteTests.java
rename to org.springframework.test/src/test/java/org/springframework/test/context/junit4/annotation/AnnotationConfigTestSuite.java
index 7c5445634b6..926c5cc7cf5 100644
--- a/org.springframework.test/src/test/java/org/springframework/test/context/junit4/annotation/AnnotationConfigSuiteTests.java
+++ b/org.springframework.test/src/test/java/org/springframework/test/context/junit4/annotation/AnnotationConfigTestSuite.java
@@ -21,7 +21,8 @@ import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;
/**
- * TODO [SPR-6184] Document tests.
+ * JUnit test suite for annotation-driven configuration class
+ * support in the Spring TestContext Framework.
*
* @author Sam Brannen
* @since 3.1
@@ -33,5 +34,5 @@ AnnotationConfigSpringJUnit4ClassRunnerAppCtxTests.class,//
DefaultConfigClassBaseTests.class,//
DefaultConfigClassInheritedTests.class //
})
-public class AnnotationConfigSuiteTests {
+public class AnnotationConfigTestSuite {
}
diff --git a/org.springframework.test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultConfigClassBaseTests.java b/org.springframework.test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultConfigClassBaseTests.java
index 7da86c1f439..0a994176b33 100644
--- a/org.springframework.test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultConfigClassBaseTests.java
+++ b/org.springframework.test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultConfigClassBaseTests.java
@@ -28,7 +28,10 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.support.AnnotationConfigContextLoader;
/**
- * TODO [SPR-6184] Document tests.
+ * Integration tests that verify support for configuration classes in
+ * the Spring TestContext Framework.
+ *
+ * Configuration will be loaded from {@link DefaultConfigClassBaseTestsConfig}.
*
* @author Sam Brannen
* @since 3.1
diff --git a/org.springframework.test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultConfigClassBaseTestsConfig.java b/org.springframework.test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultConfigClassBaseTestsConfig.java
index 3df61e7ccb8..56466b5bf44 100644
--- a/org.springframework.test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultConfigClassBaseTestsConfig.java
+++ b/org.springframework.test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultConfigClassBaseTestsConfig.java
@@ -21,7 +21,7 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
- * TODO [SPR-6184] Document configuration class.
+ * ApplicationContext configuration class for {@link DefaultConfigClassBaseTests}.
*
* @author Sam Brannen
* @since 3.1
diff --git a/org.springframework.test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultConfigClassInheritedTests.java b/org.springframework.test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultConfigClassInheritedTests.java
index 0c0011a5bfd..8a2b37cfd5b 100644
--- a/org.springframework.test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultConfigClassInheritedTests.java
+++ b/org.springframework.test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultConfigClassInheritedTests.java
@@ -25,7 +25,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
/**
- * TODO [SPR-6184] Document tests.
+ * Integration tests that verify support for configuration classes in
+ * the Spring TestContext Framework.
+ *
+ * Configuration will be loaded from {@link DefaultConfigClassBaseTestsConfig}
+ * and {@link DefaultConfigClassInheritedTestsConfig}.
*
* @author Sam Brannen
* @since 3.1
diff --git a/org.springframework.test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultConfigClassInheritedTestsConfig.java b/org.springframework.test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultConfigClassInheritedTestsConfig.java
index f47420b2f3a..a1261d4ec0b 100644
--- a/org.springframework.test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultConfigClassInheritedTestsConfig.java
+++ b/org.springframework.test/src/test/java/org/springframework/test/context/junit4/annotation/DefaultConfigClassInheritedTestsConfig.java
@@ -21,7 +21,7 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
- * TODO [SPR-6184] Document configuration class.
+ * ApplicationContext configuration class for {@link DefaultConfigClassInheritedTests}.
*
* @author Sam Brannen
* @since 3.1
diff --git a/org.springframework.test/src/test/java/org/springframework/test/context/junit4/annotation/PojoAndStringConfig.java b/org.springframework.test/src/test/java/org/springframework/test/context/junit4/annotation/PojoAndStringConfig.java
index 440f5cbc33c..e04c1c07378 100644
--- a/org.springframework.test/src/test/java/org/springframework/test/context/junit4/annotation/PojoAndStringConfig.java
+++ b/org.springframework.test/src/test/java/org/springframework/test/context/junit4/annotation/PojoAndStringConfig.java
@@ -22,7 +22,12 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
- * TODO [SPR-6184] Document configuration class.
+ * ApplicationContext configuration class for various integration tests.
+ *
+ * The beans defined in this configuration class map directly to the
+ * beans defined in true if this ContextLoader supports
- * String-based resource locations
- * @see ContextConfiguration#locations()
- * @see ContextConfiguration#value()
+ * TODO Document ResourceType.
*/
- boolean supportsStringResources();
+ public static enum ResourceType {
+
+ /**
+ * String-based resource locations.
+ *
+ * @see ContextConfiguration#locations()
+ * @see ContextConfiguration#value()
+ */
+ LOCATIONS,
+
+ /**
+ * Configuration classes.
+ *
+ * @see ContextConfiguration#classes()
+ */
+ CLASSES;
+
+ };
+
/**
- * @return true if this ContextLoader supports
- * Class-based resource locations
- * @see ContextConfiguration#classes()
+ * Get the application context {@link ResourceType} supported by this
+ * ContextLoader.
+ *
+ * @return the context resource type supported by this ContextLoader
*/
- boolean supportsClassResources();
+ ResourceType getResourceType();
}
diff --git a/org.springframework.test/src/main/java/org/springframework/test/context/support/AbstractContextLoader.java b/org.springframework.test/src/main/java/org/springframework/test/context/support/AbstractContextLoader.java
index 27882beab64..ff0328e8837 100644
--- a/org.springframework.test/src/main/java/org/springframework/test/context/support/AbstractContextLoader.java
+++ b/org.springframework.test/src/main/java/org/springframework/test/context/support/AbstractContextLoader.java
@@ -64,7 +64,7 @@ public abstract class AbstractContextLoader implements ResourceTypeAwareContextL
}
/**
- * Generates the default classpath resource locations array based on the
+ * Generate the default classpath resource locations array based on the
* supplied class.
* com.example.MyTest,
* the generated locations will contain a single string with a value of
@@ -142,21 +142,11 @@ public abstract class AbstractContextLoader implements ResourceTypeAwareContextL
protected abstract String getResourceSuffix();
/**
- * TODO Document supportsStringResources() implementation.
- *
- * @return true
+ * The default implementation returns {@link ResourceType#LOCATIONS}.
+ * false
- */
- public boolean supportsClassResources() {
- return false;
+ public ResourceType getResourceType() {
+ return ResourceType.LOCATIONS;
}
}
diff --git a/org.springframework.test/src/main/java/org/springframework/test/context/support/AnnotationConfigContextLoader.java b/org.springframework.test/src/main/java/org/springframework/test/context/support/AnnotationConfigContextLoader.java
index a8f23ee3ebc..5503f5f739d 100644
--- a/org.springframework.test/src/main/java/org/springframework/test/context/support/AnnotationConfigContextLoader.java
+++ b/org.springframework.test/src/main/java/org/springframework/test/context/support/AnnotationConfigContextLoader.java
@@ -128,19 +128,11 @@ public class AnnotationConfigContextLoader extends AbstractGenericContextLoader
}
/**
- * @return true
+ * Returns {@link ResourceType#CLASSES}.
*/
@Override
- public boolean supportsClassResources() {
- return true;
- }
-
- /**
- * @return false
- */
- @Override
- public boolean supportsStringResources() {
- return false;
+ public ResourceType getResourceType() {
+ return ResourceType.CLASSES;
}
}
diff --git a/org.springframework.test/src/test/java/org/springframework/test/context/junit4/annotation/AnnotationConfigSpringJUnit4ClassRunnerAppCtxTests.java b/org.springframework.test/src/test/java/org/springframework/test/context/junit4/annotation/AnnotationConfigSpringJUnit4ClassRunnerAppCtxTests.java
index 4b2b7eb0673..7c7cef5c544 100644
--- a/org.springframework.test/src/test/java/org/springframework/test/context/junit4/annotation/AnnotationConfigSpringJUnit4ClassRunnerAppCtxTests.java
+++ b/org.springframework.test/src/test/java/org/springframework/test/context/junit4/annotation/AnnotationConfigSpringJUnit4ClassRunnerAppCtxTests.java
@@ -21,7 +21,15 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunnerAppCtxTest
import org.springframework.test.context.support.AnnotationConfigContextLoader;
/**
- * TODO [SPR-6184] Document tests.
+ * Integration tests that verify support for configuration classes in
+ * the Spring TestContext Framework.
+ *
+ * SpringJUnit4ClassRunnerAppCtxTests for details.
+ *
+ * SpringJUnit4ClassRunnerAppCtxTests-context.xml.
+ * Consequently, the application contexts loaded from these two sources
+ * should be identical with regard to bean definitions.
*
* @author Sam Brannen
* @since 3.1