Browse Source

Polishing

pull/1106/head
Sam Brannen 9 years ago
parent
commit
8fff1c2ac0
  1. 8
      spring-test/src/main/java/org/springframework/test/context/ContextHierarchy.java
  2. 2
      spring-test/src/main/java/org/springframework/test/context/web/WebTestContextBootstrapper.java

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

@ -42,7 +42,7 @@ import java.lang.annotation.Target; @@ -42,7 +42,7 @@ import java.lang.annotation.Target;
* the one for the child context (i.e., the lowest context in the hierarchy).
*
* <pre class="code">
* &#064;RunWith(SpringJUnit4ClassRunner.class)
* &#064;RunWith(SpringRunner.class)
* &#064;WebAppConfiguration
* &#064;ContextHierarchy({
* &#064;ContextConfiguration(classes = TestAppConfig.class),
@ -71,7 +71,7 @@ import java.lang.annotation.Target; @@ -71,7 +71,7 @@ import java.lang.annotation.Target;
* the parent context for each of the contexts loaded for the concrete subclasses.
*
* <pre class="code">
* &#064;RunWith(SpringJUnit4ClassRunner.class)
* &#064;RunWith(SpringRunner.class)
* &#064;WebAppConfiguration
* &#064;ContextConfiguration("file:src/main/webapp/WEB-INF/applicationContext.xml")
* public abstract class AbstractWebTests {}
@ -98,7 +98,7 @@ import java.lang.annotation.Target; @@ -98,7 +98,7 @@ import java.lang.annotation.Target;
* "/order-config.xml"}</code>.
*
* <pre class="code">
* &#064;RunWith(SpringJUnit4ClassRunner.class)
* &#064;RunWith(SpringRunner.class)
* &#064;ContextHierarchy({
* &#064;ContextConfiguration(name = "parent", locations = "/app-config.xml"),
* &#064;ContextConfiguration(name = "child", locations = "/user-config.xml")
@ -119,7 +119,7 @@ import java.lang.annotation.Target; @@ -119,7 +119,7 @@ import java.lang.annotation.Target;
* context loaded from {@code "/app-config.xml"}.
*
* <pre class="code">
* &#064;RunWith(SpringJUnit4ClassRunner.class)
* &#064;RunWith(SpringRunner.class)
* &#064;ContextHierarchy({
* &#064;ContextConfiguration(name = "parent", locations = "/app-config.xml"),
* &#064;ContextConfiguration(name = "child", locations = "/user-config.xml")

2
spring-test/src/main/java/org/springframework/test/context/web/WebTestContextBootstrapper.java

@ -45,7 +45,7 @@ public class WebTestContextBootstrapper extends DefaultTestContextBootstrapper { @@ -45,7 +45,7 @@ public class WebTestContextBootstrapper extends DefaultTestContextBootstrapper {
*/
@Override
protected Class<? extends ContextLoader> getDefaultContextLoaderClass(Class<?> testClass) {
if (AnnotatedElementUtils.findMergedAnnotation(testClass, WebAppConfiguration.class) != null) {
if (AnnotatedElementUtils.hasAnnotation(testClass, WebAppConfiguration.class)) {
return WebDelegatingSmartContextLoader.class;
}
else {

Loading…
Cancel
Save