You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by rp...@apache.org on 2015/11/11 15:21:27 UTC
logging-log4j2 git commit: only define one @Test method per test
class with Async Loggers to prevent spurious failures
Repository: logging-log4j2
Updated Branches:
refs/heads/master 65adfab1b -> fa8b16240
only define one @Test method per test class with Async Loggers to
prevent spurious failures
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/fa8b1624
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/fa8b1624
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/fa8b1624
Branch: refs/heads/master
Commit: fa8b16240f10bdb0923d8662fff48f7f6a882712
Parents: 65adfab
Author: rpopma <rp...@apache.org>
Authored: Wed Nov 11 23:21:26 2015 +0900
Committer: rpopma <rp...@apache.org>
Committed: Wed Nov 11 23:21:26 2015 +0900
----------------------------------------------------------------------
.../logging/log4j/core/async/AsyncLoggerTest.java | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/fa8b1624/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerTest.java
index 319d37e..991c580 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerTest.java
@@ -52,7 +52,10 @@ public class AsyncLoggerTest {
final File file = new File("target", "AsyncLoggerTest.log");
// System.out.println(f.getAbsolutePath());
file.delete();
+
final AsyncLogger log = (AsyncLogger) LogManager.getLogger("com.foo.Bar");
+ assertTrue(log.getNanoClock() instanceof DummyNanoClock);
+
final String msg = "Async logger msg";
log.info(msg, new InternalError("this is not a real error"));
CoreLoggerContexts.stopLoggerContext(false, file); // stop async thread
@@ -67,11 +70,12 @@ public class AsyncLoggerTest {
final String location = "testAsyncLogWritesToLog";
assertTrue("no location", !line1.contains(location));
}
-
- @Test
- public void testNanoClockInitiallyDummy() {
- final AsyncLogger log = (AsyncLogger) LogManager.getLogger("com.foo.Bar");
- assertTrue(log.getNanoClock() instanceof DummyNanoClock);
- }
+
+ // NOTE: only define one @Test method per test class with Async Loggers to prevent spurious failures
+ // @Test
+ // public void testNanoClockInitiallyDummy() {
+ // final AsyncLogger log = (AsyncLogger) LogManager.getLogger("com.foo.Bar");
+ // assertTrue(log.getNanoClock() instanceof DummyNanoClock);
+ // }
}