Introduce dedicated 'cache' subpackage in the TCF
Since the ContextCache is now a published SPI, it and its collaborators have been moved to a dedicated 'org.sfw.test.context.cache' subpackage. Issue: SPR-12683
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -33,7 +33,8 @@ import static org.junit.Assert.*;
|
||||
* Unit tests for {@link MergedContextConfiguration}.
|
||||
*
|
||||
* <p>These tests primarily exist to ensure that {@code MergedContextConfiguration}
|
||||
* can safely be used as the cache key for {@link ContextCache}.
|
||||
* can safely be used as the cache key for
|
||||
* {@link org.springframework.test.context.cache.ContextCache ContextCache}.
|
||||
*
|
||||
* @author Sam Brannen
|
||||
* @since 3.1
|
||||
|
||||
@@ -16,8 +16,9 @@
|
||||
|
||||
package org.springframework.test.context;
|
||||
|
||||
import org.springframework.test.context.cache.ContextCache;
|
||||
import org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate;
|
||||
import org.springframework.test.context.support.DefaultBootstrapContext;
|
||||
import org.springframework.test.context.support.DefaultCacheAwareContextLoaderDelegate;
|
||||
|
||||
/**
|
||||
* Collection of test-related utility methods for working with {@link TestContext TestContexts}.
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.test.context;
|
||||
package org.springframework.test.context.cache;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
@@ -29,6 +29,8 @@ import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.test.annotation.DirtiesContext;
|
||||
import org.springframework.test.annotation.DirtiesContext.ClassMode;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.TestExecutionListeners;
|
||||
import org.springframework.test.context.support.DependencyInjectionTestExecutionListener;
|
||||
import org.springframework.test.context.support.DirtiesContextTestExecutionListener;
|
||||
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
|
||||
@@ -37,7 +39,7 @@ import org.springframework.test.context.testng.TrackingTestNGTestListener;
|
||||
import org.testng.TestNG;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.springframework.test.context.support.ContextCacheTestUtils.*;
|
||||
import static org.springframework.test.context.cache.ContextCacheTestUtils.*;
|
||||
|
||||
/**
|
||||
* JUnit 4 based integration test which verifies correct {@linkplain ContextCache
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.test.context;
|
||||
package org.springframework.test.context.cache;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
@@ -30,13 +30,15 @@ import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.test.annotation.DirtiesContext;
|
||||
import org.springframework.test.annotation.DirtiesContext.ClassMode;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.TestExecutionListeners;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
import org.springframework.test.context.junit4.TrackingRunListener;
|
||||
import org.springframework.test.context.support.DependencyInjectionTestExecutionListener;
|
||||
import org.springframework.test.context.support.DirtiesContextTestExecutionListener;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.springframework.test.context.support.ContextCacheTestUtils.*;
|
||||
import static org.springframework.test.context.cache.ContextCacheTestUtils.*;
|
||||
|
||||
/**
|
||||
* JUnit 4 based integration test which verifies correct {@linkplain ContextCache
|
||||
@@ -14,9 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.test.context.support;
|
||||
|
||||
import org.springframework.test.context.ContextCache;
|
||||
package org.springframework.test.context.cache;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.test.context;
|
||||
package org.springframework.test.context.cache;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
@@ -22,12 +22,18 @@ import org.junit.Test;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.test.annotation.DirtiesContext.HierarchyMode;
|
||||
import org.springframework.test.context.ActiveProfiles;
|
||||
import org.springframework.test.context.ActiveProfilesResolver;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.ContextHierarchy;
|
||||
import org.springframework.test.context.MergedContextConfiguration;
|
||||
import org.springframework.test.context.TestContext;
|
||||
import org.springframework.test.context.TestContextTestUtils;
|
||||
import org.springframework.test.context.support.AnnotationConfigContextLoader;
|
||||
import org.springframework.test.context.support.DefaultContextCache;
|
||||
import org.springframework.test.util.ReflectionTestUtils;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.springframework.test.context.support.ContextCacheTestUtils.*;
|
||||
import static org.springframework.test.context.cache.ContextCacheTestUtils.*;
|
||||
|
||||
/**
|
||||
* Integration tests for verifying proper behavior of the {@link ContextCache} in
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.test.context;
|
||||
package org.springframework.test.context.cache;
|
||||
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
@@ -26,12 +26,14 @@ import org.junit.runners.MethodSorters;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.test.annotation.DirtiesContext;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.TestExecutionListeners;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
import org.springframework.test.context.support.DependencyInjectionTestExecutionListener;
|
||||
import org.springframework.test.context.support.DirtiesContextTestExecutionListener;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.springframework.test.context.support.ContextCacheTestUtils.*;
|
||||
import static org.springframework.test.context.cache.ContextCacheTestUtils.*;
|
||||
|
||||
/**
|
||||
* JUnit 4 based unit test which verifies correct {@link ContextCache
|
||||
@@ -47,7 +49,7 @@ import static org.springframework.test.context.support.ContextCacheTestUtils.*;
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
@TestExecutionListeners({ DependencyInjectionTestExecutionListener.class, DirtiesContextTestExecutionListener.class })
|
||||
@ContextConfiguration("junit4/SpringJUnit4ClassRunnerAppCtxTests-context.xml")
|
||||
@ContextConfiguration("../junit4/SpringJUnit4ClassRunnerAppCtxTests-context.xml")
|
||||
public class SpringRunnerContextCacheTests {
|
||||
|
||||
private static ApplicationContext dirtiedApplicationContext;
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -19,9 +19,8 @@ package org.springframework.test.context.junit4;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Suite;
|
||||
import org.junit.runners.Suite.SuiteClasses;
|
||||
|
||||
import org.springframework.test.context.ClassLevelDirtiesContextTests;
|
||||
import org.springframework.test.context.SpringRunnerContextCacheTests;
|
||||
import org.springframework.test.context.cache.ClassLevelDirtiesContextTests;
|
||||
import org.springframework.test.context.cache.SpringRunnerContextCacheTests;
|
||||
import org.springframework.test.context.junit4.annotation.AnnotationConfigSpringJUnit4ClassRunnerAppCtxTests;
|
||||
import org.springframework.test.context.junit4.annotation.BeanOverridingDefaultConfigClassesInheritedTests;
|
||||
import org.springframework.test.context.junit4.annotation.BeanOverridingExplicitConfigClassesInheritedTests;
|
||||
|
||||
Reference in New Issue
Block a user