commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pascalschumac...@apache.org
Subject [1/3] commons-io git commit: Remove setUp and tearDown methods that are no longer necessary after the switch to the TemporaryFolder rule.
Date Wed, 27 Sep 2017 20:23:14 GMT
Repository: commons-io
Updated Branches:
  refs/heads/master 14b52eb4f -> a43d2fa2f


Remove setUp and tearDown methods that are no longer necessary after the switch to the TemporaryFolder
rule.


Project: http://git-wip-us.apache.org/repos/asf/commons-io/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-io/commit/68374b28
Tree: http://git-wip-us.apache.org/repos/asf/commons-io/tree/68374b28
Diff: http://git-wip-us.apache.org/repos/asf/commons-io/diff/68374b28

Branch: refs/heads/master
Commit: 68374b282662788ffedad30e600771e6d5de321b
Parents: 99a353b
Author: pascalschumacher <pascalschumacher@gmx.net>
Authored: Wed Sep 27 22:18:21 2017 +0200
Committer: pascalschumacher <pascalschumacher@gmx.net>
Committed: Wed Sep 27 22:22:52 2017 +0200

----------------------------------------------------------------------
 .../commons/io/FileDeleteStrategyTestCase.java      |  7 -------
 .../apache/commons/io/FilenameUtilsTestCase.java    | 16 ----------------
 .../io/comparator/ComparatorAbstractTestCase.java   | 14 --------------
 .../commons/io/filefilter/FileFilterTestCase.java   | 12 ------------
 .../org/apache/commons/io/input/TailerTest.java     |  3 ---
 .../commons/io/monitor/AbstractMonitorTestCase.java |  6 ------
 .../io/output/FileWriterWithEncodingTest.java       |  9 ---------
 .../commons/io/output/LockableFileWriterTest.java   | 10 ----------
 8 files changed, 77 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-io/blob/68374b28/src/test/java/org/apache/commons/io/FileDeleteStrategyTestCase.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/io/FileDeleteStrategyTestCase.java b/src/test/java/org/apache/commons/io/FileDeleteStrategyTestCase.java
index 51df9e7..08c378e 100644
--- a/src/test/java/org/apache/commons/io/FileDeleteStrategyTestCase.java
+++ b/src/test/java/org/apache/commons/io/FileDeleteStrategyTestCase.java
@@ -27,7 +27,6 @@ import java.io.FileOutputStream;
 import java.io.IOException;
 
 import org.apache.commons.io.testtools.TestUtils;
-import org.junit.After;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.TemporaryFolder;
@@ -160,10 +159,4 @@ public class FileDeleteStrategyTestCase {
         assertEquals("FileDeleteStrategy[Normal]", FileDeleteStrategy.NORMAL.toString());
         assertEquals("FileDeleteStrategy[Force]", FileDeleteStrategy.FORCE.toString());
     }
-
-    @After
-    public void tearDown() throws Exception {
-        FileUtils.deleteDirectory(getTestDirectory());
-    }
-
 }

http://git-wip-us.apache.org/repos/asf/commons-io/blob/68374b28/src/test/java/org/apache/commons/io/FilenameUtilsTestCase.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/io/FilenameUtilsTestCase.java b/src/test/java/org/apache/commons/io/FilenameUtilsTestCase.java
index dc69616..dfb9434 100644
--- a/src/test/java/org/apache/commons/io/FilenameUtilsTestCase.java
+++ b/src/test/java/org/apache/commons/io/FilenameUtilsTestCase.java
@@ -30,7 +30,6 @@ import java.util.Arrays;
 import java.util.Collection;
 
 import org.apache.commons.io.testtools.TestUtils;
