logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mattsic...@apache.org
Subject svn commit: r1582800 - /logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/junit/CleanFiles.java
Date Fri, 28 Mar 2014 16:24:19 GMT
Author: mattsicker
Date: Fri Mar 28 16:24:19 2014
New Revision: 1582800

URL: http://svn.apache.org/r1582800
Log:
Fix CleanFiles rule to only delete files after a test.

  - Fixes failing test in ConfigurationTest.

Modified:
    logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/junit/CleanFiles.java

Modified: logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/junit/CleanFiles.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/junit/CleanFiles.java?rev=1582800&r1=1582799&r2=1582800&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/junit/CleanFiles.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/junit/CleanFiles.java
Fri Mar 28 16:24:19 2014
@@ -26,7 +26,7 @@ import java.util.List;
 import static org.junit.Assert.assertTrue;
 
 /**
- * A JUnit test rule to automatically delete certain files before and after a test is run.
+ * A JUnit test rule to automatically delete certain files after a test is run.
  */
 public class CleanFiles extends ExternalResource {
     private final List<File> files;
@@ -44,21 +44,12 @@ public class CleanFiles extends External
 
     private void clean() {
         for (final File file : files) {
-            delete(file);
+            if (file.exists()) {
+                assertTrue(file.delete());
+            }
         }
     }
 
-    private static void delete(final File file) {
-        if (file.exists()) {
-            assertTrue(file.delete());
-        }
-    }
-
-    @Override
-    protected void before() throws Throwable {
-        this.clean();
-    }
-
     @Override
     protected void after() {
         this.clean();



Mime
View raw message