[JAVA-9839] Cleanup test files

This commit is contained in:
Haroon Khan 2022-02-02 20:28:21 +00:00
parent 9b8a5a0fa7
commit 17f39de3ab
1 changed files with 14 additions and 8 deletions

View File

@ -1,9 +1,9 @@
package com.baeldung.differences.rdd; package com.baeldung.differences.rdd;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.spark.SparkConf; import org.apache.spark.SparkConf;
import org.apache.spark.api.java.JavaRDD; import org.apache.spark.api.java.JavaRDD;
@ -12,9 +12,12 @@ import org.junit.AfterClass;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.Test; import org.junit.Test;
import java.io.File;
public class TransformationsUnitTest { public class TransformationsUnitTest {
public static final String COMMA_DELIMITER = ",(?=([^\"]*\"[^\"]*\")*[^\"]*$)"; public static final String COMMA_DELIMITER = ",(?=([^\"]*\"[^\"]*\")*[^\"]*$)";
private static JavaSparkContext sc; private static JavaSparkContext sc;
private static JavaRDD<String> tourists; private static JavaRDD<String> tourists;
@ -25,6 +28,9 @@ public class TransformationsUnitTest {
sc = new JavaSparkContext(conf); sc = new JavaSparkContext(conf);
tourists = sc.textFile("data/Tourist.csv") tourists = sc.textFile("data/Tourist.csv")
.filter(line -> !line.startsWith("Region")); //filter header row .filter(line -> !line.startsWith("Region")); //filter header row
// delete previous output dir and files
FileUtils.deleteQuietly(new File("data/output"));
} }
@AfterClass @AfterClass