Java 类org.springframework.test.context.web.WebDelegatingSmartContextLoader 实例源码

项目:spring4-understanding    文件:BootstrapTestUtilsMergedConfigTests.java   
/**
 * Introduced to investigate claims made in a discussion on
 * <a href="http://stackoverflow.com/questions/24725438/what-could-cause-a-class-implementing-applicationlistenercontextrefreshedevent">Stack Overflow</a>.
 */
@Test
public void buildMergedConfigWithAtWebAppConfigurationWithAnnotationAndClassesOnSuperclass() {
    Class<?> webTestClass = WebClassesFoo.class;
    Class<?> standardTestClass = ClassesFoo.class;
    WebMergedContextConfiguration webMergedConfig = (WebMergedContextConfiguration) buildMergedContextConfiguration(webTestClass);
    MergedContextConfiguration standardMergedConfig = buildMergedContextConfiguration(standardTestClass);

    assertEquals(webMergedConfig, webMergedConfig);
    assertEquals(standardMergedConfig, standardMergedConfig);
    assertNotEquals(standardMergedConfig, webMergedConfig);
    assertNotEquals(webMergedConfig, standardMergedConfig);

    assertMergedConfig(webMergedConfig, webTestClass, EMPTY_STRING_ARRAY, new Class<?>[] { FooConfig.class },
        WebDelegatingSmartContextLoader.class);
    assertMergedConfig(standardMergedConfig, standardTestClass, EMPTY_STRING_ARRAY,
        new Class<?>[] { FooConfig.class }, DelegatingSmartContextLoader.class);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:WebAppIntegrationTestContextBootstrapper.java   
@Override
protected Class<? extends ContextLoader> getDefaultContextLoaderClass(
        Class<?> testClass) {
    if (AnnotationUtils.findAnnotation(testClass, WebIntegrationTest.class) != null) {
        return WebDelegatingSmartContextLoader.class;
    }
    return super.getDefaultContextLoaderClass(testClass);
}
项目:spring-boot-concourse    文件:WebAppIntegrationTestContextBootstrapper.java   
@Override
protected Class<? extends ContextLoader> getDefaultContextLoaderClass(
        Class<?> testClass) {
    if (AnnotationUtils.findAnnotation(testClass, WebIntegrationTest.class) != null) {
        return WebDelegatingSmartContextLoader.class;
    }
    return super.getDefaultContextLoaderClass(testClass);
}
项目:contestparser    文件:WebAppIntegrationTestContextBootstrapper.java   
@Override
protected Class<? extends ContextLoader> getDefaultContextLoaderClass(
        Class<?> testClass) {
    if (AnnotationUtils.findAnnotation(testClass, WebIntegrationTest.class) != null) {
        return WebDelegatingSmartContextLoader.class;
    }
    return super.getDefaultContextLoaderClass(testClass);
}