aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReynold Xin <rxin@databricks.com>2016-05-27 21:20:02 -0700
committerReynold Xin <rxin@databricks.com>2016-05-27 21:20:02 -0700
commit73178c75565e20f53e6ee1478f3d976732c64438 (patch)
treed299dcf3debb71c434688c75d0abdf8f03b576a3
parent9893dc975784551a62f65bbd709f8972e0204b2a (diff)
downloadspark-73178c75565e20f53e6ee1478f3d976732c64438.tar.gz
spark-73178c75565e20f53e6ee1478f3d976732c64438.tar.bz2
spark-73178c75565e20f53e6ee1478f3d976732c64438.zip
[SPARK-15633][MINOR] Make package name for Java tests consistent
## What changes were proposed in this pull request? This is a simple patch that makes package names for Java 8 test suites consistent. I moved everything to test.org.apache.spark to we can test package private APIs properly. Also added "java8" as the package name so we can easily run all the tests related to Java 8. ## How was this patch tested? This is a test only change. Author: Reynold Xin <rxin@databricks.com> Closes #13364 from rxin/SPARK-15633.
-rw-r--r--core/src/test/scala/org/apache/spark/SparkFunSuite.scala2
-rw-r--r--external/java8-tests/src/test/java/test/org/apache/spark/java8/Java8RDDAPISuite.java (renamed from external/java8-tests/src/test/java/org/apache/spark/Java8APISuite.java)8
-rw-r--r--external/java8-tests/src/test/java/test/org/apache/spark/java8/dstream/Java8APISuite.java (renamed from external/java8-tests/src/test/java/org/apache/spark/streaming/Java8APISuite.java)3
-rw-r--r--external/java8-tests/src/test/java/test/org/apache/spark/java8/sql/Java8DatasetAggregatorSuite.java (renamed from external/java8-tests/src/test/java/org/apache/spark/sql/Java8DatasetAggregatorSuite.java)7
-rw-r--r--external/java8-tests/src/test/scala/test/org/apache/spark/java8/JDK8ScalaSuite.scala (renamed from external/java8-tests/src/test/scala/org/apache/spark/JDK8ScalaSuite.scala)5
-rw-r--r--sql/core/src/test/java/test/org/apache/spark/sql/JavaDatasetAggregatorSuite.java (renamed from sql/core/src/test/java/test/org/apache/spark/sql/sources/JavaDatasetAggregatorSuite.java)2
-rw-r--r--sql/core/src/test/java/test/org/apache/spark/sql/JavaDatasetAggregatorSuiteBase.java (renamed from sql/core/src/test/java/test/org/apache/spark/sql/sources/JavaDatasetAggregatorSuiteBase.java)2
-rw-r--r--sql/core/src/test/java/test/org/apache/spark/sql/JavaSaveLoadSuite.java (renamed from sql/core/src/test/java/test/org/apache/spark/sql/sources/JavaSaveLoadSuite.java)2
8 files changed, 19 insertions, 12 deletions
diff --git a/core/src/test/scala/org/apache/spark/SparkFunSuite.scala b/core/src/test/scala/org/apache/spark/SparkFunSuite.scala
index 0081bca639..cd876807f8 100644
--- a/core/src/test/scala/org/apache/spark/SparkFunSuite.scala
+++ b/core/src/test/scala/org/apache/spark/SparkFunSuite.scala
@@ -26,7 +26,7 @@ import org.apache.spark.util.AccumulatorContext
/**
* Base abstract class for all unit tests in Spark for handling common functionality.
*/
-private[spark] abstract class SparkFunSuite
+abstract class SparkFunSuite
extends FunSuite
with BeforeAndAfterAll
with Logging {
diff --git a/external/java8-tests/src/test/java/org/apache/spark/Java8APISuite.java b/external/java8-tests/src/test/java/test/org/apache/spark/java8/Java8RDDAPISuite.java
index 6ac5ca9cf5..8ee0e7e415 100644
--- a/external/java8-tests/src/test/java/org/apache/spark/Java8APISuite.java
+++ b/external/java8-tests/src/test/java/test/org/apache/spark/java8/Java8RDDAPISuite.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.spark;
+package test.org.apache.spark.java8;
import java.io.File;
import java.io.Serializable;
@@ -33,6 +33,8 @@ import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
+import org.apache.spark.Accumulator;
+import org.apache.spark.AccumulatorParam;
import org.apache.spark.api.java.JavaDoubleRDD;
import org.apache.spark.api.java.JavaPairRDD;
import org.apache.spark.api.java.JavaRDD;
@@ -45,8 +47,8 @@ import org.apache.spark.util.Utils;
* Most of these tests replicate org.apache.spark.JavaAPISuite using java 8
* lambda syntax.
*/
-public class Java8APISuite implements Serializable {
- static int foreachCalls = 0;
+public class Java8RDDAPISuite implements Serializable {
+ private static int foreachCalls = 0;
private transient JavaSparkContext sc;
@Before
diff --git a/external/java8-tests/src/test/java/org/apache/spark/streaming/Java8APISuite.java b/external/java8-tests/src/test/java/test/org/apache/spark/java8/dstream/Java8APISuite.java
index d0fed303e6..cf5607f5e8 100644
--- a/external/java8-tests/src/test/java/org/apache/spark/streaming/Java8APISuite.java
+++ b/external/java8-tests/src/test/java/test/org/apache/spark/java8/dstream/Java8APISuite.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.spark.streaming;
+package test.org.apache.spark.java8.dstream;
import java.io.Serializable;
import java.util.*;
@@ -33,6 +33,7 @@ import org.apache.spark.api.java.Optional;
import org.apache.spark.api.java.JavaPairRDD;
import org.apache.spark.api.java.JavaRDD;
import org.apache.spark.api.java.function.PairFunction;
+import org.apache.spark.streaming.*;
import org.apache.spark.streaming.api.java.JavaDStream;
import org.apache.spark.streaming.api.java.JavaPairDStream;
import org.apache.spark.streaming.api.java.JavaMapWithStateDStream;
diff --git a/external/java8-tests/src/test/java/org/apache/spark/sql/Java8DatasetAggregatorSuite.java b/external/java8-tests/src/test/java/test/org/apache/spark/java8/sql/Java8DatasetAggregatorSuite.java
index 1a2aea67d9..10d25fa445 100644
--- a/external/java8-tests/src/test/java/org/apache/spark/sql/Java8DatasetAggregatorSuite.java
+++ b/external/java8-tests/src/test/java/test/org/apache/spark/java8/sql/Java8DatasetAggregatorSuite.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package test.org.apache.spark.sql.sources;
+package test.org.apache.spark.java8.sql;
import java.util.Arrays;
@@ -26,6 +26,7 @@ import scala.Tuple2;
import org.apache.spark.sql.Dataset;
import org.apache.spark.sql.KeyValueGroupedDataset;
import org.apache.spark.sql.expressions.javalang.typed;
+import test.org.apache.spark.sql.JavaDatasetAggregatorSuiteBase;
/**
* Suite that replicates tests in JavaDatasetAggregatorSuite using lambda syntax.
@@ -42,7 +43,7 @@ public class Java8DatasetAggregatorSuite extends JavaDatasetAggregatorSuiteBase
public void testTypedAggregationCount() {
KeyValueGroupedDataset<String, Tuple2<String, Integer>> grouped = generateGroupedDataset();
Dataset<Tuple2<String, Long>> agged = grouped.agg(typed.count(v -> v));
- Assert.assertEquals(Arrays.asList(tuple2("a", 2), tuple2("b", 1)), agged.collectAsList());
+ Assert.assertEquals(Arrays.asList(tuple2("a", 2L), tuple2("b", 1L)), agged.collectAsList());
}
@Test
@@ -56,6 +57,6 @@ public class Java8DatasetAggregatorSuite extends JavaDatasetAggregatorSuiteBase
public void testTypedAggregationSumLong() {
KeyValueGroupedDataset<String, Tuple2<String, Integer>> grouped = generateGroupedDataset();
Dataset<Tuple2<String, Long>> agged = grouped.agg(typed.sumLong(v -> (long)v._2()));
- Assert.assertEquals(Arrays.asList(tuple2("a", 3), tuple2("b", 3)), agged.collectAsList());
+ Assert.assertEquals(Arrays.asList(tuple2("a", 3L), tuple2("b", 3L)), agged.collectAsList());
}
}
diff --git a/external/java8-tests/src/test/scala/org/apache/spark/JDK8ScalaSuite.scala b/external/java8-tests/src/test/scala/test/org/apache/spark/java8/JDK8ScalaSuite.scala
index fa0681db41..c4042e47e8 100644
--- a/external/java8-tests/src/test/scala/org/apache/spark/JDK8ScalaSuite.scala
+++ b/external/java8-tests/src/test/scala/test/org/apache/spark/java8/JDK8ScalaSuite.scala
@@ -15,7 +15,10 @@
* limitations under the License.
*/
-package org.apache.spark
+package test.org.apache.spark.java8
+
+import org.apache.spark.SharedSparkContext
+import org.apache.spark.SparkFunSuite
/**
* Test cases where JDK8-compiled Scala user code is used with Spark.
diff --git a/sql/core/src/test/java/test/org/apache/spark/sql/sources/JavaDatasetAggregatorSuite.java b/sql/core/src/test/java/test/org/apache/spark/sql/JavaDatasetAggregatorSuite.java
index f9842e130b..fe86371516 100644
--- a/sql/core/src/test/java/test/org/apache/spark/sql/sources/JavaDatasetAggregatorSuite.java
+++ b/sql/core/src/test/java/test/org/apache/spark/sql/JavaDatasetAggregatorSuite.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package test.org.apache.spark.sql.sources;
+package test.org.apache.spark.sql;
import java.util.Arrays;
diff --git a/sql/core/src/test/java/test/org/apache/spark/sql/sources/JavaDatasetAggregatorSuiteBase.java b/sql/core/src/test/java/test/org/apache/spark/sql/JavaDatasetAggregatorSuiteBase.java
index 059c2d9f2c..8fc4eff55d 100644
--- a/sql/core/src/test/java/test/org/apache/spark/sql/sources/JavaDatasetAggregatorSuiteBase.java
+++ b/sql/core/src/test/java/test/org/apache/spark/sql/JavaDatasetAggregatorSuiteBase.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package test.org.apache.spark.sql.sources;
+package test.org.apache.spark.sql;
import java.io.Serializable;
import java.util.Arrays;
diff --git a/sql/core/src/test/java/test/org/apache/spark/sql/sources/JavaSaveLoadSuite.java b/sql/core/src/test/java/test/org/apache/spark/sql/JavaSaveLoadSuite.java
index 9840bc46f9..6941c86dfc 100644
--- a/sql/core/src/test/java/test/org/apache/spark/sql/sources/JavaSaveLoadSuite.java
+++ b/sql/core/src/test/java/test/org/apache/spark/sql/JavaSaveLoadSuite.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package test.org.apache.spark.sql.sources;
+package test.org.apache.spark.sql;
import java.io.File;
import java.io.IOException;