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

下面列出了怎么用org.springframework.test.context.support.AnnotationConfigContextLoader的API类实例代码及写法,或者点击链接到github查看源代码。

@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());
}
 
@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);
}
 
@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());
}
 
@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);
}
 
@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());
}
 
@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);
}
 
 类方法
 同包方法