diff options
author | Xin Wu <xinwu@us.ibm.com> | 2016-05-27 14:07:12 -0700 |
---|---|---|
committer | Yin Huai <yhuai@databricks.com> | 2016-05-27 14:07:12 -0700 |
commit | 019afd9c78a9f40e1d07f0a74868010206e90ed5 (patch) | |
tree | e6ed10112aba38cdcf64442550b56b91230d3e35 /sql/hive-thriftserver/src | |
parent | 21b2605dc4900894ea7a911e039781ecc2a18c14 (diff) | |
download | spark-019afd9c78a9f40e1d07f0a74868010206e90ed5.tar.gz spark-019afd9c78a9f40e1d07f0a74868010206e90ed5.tar.bz2 spark-019afd9c78a9f40e1d07f0a74868010206e90ed5.zip |
[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 <xinwu@us.ibm.com>
Closes #13361 from xwu0226/SPARK-15431-clisuite-new.
Diffstat (limited to 'sql/hive-thriftserver/src')
-rw-r--r-- | sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/CliSuite.scala | 37 |
1 files changed, 26 insertions, 11 deletions
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 656fe973b0..75535cad1b 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" ) } } |