Skip to content

Commit 73202a1

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

1 file changed

Lines changed: 15 additions & 7 deletions

File tree

src/test/java/org/apache/commons/io/output/FileWriterWithEncodingTest.java

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
*/
1717
package org.apache.commons.io.output;
1818

19+
import static org.apache.commons.io.testtools.TestUtils.checkFile;
20+
import static org.junit.Assert.assertFalse;
21+
import static org.junit.Assert.assertTrue;
22+
import static org.junit.Assert.fail;
23+
1924
import java.io.File;
2025
import java.io.FileOutputStream;
2126
import java.io.FileWriter;
@@ -27,21 +32,24 @@
2732

2833
import org.apache.commons.io.FileUtils;
2934
import org.apache.commons.io.IOUtils;
30-
import org.apache.commons.io.testtools.FileBasedTestCase;
3135
import org.junit.After;
3236
import org.junit.Before;
37+
import org.junit.Rule;
3338
import org.junit.Test;
34-
35-
import static org.apache.commons.io.testtools.TestUtils.checkFile;
36-
import static org.junit.Assert.assertFalse;
37-
import static org.junit.Assert.assertTrue;
38-
import static org.junit.Assert.fail;
39+
import org.junit.rules.TemporaryFolder;
3940

4041
/**
4142
* Tests that the encoding is actually set and used.
4243
*
4344
*/
44-
public class FileWriterWithEncodingTest extends FileBasedTestCase {
45+
public class FileWriterWithEncodingTest {
46+
47+
@Rule
48+
public TemporaryFolder temporaryFolder = new TemporaryFolder();
49+
50+
private File getTestDirectory() {
51+
return temporaryFolder.getRoot();
52+
}
4553

4654
private String defaultEncoding;
4755
private File file1;

0 commit comments

Comments
 (0)