You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by GitBox <gi...@apache.org> on 2022/08/04 08:26:51 UTC

[GitHub] [incubator-kyuubi] deadwind4 commented on a diff in pull request #3181: [KYUUBI #3180] Add component version util

deadwind4 commented on code in PR #3181:
URL: https://github.com/apache/incubator-kyuubi/pull/3181#discussion_r937497026


##########
kyuubi-common/src/test/scala/org/apache/kyuubi/engine/ComponentVersionSuite.scala:
##########
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.kyuubi.engine
+
+import org.apache.kyuubi.KyuubiFunSuite
+
+class ComponentVersionSuite extends KyuubiFunSuite {
+
+  test("parse normal version") {
+    val version = new ComponentVersion("1.12.4")
+    assert(version.majorVersion === 1)
+    assert(version.minorVersion === 12)
+    assert(version.patchVersion === "4")
+  }
+
+  test("parse snapshot version") {
+    val version = new ComponentVersion("2.14.8-SNAPSHOT")
+    assert(version.majorVersion === 2)
+    assert(version.minorVersion === 14)
+    assert(version.patchVersion === "8-SNAPSHOT")

Review Comment:
   The patch version is in various forms. I delete the patch version in this class and think about it in the future.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org