remove TemporaryFolder Rule from test classes that do not use it
Project: http://git-wip-us.apache.org/repos/asf/commons-io/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-io/commit/99a353be Tree: http://git-wip-us.apache.org/repos/asf/commons-io/tree/99a353be Diff: http://git-wip-us.apache.org/repos/asf/commons-io/diff/99a353be Branch: refs/heads/master Commit: 99a353be9d524c7993d2f46313317440bf04f408 Parents: 14b52eb Author: pascalschumacher <pascalschumac...@gmx.net> Authored: Wed Sep 27 22:13:35 2017 +0200 Committer: pascalschumacher <pascalschumac...@gmx.net> Committed: Wed Sep 27 22:22:52 2017 +0200 ---------------------------------------------------------------------- src/test/java/org/apache/commons/io/CopyUtilsTest.java | 11 ----------- .../org/apache/commons/io/FileSystemUtilsTestCase.java | 9 --------- src/test/java/org/apache/commons/io/IOCaseTestCase.java | 9 --------- .../java/org/apache/commons/io/IOUtilsCopyTestCase.java | 9 --------- .../java/org/apache/commons/io/IOUtilsWriteTestCase.java | 10 ---------- 5 files changed, 48 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-io/blob/99a353be/src/test/java/org/apache/commons/io/CopyUtilsTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/io/CopyUtilsTest.java b/src/test/java/org/apache/commons/io/CopyUtilsTest.java index 6df9afa..7b85ae6 100644 --- a/src/test/java/org/apache/commons/io/CopyUtilsTest.java +++ b/src/test/java/org/apache/commons/io/CopyUtilsTest.java @@ -20,7 +20,6 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import java.io.ByteArrayInputStream; -import java.io.File; import java.io.InputStream; import java.io.OutputStream; import java.io.Reader; @@ -32,9 +31,7 @@ import org.apache.commons.io.output.ByteArrayOutputStream; import org.apache.commons.io.testtools.TestUtils; import org.apache.commons.io.testtools.YellOnCloseInputStream; import org.apache.commons.io.testtools.YellOnFlushAndCloseOutputStream; -import org.junit.ClassRule; import org.junit.Test; -import org.junit.rules.TemporaryFolder; @SuppressWarnings("deprecation") // these are test cases for the deprecated CopyUtils @@ -45,13 +42,6 @@ import org.junit.rules.TemporaryFolder; */ public class CopyUtilsTest { - @ClassRule - public static TemporaryFolder temporaryFolder = new TemporaryFolder(); - - private static File getTestDirectory() { - return temporaryFolder.getRoot(); - } - /* * NOTE this is not particularly beautiful code. A better way to check for * flush and close status would be to implement "trojan horse" wrapper @@ -61,7 +51,6 @@ public class CopyUtilsTest { private static final int FILE_SIZE = 1024 * 4 + 1; - private final byte[] inData = TestUtils.generateTestData(FILE_SIZE); // ---------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-io/blob/99a353be/src/test/java/org/apache/commons/io/FileSystemUtilsTestCase.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/io/FileSystemUtilsTestCase.java b/src/test/java/org/apache/commons/io/FileSystemUtilsTestCase.java index 96f0013..6656f47 100644 --- a/src/test/java/org/apache/commons/io/FileSystemUtilsTestCase.java +++ b/src/test/java/org/apache/commons/io/FileSystemUtilsTestCase.java @@ -29,9 +29,7 @@ import java.io.OutputStream; import java.util.Locale; import org.junit.Assert; -import org.junit.ClassRule; import org.junit.Test; -import org.junit.rules.TemporaryFolder; /** * This is used to test FileSystemUtils. @@ -39,13 +37,6 @@ import org.junit.rules.TemporaryFolder; */ public class FileSystemUtilsTestCase { - @ClassRule - public static TemporaryFolder temporaryFolder = new TemporaryFolder(); - - private static File getTestDirectory() { - return temporaryFolder.getRoot(); - } - //----------------------------------------------------------------------- @Test @SuppressWarnings("deprecation") // testing decrecated code http://git-wip-us.apache.org/repos/asf/commons-io/blob/99a353be/src/test/java/org/apache/commons/io/IOCaseTestCase.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/io/IOCaseTestCase.java b/src/test/java/org/apache/commons/io/IOCaseTestCase.java index 18eac3c..2638787 100644 --- a/src/test/java/org/apache/commons/io/IOCaseTestCase.java +++ b/src/test/java/org/apache/commons/io/IOCaseTestCase.java @@ -28,9 +28,7 @@ import java.io.File; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; -import org.junit.ClassRule; import org.junit.Test; -import org.junit.rules.TemporaryFolder; /** * This is used to test IOCase for correctness. @@ -38,13 +36,6 @@ import org.junit.rules.TemporaryFolder; */ public class IOCaseTestCase { - @ClassRule - public static TemporaryFolder temporaryFolder = new TemporaryFolder(); - - private static File getTestDirectory() { - return temporaryFolder.getRoot(); - } - private static final boolean WINDOWS = File.separatorChar == '\\'; //----------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-io/blob/99a353be/src/test/java/org/apache/commons/io/IOUtilsCopyTestCase.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/io/IOUtilsCopyTestCase.java b/src/test/java/org/apache/commons/io/IOUtilsCopyTestCase.java index ef836c7..b9a98f2 100644 --- a/src/test/java/org/apache/commons/io/IOUtilsCopyTestCase.java +++ b/src/test/java/org/apache/commons/io/IOUtilsCopyTestCase.java @@ -37,9 +37,7 @@ import org.apache.commons.io.output.NullWriter; import org.apache.commons.io.testtools.TestUtils; import org.apache.commons.io.testtools.YellOnCloseInputStream; import org.apache.commons.io.testtools.YellOnFlushAndCloseOutputStream; -import org.junit.ClassRule; import org.junit.Test; -import org.junit.rules.TemporaryFolder; /** * JUnit tests for IOUtils copy methods. @@ -48,13 +46,6 @@ import org.junit.rules.TemporaryFolder; */ public class IOUtilsCopyTestCase { - @ClassRule - public static TemporaryFolder temporaryFolder = new TemporaryFolder(); - - private static File getTestDirectory() { - return temporaryFolder.getRoot(); - } - /* * NOTE this is not particularly beautiful code. A better way to check for * flush and close status would be to implement "trojan horse" wrapper http://git-wip-us.apache.org/repos/asf/commons-io/blob/99a353be/src/test/java/org/apache/commons/io/IOUtilsWriteTestCase.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/io/IOUtilsWriteTestCase.java b/src/test/java/org/apache/commons/io/IOUtilsWriteTestCase.java index 6675aae..f5cb338 100644 --- a/src/test/java/org/apache/commons/io/IOUtilsWriteTestCase.java +++ b/src/test/java/org/apache/commons/io/IOUtilsWriteTestCase.java @@ -20,7 +20,6 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; -import java.io.File; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.Writer; @@ -30,9 +29,7 @@ import java.util.List; import org.apache.commons.io.output.ByteArrayOutputStream; import org.apache.commons.io.testtools.TestUtils; import org.apache.commons.io.testtools.YellOnFlushAndCloseOutputStream; -import org.junit.ClassRule; import org.junit.Test; -import org.junit.rules.TemporaryFolder; /** * JUnit tests for IOUtils write methods. @@ -42,13 +39,6 @@ import org.junit.rules.TemporaryFolder; @SuppressWarnings("deprecation") // includes tests for deprecated methods public class IOUtilsWriteTestCase { - @ClassRule - public static TemporaryFolder temporaryFolder = new TemporaryFolder(); - - private static File getTestDirectory() { - return temporaryFolder.getRoot(); - } - private static final int FILE_SIZE = 1024 * 4 + 1; private final byte[] inData = TestUtils.generateTestData(FILE_SIZE);