Repository: spark
Updated Branches:
  refs/heads/master 21b2605dc -> 019afd9c7


[SPARK-15431][SQL][BRANCH-2.0-TEST] rework the clisuite test cases

## What changes were proposed in this pull request?
This PR reworks on the CliSuite test cases for `LIST FILES/JARS` commands.

CC yhuai Thanks!

Author: Xin Wu <[email protected]>

Closes #13361 from xwu0226/SPARK-15431-clisuite-new.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/019afd9c
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/019afd9c
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/019afd9c

Branch: refs/heads/master
Commit: 019afd9c78a9f40e1d07f0a74868010206e90ed5
Parents: 21b2605
Author: Xin Wu <[email protected]>
Authored: Fri May 27 14:07:12 2016 -0700
Committer: Yin Huai <[email protected]>
Committed: Fri May 27 14:07:12 2016 -0700

----------------------------------------------------------------------
 .../spark/sql/hive/thriftserver/CliSuite.scala  | 37 ++++++++++++++------
 1 file changed, 26 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/019afd9c/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/CliSuite.scala
----------------------------------------------------------------------
diff --git 
a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/CliSuite.scala
 
b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/CliSuite.scala
index 656fe97..75535ca 100644
--- 
a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/CliSuite.scala
+++ 
b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/CliSuite.scala
@@ -62,13 +62,13 @@ class CliSuite extends SparkFunSuite with BeforeAndAfterAll 
with Logging {
 
   /**
    * Run a CLI operation and expect all the queries and expected answers to be 
returned.
+   *
    * @param timeout maximum time for the commands to complete
    * @param extraArgs any extra arguments
    * @param errorResponses a sequence of strings whose presence in the stdout 
of the forked process
    *                       is taken as an immediate error condition. That is: 
if a line containing
    *                       with one of these strings is found, fail the test 
immediately.
    *                       The default value is `Seq("Error:")`
-   *
    * @param queriesAndExpectedAnswers one or more tuples of query + answer
    */
   def runCliWithin(
@@ -239,22 +239,37 @@ class CliSuite extends SparkFunSuite with 
BeforeAndAfterAll with Logging {
       "" -> "This is a test for Spark-11624")
   }
 
-  ignore("list jars") {
+  test("list jars") {
     val jarFile = 
Thread.currentThread().getContextClassLoader.getResource("TestUDTF.jar")
     runCliWithin(2.minute)(
-      s"ADD JAR $jarFile" -> "",
-      s"LIST JARS" -> "TestUDTF.jar",
-      s"List JAR $jarFile" -> "TestUDTF.jar"
+      s"ADD JAR $jarFile;" -> "",
+      s"LIST JARS;" -> "TestUDTF.jar"
+    )
+  }
+
+  test("list jar <jarfile>") {
+    val jarFile = 
Thread.currentThread().getContextClassLoader.getResource("TestUDTF.jar")
+    runCliWithin(2.minute)(
+      s"ADD JAR $jarFile;" -> "",
+      s"List JAR $jarFile;" -> "TestUDTF.jar"
+    )
+  }
+
+  test("list files") {
+    val dataFilePath = Thread.currentThread().
+      getContextClassLoader.getResource("data/files/small_kv.txt")
+    runCliWithin(2.minute)(
+      s"ADD FILE $dataFilePath;" -> "",
+      s"LIST FILES;" -> "small_kv.txt"
     )
   }
 
-  ignore("list files") {
-    val dataFilePath = Thread.currentThread().getContextClassLoader
-      .getResource("data/files/small_kv.txt")
+  test("list file <filepath>") {
+    val dataFilePath = Thread.currentThread().
+      getContextClassLoader.getResource("data/files/small_kv.txt")
     runCliWithin(2.minute)(
-      s"ADD FILE $dataFilePath" -> "",
-      s"LIST FILES" -> "small_kv.txt",
-      s"LIST FILE $dataFilePath" -> "small_kv.txt"
+      s"ADD FILE $dataFilePath;" -> "",
+      s"LIST FILE $dataFilePath;" -> "small_kv.txt"
     )
   }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to