java类org.springframework.test.context.support.AnnotationConfigContextLoader的实例源码

MergedContextConfigurationTests.java 文件源码 项目:spring4-understanding 阅读 26 收藏 0 点赞 0 评论 0
@Test
public void hashCodeWithEmptyArraysAndDifferentLoaders() {
    MergedContextConfiguration mergedConfig1 = new MergedContextConfiguration(getClass(),
            EMPTY_STRING_ARRAY, EMPTY_CLASS_ARRAY, EMPTY_STRING_ARRAY, loader);
    MergedContextConfiguration mergedConfig2 = new MergedContextConfiguration(getClass(),
            EMPTY_STRING_ARRAY, EMPTY_CLASS_ARRAY, EMPTY_STRING_ARRAY, new AnnotationConfigContextLoader());
    assertNotEquals(mergedConfig1.hashCode(), mergedConfig2.hashCode());
}
MergedContextConfigurationTests.java 文件源码 项目:spring4-understanding 阅读 27 收藏 0 点赞 0 评论 0
@Test
public void equalsWithEmptyArraysAndDifferentLoaders() {
    MergedContextConfiguration mergedConfig1 = new MergedContextConfiguration(getClass(),
            EMPTY_STRING_ARRAY, EMPTY_CLASS_ARRAY, EMPTY_STRING_ARRAY, loader);
    MergedContextConfiguration mergedConfig2 = new MergedContextConfiguration(getClass(),
            EMPTY_STRING_ARRAY, EMPTY_CLASS_ARRAY, EMPTY_STRING_ARRAY, new AnnotationConfigContextLoader());
    assertNotEquals(mergedConfig1, mergedConfig2);
    assertNotEquals(mergedConfig2, mergedConfig1);
}
MergedContextConfigurationTests.java 文件源码 项目:class-guard 阅读 22 收藏 0 点赞 0 评论 0
@Test
public void hashCodeWithEmptyArraysAndDifferentLoaders() {
    MergedContextConfiguration mergedConfig1 = new MergedContextConfiguration(getClass(), EMPTY_STRING_ARRAY,
        EMPTY_CLASS_ARRAY, EMPTY_STRING_ARRAY, loader);
    MergedContextConfiguration mergedConfig2 = new MergedContextConfiguration(getClass(), EMPTY_STRING_ARRAY,
        EMPTY_CLASS_ARRAY, EMPTY_STRING_ARRAY, new AnnotationConfigContextLoader());
    assertNotEquals(mergedConfig1.hashCode(), mergedConfig2.hashCode());
}
MergedContextConfigurationTests.java 文件源码 项目:class-guard 阅读 29 收藏 0 点赞 0 评论 0
@Test
public void equalsWithEmptyArraysAndDifferentLoaders() {
    MergedContextConfiguration mergedConfig1 = new MergedContextConfiguration(getClass(), EMPTY_STRING_ARRAY,
        EMPTY_CLASS_ARRAY, EMPTY_STRING_ARRAY, loader);
    MergedContextConfiguration mergedConfig2 = new MergedContextConfiguration(getClass(), EMPTY_STRING_ARRAY,
        EMPTY_CLASS_ARRAY, EMPTY_STRING_ARRAY, new AnnotationConfigContextLoader());
    assertNotEquals(mergedConfig1, mergedConfig2);
    assertNotEquals(mergedConfig2, mergedConfig1);
}
ContextLoaderUtilsTests.java 文件源码 项目:class-guard 阅读 22 收藏 0 点赞 0 评论 0
@Test
public void buildMergedConfigWithLocalAndInheritedAnnotationsAndLocations() {
    Class<?> testClass = LocationsBar.class;
    String[] expectedLocations = new String[] { "/foo.xml", "/bar.xml" };

    MergedContextConfiguration mergedConfig = buildMergedContextConfiguration(testClass, null, null);
    assertMergedConfig(mergedConfig, testClass, expectedLocations, EMPTY_CLASS_ARRAY,
        AnnotationConfigContextLoader.class);
}
ContextLoaderUtilsTests.java 文件源码 项目:class-guard 阅读 25 收藏 0 点赞 0 评论 0
@Test
public void buildMergedConfigWithLocalAndInheritedAnnotationsAndClasses() {
    Class<?> testClass = ClassesBar.class;
    Class<?>[] expectedClasses = new Class<?>[] { FooConfig.class, BarConfig.class };

    MergedContextConfiguration mergedConfig = buildMergedContextConfiguration(testClass, null, null);
    assertMergedConfig(mergedConfig, testClass, EMPTY_STRING_ARRAY, expectedClasses,
        AnnotationConfigContextLoader.class);
}
ContextLoaderUtilsTests.java 文件源码 项目:class-guard 阅读 29 收藏 0 点赞 0 评论 0
@Test
public void buildMergedConfigWithAnnotationsAndOverriddenLocations() {
    Class<?> testClass = OverriddenLocationsBar.class;
    String[] expectedLocations = new String[] { "/bar.xml" };

    MergedContextConfiguration mergedConfig = buildMergedContextConfiguration(testClass, null, null);
    assertMergedConfig(mergedConfig, testClass, expectedLocations, EMPTY_CLASS_ARRAY,
        AnnotationConfigContextLoader.class);
}
ContextLoaderUtilsTests.java 文件源码 项目:class-guard 阅读 25 收藏 0 点赞 0 评论 0
@Test
public void buildMergedConfigWithAnnotationsAndOverriddenClasses() {
    Class<?> testClass = OverriddenClassesBar.class;
    Class<?>[] expectedClasses = new Class<?>[] { BarConfig.class };

    MergedContextConfiguration mergedConfig = buildMergedContextConfiguration(testClass, null, null);
    assertMergedConfig(mergedConfig, testClass, EMPTY_STRING_ARRAY, expectedClasses,
        AnnotationConfigContextLoader.class);
}
ContextLoaderUtilsTests.java 文件源码 项目:class-guard 阅读 29 收藏 0 点赞 0 评论 0
private void assertLocationsBarAttributes(ContextConfigurationAttributes attributes) {
    assertAttributes(attributes, LocationsBar.class, new String[] { "/bar.xml" }, EMPTY_CLASS_ARRAY,
        AnnotationConfigContextLoader.class, true);
}
ContextLoaderUtilsTests.java 文件源码 项目:class-guard 阅读 25 收藏 0 点赞 0 评论 0
private void assertClassesBarAttributes(ContextConfigurationAttributes attributes) {
    assertAttributes(attributes, ClassesBar.class, EMPTY_STRING_ARRAY, new Class<?>[] { BarConfig.class },
        AnnotationConfigContextLoader.class, true);
}


问题


面经


文章

微信
公众号

扫码关注公众号