From 6e88ce9ef7b26dbae6e4b8d01ae917a44a93053a Mon Sep 17 00:00:00 2001 From: Kent Yao Date: Tue, 20 Oct 2020 18:26:12 +0800 Subject: [PATCH] some tests --- .../src/test/scala/org/apache/kyuubi/UtilsSuite.scala | 2 ++ .../scala/org/apache/kyuubi/config/KyuubiConfSuite.scala | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/kyuubi-common/src/test/scala/org/apache/kyuubi/UtilsSuite.scala b/kyuubi-common/src/test/scala/org/apache/kyuubi/UtilsSuite.scala index 4dbf25f95..c005de6da 100644 --- a/kyuubi-common/src/test/scala/org/apache/kyuubi/UtilsSuite.scala +++ b/kyuubi-common/src/test/scala/org/apache/kyuubi/UtilsSuite.scala @@ -120,5 +120,7 @@ class UtilsSuite extends KyuubiFunSuite { Utils.majorMinorVersion(KYUUBI_VERSION)._2) assert(Utils.shortVersion(KYUUBI_VERSION) === KYUUBI_VERSION.stripSuffix("-SNAPSHOT")) + intercept[IllegalArgumentException](Utils.shortVersion("-" + KYUUBI_VERSION)) + intercept[IllegalArgumentException](Utils.majorMinorVersion("-" + KYUUBI_VERSION)) } } diff --git a/kyuubi-common/src/test/scala/org/apache/kyuubi/config/KyuubiConfSuite.scala b/kyuubi-common/src/test/scala/org/apache/kyuubi/config/KyuubiConfSuite.scala index a69ac3bee..5d405cdd3 100644 --- a/kyuubi-common/src/test/scala/org/apache/kyuubi/config/KyuubiConfSuite.scala +++ b/kyuubi-common/src/test/scala/org/apache/kyuubi/config/KyuubiConfSuite.scala @@ -86,4 +86,12 @@ class KyuubiConfSuite extends KyuubiFunSuite { assert(cloned.getOption(key).get === "xyz") } + + test("to spark prefixed conf") { + val conf = KyuubiConf(false) + assert(conf.toSparkPrefixedConf.isEmpty) + assert(conf.set("kyuubi.kent", "yao").toSparkPrefixedConf.get("spark.kyuubi.kent") === + Some("yao")) + } + }