Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,23 @@
public class JavaDefaultReadWriteSuite {

JavaSparkContext jsc = null;
SQLContext sqlContext = null;
File tempDir = null;

@Before
public void setUp() {
jsc = new JavaSparkContext("local[2]", "JavaDefaultReadWriteSuite");
SQLContext.clearActive();
sqlContext = new SQLContext(jsc);
SQLContext.setActive(sqlContext);
tempDir = Utils.createTempDir(
System.getProperty("java.io.tmpdir"), "JavaDefaultReadWriteSuite");
}

@After
public void tearDown() {
sqlContext = null;
SQLContext.clearActive();
if (jsc != null) {
jsc.stop();
jsc = null;
Expand All @@ -64,7 +70,6 @@ public void testDefaultReadWrite() throws IOException {
} catch (IOException e) {
// expected
}
SQLContext sqlContext = new SQLContext(jsc);
instance.write().context(sqlContext).overwrite().save(outputPath);
MyParams newInstance = MyParams.load(outputPath);
Assert.assertEquals("UID should match.", instance.uid(), newInstance.uid());
Expand Down