提交 8fff1c2a 编写于 作者: S Sam Brannen

Polishing

上级 80216c24
......@@ -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;
* 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;
* "/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;
* 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")
......
......@@ -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 {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册