Skip to content

Commit f8a3253

Browse files
committed
Polishing
1 parent b4ba80b commit f8a3253

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

spring-test/src/main/java/org/springframework/test/context/cache/DefaultCacheAwareContextLoaderDelegate.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,9 @@ ApplicationContext failure threshold (%d) exceeded: \
158158
this.contextCache.put(mergedConfig, context);
159159
}
160160
catch (Exception ex) {
161+
if (logger.isTraceEnabled()) {
162+
logger.trace("Incrementing ApplicationContext failure count for " + mergedConfig);
163+
}
161164
this.contextCache.incrementFailureCount(mergedConfig);
162165
Throwable cause = ex;
163166
if (ex instanceof ContextLoadException cle) {

spring-test/src/main/java/org/springframework/test/context/cache/DefaultContextCache.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ public class DefaultContextCache implements ContextCache {
5757

5858
private static final Log statsLogger = LogFactory.getLog(CONTEXT_CACHE_LOGGING_CATEGORY);
5959

60+
6061
/**
6162
* Map of context keys to Spring {@code ApplicationContext} instances.
6263
*/

spring-test/src/test/java/org/springframework/test/context/cache/ContextFailureThresholdTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@
4545
*/
4646
class ContextFailureThresholdTests {
4747

48-
private static final AtomicInteger passingLoadCount = new AtomicInteger(0);
49-
private static final AtomicInteger failingLoadCount = new AtomicInteger(0);
48+
private static final AtomicInteger passingLoadCount = new AtomicInteger();
49+
private static final AtomicInteger failingLoadCount = new AtomicInteger();
5050

5151

5252
@BeforeEach
5353
@AfterEach
54-
void resetFlag() {
54+
void resetTestFixtures() {
5555
resetContextCache();
5656
passingLoadCount.set(0);
5757
failingLoadCount.set(0);

0 commit comments

Comments
 (0)