diff options
Diffstat (limited to 'sql/hive-thriftserver')
-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" ) } } |