commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject commons-io git commit: Replace custom temporary folder management with JUnit's TemporaryFolder. This will allow Maven to run tests concurrently.
Date Wed, 27 Sep 2017 19:09:53 GMT
Repository: commons-io
Updated Branches:
  refs/heads/master ca286ab3f -> bc8773df8


Replace custom temporary folder management with JUnit's TemporaryFolder.
This will allow Maven to run tests concurrently.

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

Branch: refs/heads/master
Commit: bc8773df85d2db0d2d5bd99aa69d7e7c795e7aed
Parents: ca286ab
Author: Gary Gregory <ggregory@apache.org>
Authored: Wed Sep 27 13:09:50 2017 -0600
Committer: Gary Gregory <ggregory@apache.org>
Committed: Wed Sep 27 13:09:50 2017 -0600

----------------------------------------------------------------------
 .../org/apache/commons/io/input/TailerTest.java | 39 +++++++++++++++-----
 1 file changed, 29 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-io/blob/bc8773df/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 a39289e..6e794e8 100644
--- a/src/test/java/org/apache/commons/io/input/TailerTest.java
+++ b/src/test/java/org/apache/commons/io/input/TailerTest.java
@@ -16,7 +16,25 @@
  */
 package org.apache.commons.io.input;
 
-import java.io.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.BufferedOutputStream;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.io.RandomAccessFile;
+import java.io.Writer;
 import java.nio.charset.Charset;
 import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
@@ -27,23 +45,24 @@ import java.util.concurrent.ScheduledThreadPoolExecutor;
 
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.IOUtils;
-import org.apache.commons.io.testtools.FileBasedTestCase;
 import org.apache.commons.io.testtools.TestUtils;
 import org.junit.After;
+import org.junit.Rule;
 import org.junit.Test;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import org.junit.rules.TemporaryFolder;
 
 /**
  * Tests for {@link Tailer}.
  *
  */
-public class TailerTest extends FileBasedTestCase {
+public class TailerTest {
+
+    @Rule
+    public TemporaryFolder temporaryFolder = new TemporaryFolder();
+
+    private File getTestDirectory() {
+        return temporaryFolder.getRoot();
+    }
 
     private Tailer tailer;
 


Mime
View raw message