4
4
5
5
import org .apache .commons .logging .Log ;
6
6
import org .apache .commons .logging .LogFactory ;
7
- import org .apache .spark .api .java .JavaSparkContext ;
8
7
import org .apache .spark .sql .Column ;
9
8
import org .apache .spark .sql .Dataset ;
10
9
import org .apache .spark .sql .Row ;
11
10
import org .apache .spark .sql .SparkSession ;
12
11
import org .apache .spark .sql .types .DataType ;
13
12
14
- import zingg . common . client . IZingg ;
13
+ import org . junit . jupiter . api . extension . ExtendWith ;
15
14
import zingg .common .client .ZinggClientException ;
16
15
import zingg .common .client .util .DFObjectUtil ;
17
16
import zingg .common .client .util .IWithSession ;
18
17
import zingg .common .client .util .WithSession ;
19
18
import zingg .common .core .executor .TestExecutorsCompound ;
20
19
import zingg .common .core .executor .TrainMatcher ;
21
20
import zingg .spark .client .util .SparkDFObjectUtil ;
21
+ import zingg .spark .core .TestSparkBase ;
22
22
import zingg .spark .core .context .ZinggSparkContext ;
23
23
import zingg .spark .core .executor .labeller .ProgrammaticSparkLabeller ;
24
24
import zingg .spark .core .executor .validate .SparkTrainMatchValidator ;
25
25
26
+ @ ExtendWith (TestSparkBase .class )
26
27
public class TestSparkExecutorsCompound extends TestExecutorsCompound <SparkSession ,Dataset <Row >,Row ,Column ,DataType > {
27
28
protected static final String CONFIG_FILE = "zingg/spark/core/executor/configSparkIntTest.json" ;
28
29
protected static final String TEST_DATA_FILE = "zingg/spark/core/executor/test.csv" ;
@@ -31,22 +32,11 @@ public class TestSparkExecutorsCompound extends TestExecutorsCompound<SparkSessi
31
32
32
33
protected ZinggSparkContext ctx ;
33
34
34
- public TestSparkExecutorsCompound () throws IOException , ZinggClientException {
35
- SparkSession spark = SparkSession
36
- .builder ()
37
- .master ("local[*]" )
38
- .appName ("Zingg" + "Junit" )
39
- .getOrCreate ();
40
-
41
- JavaSparkContext ctx1 = new JavaSparkContext (spark .sparkContext ());
42
- JavaSparkContext .jarOfClass (IZingg .class );
43
- ctx1 .setCheckpointDir ("/tmp/checkpoint" );
44
-
35
+ public TestSparkExecutorsCompound (SparkSession sparkSession ) throws IOException , ZinggClientException {
45
36
this .ctx = new ZinggSparkContext ();
46
- this .ctx .setSession (spark );
37
+ this .ctx .setSession (sparkSession );
47
38
this .ctx .setUtils ();
48
- init (spark );
49
- //setupArgs();
39
+ init (sparkSession );
50
40
}
51
41
52
42
@ Override
0 commit comments