Skip to content

Commit bc8773d

Browse files
committed
Replace custom temporary folder management with JUnit's TemporaryFolder.
This will allow Maven to run tests concurrently.
1 parent ca286ab commit bc8773d

1 file changed

Lines changed: 29 additions & 10 deletions

File tree

src/test/java/org/apache/commons/io/input/TailerTest.java

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,25 @@
1616
*/
1717
package org.apache.commons.io.input;
1818

19-
import java.io.*;
19+
import static org.junit.Assert.assertEquals;
20+
import static org.junit.Assert.assertFalse;
21+
import static org.junit.Assert.assertNotNull;
22+
import static org.junit.Assert.assertNull;
23+
import static org.junit.Assert.assertTrue;
24+
import static org.junit.Assert.fail;
25+
26+
import java.io.BufferedOutputStream;
27+
import java.io.BufferedReader;
28+
import java.io.File;
29+
import java.io.FileInputStream;
30+
import java.io.FileNotFoundException;
31+
import java.io.FileOutputStream;
32+
import java.io.FileWriter;
33+
import java.io.IOException;
34+
import java.io.InputStreamReader;
35+
import java.io.OutputStreamWriter;
36+
import java.io.RandomAccessFile;
37+
import java.io.Writer;
2038
import java.nio.charset.Charset;
2139
import java.nio.charset.StandardCharsets;
2240
import java.util.ArrayList;
@@ -27,23 +45,24 @@
2745

2846
import org.apache.commons.io.FileUtils;
2947
import org.apache.commons.io.IOUtils;
30-
import org.apache.commons.io.testtools.FileBasedTestCase;
3148
import org.apache.commons.io.testtools.TestUtils;
3249
import org.junit.After;
50+
import org.junit.Rule;
3351
import org.junit.Test;
34-
35-
import static org.junit.Assert.assertEquals;
36-
import static org.junit.Assert.assertFalse;
37-
import static org.junit.Assert.assertNotNull;
38-
import static org.junit.Assert.assertNull;
39-
import static org.junit.Assert.assertTrue;
40-
import static org.junit.Assert.fail;
52+
import org.junit.rules.TemporaryFolder;
4153

4254
/**
4355
* Tests for {@link Tailer}.
4456
*
4557
*/
46-
public class TailerTest extends FileBasedTestCase {
58+
public class TailerTest {
59+
60+
@Rule
61+
public TemporaryFolder temporaryFolder = new TemporaryFolder();
62+
63+
private File getTestDirectory() {
64+
return temporaryFolder.getRoot();
65+
}
4766

4867
private Tailer tailer;
4968

0 commit comments

Comments
 (0)