Skip to content

Commit d48fc7b

Browse files
committed
Minor updates.
1 parent 33c4fec commit d48fc7b

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

sql/core/src/test/java/org/apache/spark/sql/api/java/JavaApplySchemaSuite.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,12 @@
1717

1818
package org.apache.spark.sql.api.java;
1919

20-
import java.io.File;
2120
import java.io.Serializable;
2221
import java.math.BigDecimal;
2322
import java.util.ArrayList;
2423
import java.util.Arrays;
2524
import java.util.List;
2625

27-
import com.google.common.io.Files;
2826
import org.junit.After;
2927
import org.junit.Assert;
3028
import org.junit.Before;
@@ -36,22 +34,18 @@
3634
import org.apache.spark.api.java.JavaRDD;
3735
import org.apache.spark.api.java.JavaSparkContext;
3836
import org.apache.spark.api.java.function.Function;
39-
import org.apache.spark.sql.test.TestSQLContext;
4037

4138
// The test suite itself is Serializable so that anonymous Function implementations can be
4239
// serialized, as an alternative to converting these anonymous classes to static inner classes;
4340
// see http://stackoverflow.com/questions/758570/.
4441
public class JavaApplySchemaSuite implements Serializable {
4542
private transient JavaSparkContext javaCtx;
4643
private transient JavaSQLContext javaSqlCtx;
47-
private transient File tempDir;
4844

4945
@Before
5046
public void setUp() {
51-
javaCtx = new JavaSparkContext(TestSQLContext.sparkContext());
47+
javaCtx = new JavaSparkContext("local", "JavaApplySchemaSuite");
5248
javaSqlCtx = new JavaSQLContext(javaCtx);
53-
tempDir = Files.createTempDir();
54-
tempDir.deleteOnExit();
5549
}
5650

5751
@After
@@ -135,7 +129,7 @@ public void applySchemaToJSON() {
135129
fields.add(DataType.createStructField("null", DataType.StringType, true));
136130
fields.add(DataType.createStructField("string", DataType.StringType, true));
137131
StructType expectedSchema = DataType.createStructType(fields);
138-
List<Row> expectedResult = new ArrayList<Row>(1);
132+
List<Row> expectedResult = new ArrayList<Row>(2);
139133
expectedResult.add(
140134
Row.create(
141135
new BigDecimal("92233720368547758070"),

sql/core/src/test/java/org/apache/spark/sql/api/java/JavaRowSuite.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import java.util.Map;
2626

2727
import org.junit.Assert;
28-
import org.junit.BeforeClass;
28+
import org.junit.Before;
2929
import org.junit.Test;
3030

3131
public class JavaRowSuite {
@@ -41,7 +41,7 @@ public class JavaRowSuite {
4141
private byte[] binaryValue;
4242
private Timestamp timestampValue;
4343

44-
@BeforeClass
44+
@Before
4545
public void setUp() {
4646
byteValue = (byte)127;
4747
shortValue = (short)32767;

0 commit comments

Comments
 (0)