File tree Expand file tree Collapse file tree
src/test/java/org/apache/commons/io Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020import static org .junit .Assert .assertTrue ;
2121
2222import java .io .ByteArrayInputStream ;
23- import java .io .File ;
2423import java .io .InputStream ;
2524import java .io .OutputStream ;
2625import java .io .Reader ;
3231import org .apache .commons .io .testtools .TestUtils ;
3332import org .apache .commons .io .testtools .YellOnCloseInputStream ;
3433import org .apache .commons .io .testtools .YellOnFlushAndCloseOutputStream ;
35- import org .junit .ClassRule ;
3634import org .junit .Test ;
37- import org .junit .rules .TemporaryFolder ;
3835
3936@ SuppressWarnings ("deprecation" ) // these are test cases for the deprecated CopyUtils
4037
4542 */
4643public class CopyUtilsTest {
4744
48- @ ClassRule
49- public static TemporaryFolder temporaryFolder = new TemporaryFolder ();
50-
51- private static File getTestDirectory () {
52- return temporaryFolder .getRoot ();
53- }
54-
5545 /*
5646 * NOTE this is not particularly beautiful code. A better way to check for
5747 * flush and close status would be to implement "trojan horse" wrapper
@@ -61,7 +51,6 @@ private static File getTestDirectory() {
6151
6252 private static final int FILE_SIZE = 1024 * 4 + 1 ;
6353
64-
6554 private final byte [] inData = TestUtils .generateTestData (FILE_SIZE );
6655
6756 // ----------------------------------------------------------------
Original file line number Diff line number Diff line change 2929import java .util .Locale ;
3030
3131import org .junit .Assert ;
32- import org .junit .ClassRule ;
3332import org .junit .Test ;
34- import org .junit .rules .TemporaryFolder ;
3533
3634/**
3735 * This is used to test FileSystemUtils.
3836 *
3937 */
4038public class FileSystemUtilsTestCase {
4139
42- @ ClassRule
43- public static TemporaryFolder temporaryFolder = new TemporaryFolder ();
44-
45- private static File getTestDirectory () {
46- return temporaryFolder .getRoot ();
47- }
48-
4940 //-----------------------------------------------------------------------
5041 @ Test
5142 @ SuppressWarnings ("deprecation" ) // testing decrecated code
Original file line number Diff line number Diff line change 2828import java .io .ObjectInputStream ;
2929import java .io .ObjectOutputStream ;
3030
31- import org .junit .ClassRule ;
3231import org .junit .Test ;
33- import org .junit .rules .TemporaryFolder ;
3432
3533/**
3634 * This is used to test IOCase for correctness.
3735 *
3836 */
3937public class IOCaseTestCase {
4038
41- @ ClassRule
42- public static TemporaryFolder temporaryFolder = new TemporaryFolder ();
43-
44- private static File getTestDirectory () {
45- return temporaryFolder .getRoot ();
46- }
47-
4839 private static final boolean WINDOWS = File .separatorChar == '\\' ;
4940
5041 //-----------------------------------------------------------------------
Original file line number Diff line number Diff line change 3737import org .apache .commons .io .testtools .TestUtils ;
3838import org .apache .commons .io .testtools .YellOnCloseInputStream ;
3939import org .apache .commons .io .testtools .YellOnFlushAndCloseOutputStream ;
40- import org .junit .ClassRule ;
4140import org .junit .Test ;
42- import org .junit .rules .TemporaryFolder ;
4341
4442/**
4543 * JUnit tests for IOUtils copy methods.
4846 */
4947public class IOUtilsCopyTestCase {
5048
51- @ ClassRule
52- public static TemporaryFolder temporaryFolder = new TemporaryFolder ();
53-
54- private static File getTestDirectory () {
55- return temporaryFolder .getRoot ();
56- }
57-
5849 /*
5950 * NOTE this is not particularly beautiful code. A better way to check for
6051 * flush and close status would be to implement "trojan horse" wrapper
Original file line number Diff line number Diff line change 2020import static org .junit .Assert .assertTrue ;
2121import static org .junit .Assert .fail ;
2222
23- import java .io .File ;
2423import java .io .OutputStream ;
2524import java .io .OutputStreamWriter ;
2625import java .io .Writer ;
3029import org .apache .commons .io .output .ByteArrayOutputStream ;
3130import org .apache .commons .io .testtools .TestUtils ;
3231import org .apache .commons .io .testtools .YellOnFlushAndCloseOutputStream ;
33- import org .junit .ClassRule ;
3432import org .junit .Test ;
35- import org .junit .rules .TemporaryFolder ;
3633
3734/**
3835 * JUnit tests for IOUtils write methods.
4239@ SuppressWarnings ("deprecation" ) // includes tests for deprecated methods
4340public class IOUtilsWriteTestCase {
4441
45- @ ClassRule
46- public static TemporaryFolder temporaryFolder = new TemporaryFolder ();
47-
48- private static File getTestDirectory () {
49- return temporaryFolder .getRoot ();
50- }
51-
5242 private static final int FILE_SIZE = 1024 * 4 + 1 ;
5343
5444 private final byte [] inData = TestUtils .generateTestData (FILE_SIZE );
You can’t perform that action at this time.
0 commit comments