You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Matt Sicker <bo...@gmail.com> on 2016/04/06 21:03:28 UTC

Fwd: logging-log4j2 git commit: LOG4J2-1295 bugfix: this test will only pass if log4j is configured to be garbage-free. Skip this test in other configurations.

You can use JUnit's Assume class for this type of thing.

---------- Forwarded message ----------
From: <rp...@apache.org>
Date: 6 April 2016 at 13:47
Subject: logging-log4j2 git commit: LOG4J2-1295 bugfix: this test will only
pass if log4j is configured to be garbage-free. Skip this test in other
configurations.
To: commits@logging.apache.org


Repository: logging-log4j2
Updated Branches:
  refs/heads/master b7bed7e11 -> 450c98de9


LOG4J2-1295     bugfix: this test will only pass if log4j is configured to
be garbage-free. Skip this test in other configurations.


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

Branch: refs/heads/master
Commit: 450c98de9a14e3886296037cdf1f45f46d972f2e
Parents: b7bed7e
Author: rpopma <rp...@apache.org>
Authored: Thu Apr 7 03:47:31 2016 +0900
Committer: rpopma <rp...@apache.org>
Committed: Thu Apr 7 03:47:31 2016 +0900

----------------------------------------------------------------------
 .../java/org/apache/logging/log4j/core/GcFreeLoggingTest.java     | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/450c98de/log4j-core/src/test/java/org/apache/logging/log4j/core/GcFreeLoggingTest.java
----------------------------------------------------------------------
diff --git
a/log4j-core/src/test/java/org/apache/logging/log4j/core/GcFreeLoggingTest.java
b/log4j-core/src/test/java/org/apache/logging/log4j/core/GcFreeLoggingTest.java
index c151917..eafdac5 100644
---
a/log4j-core/src/test/java/org/apache/logging/log4j/core/GcFreeLoggingTest.java
+++
b/log4j-core/src/test/java/org/apache/logging/log4j/core/GcFreeLoggingTest.java
@@ -40,6 +40,9 @@ public class GcFreeLoggingTest {

     @Test
     public void testNoAllocationDuringSteadyStateLogging() throws
Throwable {
+        if (!Constants.ENABLE_THREADLOCALS ||
!Constants.ENABLE_DIRECT_ENCODERS) {
+            return;
+        }
         final String javaHome = System.getProperty("java.home");
         final String javaBin = javaHome + File.separator + "bin" +
File.separator + "java";
         final String classpath = System.getProperty("java.class.path");




-- 
Matt Sicker <bo...@gmail.com>