org.springframework.test.context.web.WebDelegatingSmartContextLoader Java Examples

The following examples show how to use org.springframework.test.context.web.WebDelegatingSmartContextLoader. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BootstrapTestUtilsMergedConfigTests.java    From spring-analysis-note with MIT License 6 votes vote down vote up
/**
 * Introduced to investigate claims made in a discussion on
 * <a href="https://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, array(FooConfig.class),
		WebDelegatingSmartContextLoader.class);
	assertMergedConfig(standardMergedConfig, standardTestClass, EMPTY_STRING_ARRAY,
		array(FooConfig.class), DelegatingSmartContextLoader.class);
}
 
Example #2
Source File: BootstrapTestUtilsMergedConfigTests.java    From java-technology-stack with MIT License 6 votes vote down vote up
/**
 * 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, array(FooConfig.class),
		WebDelegatingSmartContextLoader.class);
	assertMergedConfig(standardMergedConfig, standardTestClass, EMPTY_STRING_ARRAY,
		array(FooConfig.class), DelegatingSmartContextLoader.class);
}
 
Example #3
Source File: BootstrapTestUtilsMergedConfigTests.java    From spring4-understanding with Apache License 2.0 6 votes vote down vote up
/**
 * 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);
}