Avoid unnecessary synchronization in ContextCache, plus forward-ported polishing
Issue: SPR-12409
This commit is contained in:
@@ -24,21 +24,15 @@ package org.springframework.test.context;
|
||||
*/
|
||||
public abstract class TestContextTestUtils {
|
||||
|
||||
private TestContextTestUtils() {
|
||||
/* no-op */
|
||||
}
|
||||
|
||||
public static TestContext buildTestContext(Class<?> testClass, ContextCache contextCache) {
|
||||
CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate = new DefaultCacheAwareContextLoaderDelegate(
|
||||
contextCache);
|
||||
return buildTestContext(testClass, null, cacheAwareContextLoaderDelegate);
|
||||
return buildTestContext(testClass, new DefaultCacheAwareContextLoaderDelegate(contextCache));
|
||||
}
|
||||
|
||||
public static TestContext buildTestContext(Class<?> testClass, String customDefaultContextLoaderClassName,
|
||||
CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate) {
|
||||
public static TestContext buildTestContext(
|
||||
Class<?> testClass, CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate) {
|
||||
|
||||
BootstrapContext bootstrapContext = new DefaultBootstrapContext(testClass, cacheAwareContextLoaderDelegate);
|
||||
TestContextBootstrapper testContextBootstrapper = BootstrapUtils.resolveTestContextBootstrapper(bootstrapContext);
|
||||
|
||||
return new DefaultTestContext(testContextBootstrapper);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.test.web.client;
|
||||
|
||||
import java.net.URI;
|
||||
|
||||
Reference in New Issue
Block a user