Polishing
This commit is contained in:
parent
b4ba80b09e
commit
f8a3253d12
|
|
@ -158,6 +158,9 @@ public class DefaultCacheAwareContextLoaderDelegate implements CacheAwareContext
|
||||||
this.contextCache.put(mergedConfig, context);
|
this.contextCache.put(mergedConfig, context);
|
||||||
}
|
}
|
||||||
catch (Exception ex) {
|
catch (Exception ex) {
|
||||||
|
if (logger.isTraceEnabled()) {
|
||||||
|
logger.trace("Incrementing ApplicationContext failure count for " + mergedConfig);
|
||||||
|
}
|
||||||
this.contextCache.incrementFailureCount(mergedConfig);
|
this.contextCache.incrementFailureCount(mergedConfig);
|
||||||
Throwable cause = ex;
|
Throwable cause = ex;
|
||||||
if (ex instanceof ContextLoadException cle) {
|
if (ex instanceof ContextLoadException cle) {
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,7 @@ public class DefaultContextCache implements ContextCache {
|
||||||
|
|
||||||
private static final Log statsLogger = LogFactory.getLog(CONTEXT_CACHE_LOGGING_CATEGORY);
|
private static final Log statsLogger = LogFactory.getLog(CONTEXT_CACHE_LOGGING_CATEGORY);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Map of context keys to Spring {@code ApplicationContext} instances.
|
* Map of context keys to Spring {@code ApplicationContext} instances.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -45,13 +45,13 @@ import static org.springframework.test.context.cache.ContextCacheTestUtils.reset
|
||||||
*/
|
*/
|
||||||
class ContextFailureThresholdTests {
|
class ContextFailureThresholdTests {
|
||||||
|
|
||||||
private static final AtomicInteger passingLoadCount = new AtomicInteger(0);
|
private static final AtomicInteger passingLoadCount = new AtomicInteger();
|
||||||
private static final AtomicInteger failingLoadCount = new AtomicInteger(0);
|
private static final AtomicInteger failingLoadCount = new AtomicInteger();
|
||||||
|
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
@AfterEach
|
@AfterEach
|
||||||
void resetFlag() {
|
void resetTestFixtures() {
|
||||||
resetContextCache();
|
resetContextCache();
|
||||||
passingLoadCount.set(0);
|
passingLoadCount.set(0);
|
||||||
failingLoadCount.set(0);
|
failingLoadCount.set(0);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue