From d5bf7070152e7d0694fd3ba9c189be42a894e5d8 Mon Sep 17 00:00:00 2001 From: Kent Yao Date: Tue, 6 Mar 2018 14:54:37 +0800 Subject: [PATCH] add scala test plugin --- pom.xml | 30 ++++++++++++++++++- .../kyuubi/SparkContextReflectionSuite.scala | 4 +++ .../kyuubi/SparkSessionReflectionSuite.scala | 1 + 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 226ee0f08..f398a0140 100644 --- a/pom.xml +++ b/pom.xml @@ -290,7 +290,7 @@ net.alchim31.maven scala-maven-plugin - 3.2.2 + 3.3.1 eclipse-add-source @@ -368,6 +368,34 @@ + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12.4 + + true + + + + + org.scalatest + scalatest-maven-plugin + 1.0 + + ${project.build.directory}/surefire-reports + . + TestSuite.txt + + + + test + + test + + + + diff --git a/src/test/scala/yaooqinn/kyuubi/SparkContextReflectionSuite.scala b/src/test/scala/yaooqinn/kyuubi/SparkContextReflectionSuite.scala index a658419e3..2b591052f 100644 --- a/src/test/scala/yaooqinn/kyuubi/SparkContextReflectionSuite.scala +++ b/src/test/scala/yaooqinn/kyuubi/SparkContextReflectionSuite.scala @@ -31,6 +31,7 @@ class SparkContextReflectionSuite extends SparkFunSuite { .newInstance(classOf[SparkContext].getName, Seq(classOf[SparkConf]), Seq(conf)) .asInstanceOf[SparkContext] assert(sc.isInstanceOf[SparkContext]) + sc.stop() } test("SparkContext initialization with this()") { @@ -48,6 +49,7 @@ class SparkContextReflectionSuite extends SparkFunSuite { Seq("local", "sc_init", conf)) .asInstanceOf[SparkContext] assert(sc.isInstanceOf[SparkContext]) + sc.stop() } test("Initializing 2 SparkContext with Reflection") { @@ -63,5 +65,7 @@ class SparkContextReflectionSuite extends SparkFunSuite { .asInstanceOf[SparkContext] assert(sc1 !== sc2) + sc1.stop() + sc2.stop() } } diff --git a/src/test/scala/yaooqinn/kyuubi/SparkSessionReflectionSuite.scala b/src/test/scala/yaooqinn/kyuubi/SparkSessionReflectionSuite.scala index c1d337310..7ffd417dd 100644 --- a/src/test/scala/yaooqinn/kyuubi/SparkSessionReflectionSuite.scala +++ b/src/test/scala/yaooqinn/kyuubi/SparkSessionReflectionSuite.scala @@ -35,5 +35,6 @@ class SparkSessionReflectionSuite extends SparkFunSuite { Seq(classOf[SparkContext]), Seq(sc)).asInstanceOf[SparkSession] assert(ss.isInstanceOf[SparkSession]) + ss.stop() } }