Call deleteDir only when test succeeds. Should help us determine if the bz2 file created is actually valid or not.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/95294481 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/95294481 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/95294481 Branch: refs/heads/LOG4J2-1278-gc-free-logger Commit: 95294481eb8a7767c067d28d880f5d7f946eab5d Parents: 04a9ce6 Author: Matt Sicker <[email protected]> Authored: Tue Mar 8 15:00:11 2016 -0600 Committer: Matt Sicker <[email protected]> Committed: Tue Mar 8 15:00:11 2016 -0600 ---------------------------------------------------------------------- .../appender/rolling/RollingAppenderSizeTest.java | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/95294481/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderSizeTest.java ---------------------------------------------------------------------- diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderSizeTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderSizeTest.java index 4b0726c..fce9fb4 100644 --- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderSizeTest.java +++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderSizeTest.java @@ -30,17 +30,16 @@ import org.apache.commons.compress.utils.IOUtils; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.core.util.Closer; import org.apache.logging.log4j.junit.LoggerContextRule; -import org.junit.After; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -import static org.apache.logging.log4j.hamcrest.Descriptors.*; -import static org.apache.logging.log4j.hamcrest.FileMatchers.*; -import static org.hamcrest.Matchers.*; - +import static org.apache.logging.log4j.hamcrest.Descriptors.that; +import static org.apache.logging.log4j.hamcrest.FileMatchers.hasName; +import static org.hamcrest.Matchers.endsWith; +import static org.hamcrest.Matchers.hasItemInArray; import static org.junit.Assert.*; /** @@ -82,11 +81,6 @@ public class RollingAppenderSizeTest { this.logger = this.init.getLogger(RollingAppenderSizeTest.class.getName()); } - @After - public void tearDown() throws Exception { - deleteDir(); - } - @Test public void testAppender() throws Exception { for (int i = 0; i < 100; ++i) { @@ -127,6 +121,7 @@ public class RollingAppenderSizeTest { } } } + deleteDir(); } private static void deleteDir() {
