You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@linkis.apache.org by pe...@apache.org on 2022/10/10 09:49:17 UTC
[incubator-linkis] branch dev-1.3.1 updated: fix: error-code-common unit test (#3562)
This is an automated email from the ASF dual-hosted git repository.
peacewong pushed a commit to branch dev-1.3.1
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git
The following commit(s) were added to refs/heads/dev-1.3.1 by this push:
new 5c658f57a fix: error-code-common unit test (#3562)
5c658f57a is described below
commit 5c658f57a8b1b1765d80178620b3ea3cabca67b3
Author: ruY <43...@users.noreply.github.com>
AuthorDate: Mon Oct 10 17:49:11 2022 +0800
fix: error-code-common unit test (#3562)
---
.../linkis/errorcode/common/LinkisErrorCode.scala | 2 --
.../linkis/errorcode/common/CommonConfTest.java | 33 ++++++++++++++++++++
.../errorcode/common/LinkisErrorCodeTest.scala | 35 ++++++++++++++++++++++
3 files changed, 68 insertions(+), 2 deletions(-)
diff --git a/linkis-public-enhancements/linkis-error-code/linkis-error-code-common/src/main/scala/org/apache/linkis/errorcode/common/LinkisErrorCode.scala b/linkis-public-enhancements/linkis-error-code/linkis-error-code-common/src/main/scala/org/apache/linkis/errorcode/common/LinkisErrorCode.scala
index b9df7ebc8..8344eb4f9 100644
--- a/linkis-public-enhancements/linkis-error-code/linkis-error-code-common/src/main/scala/org/apache/linkis/errorcode/common/LinkisErrorCode.scala
+++ b/linkis-public-enhancements/linkis-error-code/linkis-error-code-common/src/main/scala/org/apache/linkis/errorcode/common/LinkisErrorCode.scala
@@ -17,8 +17,6 @@
package org.apache.linkis.errorcode.common
-import org.apache.linkis.common.utils.Logging
-
import scala.util.matching.Regex
class LinkisErrorCode extends AbstractErrorCode {
diff --git a/linkis-public-enhancements/linkis-error-code/linkis-error-code-common/src/test/java/org/apache/linkis/errorcode/common/CommonConfTest.java b/linkis-public-enhancements/linkis-error-code/linkis-error-code-common/src/test/java/org/apache/linkis/errorcode/common/CommonConfTest.java
new file mode 100644
index 000000000..f24bfe4a9
--- /dev/null
+++ b/linkis-public-enhancements/linkis-error-code/linkis-error-code-common/src/test/java/org/apache/linkis/errorcode/common/CommonConfTest.java
@@ -0,0 +1,33 @@
+/*
+ * 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.linkis.errorcode.common;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.Test;
+
+public class CommonConfTest {
+
+ @Test
+ @DisplayName("constTest")
+ public void constTest() {
+
+ String errorcodeUrl = CommonConf.GET_ERRORCODE_URL;
+ Assertions.assertEquals("getAllErrorCodes", errorcodeUrl);
+ }
+}
diff --git a/linkis-public-enhancements/linkis-error-code/linkis-error-code-common/src/test/scala/org/apache/linkis/errorcode/common/LinkisErrorCodeTest.scala b/linkis-public-enhancements/linkis-error-code/linkis-error-code-common/src/test/scala/org/apache/linkis/errorcode/common/LinkisErrorCodeTest.scala
new file mode 100644
index 000000000..6e82f0ebc
--- /dev/null
+++ b/linkis-public-enhancements/linkis-error-code/linkis-error-code-common/src/test/scala/org/apache/linkis/errorcode/common/LinkisErrorCodeTest.scala
@@ -0,0 +1,35 @@
+/*
+ * 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.linkis.errorcode.common
+
+import org.junit.jupiter.api.{Assertions, DisplayName, Test}
+
+class LinkisErrorCodeTest {
+
+ @Test
+ @DisplayName("linkisErrorCodeTest")
+ def linkisErrorCodeTest(): Unit = {
+ val errorCode = new LinkisErrorCode(
+ "11000",
+ "Failed to get datasource info from datasource server(从数据源服务器获取数据源信息失败)"
+ )
+ Assertions.assertEquals("11000", errorCode.getErrorCode)
+
+ }
+
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org