Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@ public GridCollisionManager(GridKernalContext ctx) {
}
});
}
else
log.info("Collision resolution is disabled (all jobs will be activated upon arrival).");
else {
if (log.isInfoEnabled())
log.info("Collision resolution is disabled (all jobs will be activated upon arrival).");
}

if (log.isDebugEnabled())
log.debug(startInfo());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

/**
* Tests for making sure that {@link GridCollisionManager} logs about specific conditions at correct levels,
Expand Down Expand Up @@ -56,9 +57,17 @@ public void initLoggerMock() {
public void collisionResolutionDisabledMessageShouldBeLoggedAtInfoLevel() throws Exception {
GridCollisionManager mgr = new GridCollisionManager(collisionResolutionDisabledContext());

mgr.start();
boolean infoLevel = logger.isInfoEnabled();
when(logger.isInfoEnabled()).thenReturn(true);

verify(logger).info("Collision resolution is disabled (all jobs will be activated upon arrival).");
try {
mgr.start();

verify(logger).info("Collision resolution is disabled (all jobs will be activated upon arrival).");
}
finally {
when(logger.isInfoEnabled()).thenReturn(infoLevel);
}
}

/**
Expand Down
Loading