-import org.junit.After;
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
@@ -46,10 +45,6 @@ public class FilenameUtilsTestCase {
     @Rule
     public TemporaryFolder temporaryFolder = new TemporaryFolder();
 
-    private File getTestDirectory() {
-        return temporaryFolder.getRoot();
-    }
-
     private static final String SEP = "" + File.separatorChar;
     private static final boolean WINDOWS = File.separatorChar == '\\';
 
@@ -59,9 +54,6 @@ public class FilenameUtilsTestCase {
     private int testFile1Size;
     private int testFile2Size;
 
-    /**
-     * @see junit.framework.TestCase#setUp()
-     */
     @Before
     public void setUp() throws Exception {
         testFile1 = temporaryFolder.newFile("file1-test.txt");
@@ -103,14 +95,6 @@ public class FilenameUtilsTestCase {
         }
     }
 
-    /**
-     * @see junit.framework.TestCase#tearDown()
-     */
-    @After
-    public void tearDown() throws Exception {
-        temporaryFolder.delete();
-    }
-
     //-----------------------------------------------------------------------
     @Test
     public void testNormalize() throws Exception {

http://git-wip-us.apache.org/repos/asf/commons-io/blob/68374b28/src/test/java/org/apache/commons/io/comparator/ComparatorAbstractTestCase.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/io/comparator/ComparatorAbstractTestCase.java
b/src/test/java/org/apache/commons/io/comparator/ComparatorAbstractTestCase.java
index 69c913e..a867d58 100644
--- a/src/test/java/org/apache/commons/io/comparator/ComparatorAbstractTestCase.java
+++ b/src/test/java/org/apache/commons/io/comparator/ComparatorAbstractTestCase.java
@@ -27,8 +27,6 @@ import java.util.ArrayList;
 import java.util.Comparator;
 import java.util.List;
 
-import org.apache.commons.io.FileUtils;
-import org.junit.After;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.TemporaryFolder;
@@ -63,18 +61,6 @@ public abstract class ComparatorAbstractTestCase {
     /** File which is more than the "lessFile" */
     protected File moreFile;
 
-    /** @see junit.framework.TestCase#tearDown() */
-    @After
-    public void tearDown() throws Exception {
-        comparator = null;
-        reverse = null;
-        equalFile1 = null;
-        equalFile2 = null;
-        lessFile = null;
-        moreFile = null;
-        FileUtils.deleteDirectory(getTestDirectory());
-    }
-
     /**
      * Test the comparator.
      */

http://git-wip-us.apache.org/repos/asf/commons-io/blob/68374b28/src/test/java/org/apache/commons/io/filefilter/FileFilterTestCase.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/io/filefilter/FileFilterTestCase.java b/src/test/java/org/apache/commons/io/filefilter/FileFilterTestCase.java
index 29aedd4..22bcf4c 100644
--- a/src/test/java/org/apache/commons/io/filefilter/FileFilterTestCase.java
+++ b/src/test/java/org/apache/commons/io/filefilter/FileFilterTestCase.java
@@ -43,8 +43,6 @@ import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.IOCase;
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.io.testtools.TestUtils;
-import org.junit.After;
-import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.TemporaryFolder;
@@ -68,16 +66,6 @@ public class FileFilterTestCase {
 
     private static final boolean WINDOWS = File.separatorChar == '\\';
 
-    @Before
-    public void setUp() {
-        getTestDirectory();
-    }
-
-    @After
-    public void tearDown() throws Exception {
-        FileUtils.deleteDirectory(getTestDirectory());
-    }
-
     public void assertFiltering(final IOFileFilter filter, final File file, final boolean
expected) throws Exception {
         // Note. This only tests the (File, String) version if the parent of
         //       the File passed in is not null

http://git-wip-us.apache.org/repos/asf/commons-io/blob/68374b28/src/test/java/org/apache/commons/io/input/TailerTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/io/input/TailerTest.java b/src/test/java/org/apache/commons/io/input/TailerTest.java
index 6e794e8..13ac187 100644
--- a/src/test/java/org/apache/commons/io/input/TailerTest.java
+++ b/src/test/java/org/apache/commons/io/input/TailerTest.java
@@ -70,10 +70,7 @@ public class TailerTest {
     public void tearDown() throws Exception {
         if (tailer != null) {
             tailer.stop();
-            TestUtils.sleep(1000);
         }
-        FileUtils.deleteDirectory(getTestDirectory());
-        TestUtils.sleep(1000);
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/commons-io/blob/68374b28/src/test/java/org/apache/commons/io/monitor/AbstractMonitorTestCase.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/io/monitor/AbstractMonitorTestCase.java b/src/test/java/org/apache/commons/io/monitor/AbstractMonitorTestCase.java
index c28f856..f10e286 100644
--- a/src/test/java/org/apache/commons/io/monitor/AbstractMonitorTestCase.java
+++ b/src/test/java/org/apache/commons/io/monitor/AbstractMonitorTestCase.java
@@ -27,7 +27,6 @@ import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.filefilter.FileFilterUtils;
 import org.apache.commons.io.filefilter.HiddenFileFilter;
 import org.apache.commons.io.filefilter.IOFileFilter;
-import org.junit.After;
 import org.junit.Before;
 
 /**
@@ -89,11 +88,6 @@ public abstract class AbstractMonitorTestCase  {
         }
     }
 
-    @After
-    public void tearDown() throws Exception {
-        FileUtils.deleteDirectory(testDir);
-    }
-
     /**
      * Check all the Collections are empty
      *

http://git-wip-us.apache.org/repos/asf/commons-io/blob/68374b28/src/test/java/org/apache/commons/io/output/FileWriterWithEncodingTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/io/output/FileWriterWithEncodingTest.java b/src/test/java/org/apache/commons/io/output/FileWriterWithEncodingTest.java
index 83f590d..c50dd63 100644
--- a/src/test/java/org/apache/commons/io/output/FileWriterWithEncodingTest.java
+++ b/src/test/java/org/apache/commons/io/output/FileWriterWithEncodingTest.java
@@ -30,9 +30,7 @@ import java.io.Writer;
 import java.nio.charset.Charset;
 import java.nio.charset.CharsetEncoder;
 
-import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.IOUtils;
-import org.junit.After;
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
@@ -79,13 +77,6 @@ public class FileWriterWithEncodingTest {
         textContent = new String(arr);
     }
 
-    @After
-    public void tearDown() throws Exception {
-        FileUtils.deleteDirectory(getTestDirectory());
-        defaultEncoding = null;
-        textContent = null;
-    }
-
     //-----------------------------------------------------------------------
     @Test
     public void sameEncoding_string_constructor() throws Exception {

http://git-wip-us.apache.org/repos/asf/commons-io/blob/68374b28/src/test/java/org/apache/commons/io/output/LockableFileWriterTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/io/output/LockableFileWriterTest.java b/src/test/java/org/apache/commons/io/output/LockableFileWriterTest.java
index 369a934..fc79b24 100644
--- a/src/test/java/org/apache/commons/io/output/LockableFileWriterTest.java
+++ b/src/test/java/org/apache/commons/io/output/LockableFileWriterTest.java
@@ -26,8 +26,6 @@ import java.io.Writer;
 import java.nio.charset.StandardCharsets;
 import java.nio.charset.UnsupportedCharsetException;
 
-import org.apache.commons.io.FileUtils;
-import org.junit.After;
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
@@ -62,14 +60,6 @@ public class LockableFileWriterTest {
         altLockFile = new File(altLockDir, file.getName() + ".lck");
     }
 
-    @After
-    public void tearDown() throws IOException {
-        file.delete();
-        lockFile.delete();
-        altLockFile.delete();
-        FileUtils.deleteDirectory(altLockDir);
-    }
-
     //-----------------------------------------------------------------------
     @Test public void testFileLocked() throws IOException {
 


Mime
View raw message