1919
2020import java .io .BufferedReader ;
2121import java .io .File ;
22- import java .io .FileInputStream ;
2322import java .io .FileNotFoundException ;
2423import java .io .FileOutputStream ;
2524import java .io .FileReader ;
@@ -46,6 +45,7 @@ public class PerformanceTest {
4645
4746 private final int max = 10 ;
4847
48+ private static final String TEST_RESRC = "org/apache/commons/csv/perf/worldcitiespop.txt.gz" ;
4949 private static final File BIG_FILE = new File (System .getProperty ("java.io.tmpdir" ), "worldcitiespop.txt" );
5050
5151 @ BeforeAll
@@ -54,10 +54,10 @@ public static void setUpClass() throws FileNotFoundException, IOException {
5454 System .out .println (String .format ("Found test fixture %s: %,d bytes." , BIG_FILE , BIG_FILE .length ()));
5555 return ;
5656 }
57- System .out .println ("Decompressing test fixture " + BIG_FILE + "..." );
57+ System .out .println ("Decompressing test fixture to: " + BIG_FILE + "..." );
5858 try (
5959 final InputStream input = new GZIPInputStream (
60- new FileInputStream ( "src/test/resources/perf/worldcitiespop.txt.gz" ));
60+ PerformanceTest . class . getClassLoader (). getResourceAsStream ( TEST_RESRC ));
6161 final OutputStream output = new FileOutputStream (BIG_FILE )) {
6262 IOUtils .copy (input , output );
6363 System .out .println (String .format ("Decompressed test fixture %s: %,d bytes." , BIG_FILE , BIG_FILE .length ()));
0 commit comments