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 2016/03/30 17:30:10 UTC

[1/2] logging-log4j2 git commit: LOG4J2-1339 fix unit test for AsyncLogger TimestampMessage handling

Repository: logging-log4j2
Updated Branches:
  refs/heads/LOG4J2-1278-gc-free-logger b32182134 -> d3b44f462


LOG4J2-1339 fix unit test for AsyncLogger TimestampMessage handling


Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/cf919cb6
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/cf919cb6
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/cf919cb6

Branch: refs/heads/LOG4J2-1278-gc-free-logger
Commit: cf919cb6d14b7755dcba8718aaef3db6368c73f4
Parents: 102090f
Author: rpopma <rp...@apache.org>
Authored: Thu Mar 31 00:29:08 2016 +0900
Committer: rpopma <rp...@apache.org>
Committed: Thu Mar 31 00:29:08 2016 +0900

----------------------------------------------------------------------
 .../core/async/AsyncLoggerTimestampMessageTest.java     | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/cf919cb6/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerTimestampMessageTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerTimestampMessageTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerTimestampMessageTest.java
index 408388e..34198a0 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerTimestampMessageTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerTimestampMessageTest.java
@@ -16,9 +16,6 @@
  */
 package org.apache.logging.log4j.core.async;
 
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
 import java.io.BufferedReader;
 import java.io.File;
 import java.io.FileReader;
@@ -38,6 +35,8 @@ import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
+import static org.junit.Assert.*;
+
 /**
  * Confirms that if you log a {@link TimestampMessage} then there are no unnecessary calls to {@link Clock}.
  * <p>
@@ -69,7 +68,9 @@ public class AsyncLoggerTimestampMessageTest {
         // System.out.println(f.getAbsolutePath());
         file.delete();
         final Logger log = LogManager.getLogger("com.foo.Bar");
+        assertFalse(PoisonClock.called);
         log.info(new TimeMsg("Async logger msg with embedded timestamp", 123456789000L));
+        assertTrue(PoisonClock.called);
         CoreLoggerContexts.stopLoggerContext(false, file); // stop async thread
 
         final BufferedReader reader = new BufferedReader(new FileReader(file));
@@ -81,9 +82,12 @@ public class AsyncLoggerTimestampMessageTest {
     }
 
     public static class PoisonClock implements Clock {
+        public static boolean called = false;
         @Override
         public long currentTimeMillis() {
-            throw new RuntimeException("This should not have been called");
+            //throw new RuntimeException("This should not have been called");
+            called = true;
+            return 987654321L;
         }
     }
 


[2/2] logging-log4j2 git commit: Merge remote-tracking branch 'remotes/origin/master' into LOG4J2-1278-gc-free-logger

Posted by rp...@apache.org.
Merge remote-tracking branch 'remotes/origin/master' into LOG4J2-1278-gc-free-logger


Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/d3b44f46
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/d3b44f46
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/d3b44f46

Branch: refs/heads/LOG4J2-1278-gc-free-logger
Commit: d3b44f462e73765575fe1fce0e0a31fc245e7358
Parents: b321821 cf919cb
Author: rpopma <rp...@apache.org>
Authored: Thu Mar 31 00:29:51 2016 +0900
Committer: rpopma <rp...@apache.org>
Committed: Thu Mar 31 00:29:51 2016 +0900

----------------------------------------------------------------------
 .../core/async/AsyncLoggerTimestampMessageTest.java     | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------