1919
2020package spark ;
2121
22+ import org .apache .spark .sql .Dataset ;
23+ import org .apache .spark .sql .Row ;
24+ import org .junit .jupiter .api .AfterAll ;
25+ import org .junit .jupiter .api .AfterEach ;
26+ import org .junit .jupiter .api .BeforeAll ;
27+ import org .junit .jupiter .api .BeforeEach ;
28+ import org .junit .jupiter .api .Test ;
29+
2230import java .io .File ;
2331import java .io .IOException ;
2432import java .io .InputStream ;
25- import java .util .List ;
2633import java .util .Properties ;
27- import org .junit .jupiter .api .AfterEach ;
28- import org .junit .jupiter .api .AfterAll ;
29- import org .junit .jupiter .api .BeforeEach ;
30- import org .junit .jupiter .api .BeforeAll ;
31- import org .junit .jupiter .api .Test ;
32- import static org .junit .jupiter .api .Assertions .*;
3334
34- import org .apache .spark .sql .Dataset ;
35- import org .apache .spark .sql .Row ;
36- import org .locationtech .jts .geom .Coordinate ;
37- import org .locationtech .jts .geom .Geometry ;
35+ import static org .junit .jupiter .api .Assertions .assertNotNull ;
36+ import static org .junit .jupiter .api .Assertions .assertTrue ;
3837
3938
4039public class SedonaParquetTest {
41-
42-
40+
41+
4342 protected static Properties properties ;
44- protected static String parquetPath ;
43+ protected static String parquetPath ;
4544 protected static SedonaSparkSession session ;
46-
45+
4746 public SedonaParquetTest () {
4847 }
49-
48+
5049 @ BeforeAll
5150 public static void setUpClass () throws IOException {
5251
5352 session = new SedonaSparkSession ();
5453 //Get parquetPath and any other application.properties
55- try {
54+ try {
5655 ClassLoader loader = Thread .currentThread ().getContextClassLoader ();
5756 Properties properties = new Properties ();
5857 InputStream is = loader .getResourceAsStream ("application.properties" );
59- properties .load (is );
58+ properties .load (is );
6059 parquetPath = properties .getProperty ("parquet.path" );
6160 } catch (IOException e ) {
6261 e .printStackTrace ();
6362 parquetPath = "" ;
6463 }
65-
64+
6665 }
67-
66+
6867 @ AfterAll
6968 public static void tearDownClass () {
7069 }
71-
70+
7271 @ BeforeEach
7372 public void setUp () {
7473 }
7574
7675 @ AfterEach
7776 public void tearDown () {
7877 }
79-
78+
8079 @ Test
8180 public void connects () {
8281 assertNotNull (session , "SparkSedonaSession not initialized correctly." );
@@ -101,5 +100,3 @@ public void canLoadRDD() {
101100 }
102101
103102}
104-
105-
0 commit comments