You can use JUnit's Assume class for this type of thing. ---------- Forwarded message ---------- From: <[email protected]> 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: [email protected]
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 <[email protected]> Authored: Thu Apr 7 03:47:31 2016 +0900 Committer: rpopma <[email protected]> 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 <[email protected]>
