You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@linkis.apache.org by ca...@apache.org on 2022/08/08 04:04:15 UTC
[incubator-linkis] branch dev-1.2.1 updated: Add TaskDaoTest (#2624)
This is an automated email from the ASF dual-hosted git repository.
casion pushed a commit to branch dev-1.2.1
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git
The following commit(s) were added to refs/heads/dev-1.2.1 by this push:
new 4baec60fb Add TaskDaoTest (#2624)
4baec60fb is described below
commit 4baec60fbe49002ef0b21cca264ac5499cd7f71b
Author: 成彬彬 <10...@users.noreply.github.com>
AuthorDate: Mon Aug 8 12:04:12 2022 +0800
Add TaskDaoTest (#2624)
---
.../org/apache/linkis/bml/dao/TaskDaoTest.java | 70 ++++++++++++++++++++++
1 file changed, 70 insertions(+)
diff --git a/linkis-public-enhancements/linkis-bml/linkis-bml-server/src/test/java/org/apache/linkis/bml/dao/TaskDaoTest.java b/linkis-public-enhancements/linkis-bml/linkis-bml-server/src/test/java/org/apache/linkis/bml/dao/TaskDaoTest.java
new file mode 100644
index 000000000..b70e7b5f9
--- /dev/null
+++ b/linkis-public-enhancements/linkis-bml/linkis-bml-server/src/test/java/org/apache/linkis/bml/dao/TaskDaoTest.java
@@ -0,0 +1,70 @@
+/*
+ * 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.bml.dao;
+
+import org.apache.linkis.bml.entity.ResourceTask;
+
+import org.springframework.beans.factory.annotation.Autowired;
+
+import org.junit.jupiter.api.Test;
+
+import java.util.Date;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+class TaskDaoTest extends BaseDaoTest {
+ @Autowired TaskDao taskDao;
+
+ @Test
+ void insert() {
+ ResourceTask resourceTask = new ResourceTask();
+ resourceTask.setResourceId("123");
+ resourceTask.setClientIp("192.168.142");
+ resourceTask.setEndTime(new Date());
+ resourceTask.setId(32);
+ resourceTask.setStartTime(new Date());
+ resourceTask.setErrMsg("testErr");
+ resourceTask.setExtraParams("testpar");
+ resourceTask.setInstance("testInst");
+ resourceTask.setLastUpdateTime(new Date());
+ resourceTask.setOperation("testOPer");
+ resourceTask.setState("1");
+ resourceTask.setSubmitUser("testSumUser");
+ resourceTask.setSystem("testSym");
+ resourceTask.setVersion("1.2");
+ taskDao.insert(resourceTask);
+ }
+
+ @Test
+ void updateState() {
+ insert();
+ taskDao.updateState(32, "1", new Date());
+ }
+
+ @Test
+ void updateState2Failed() {
+ insert();
+ taskDao.updateState2Failed(32, "1", new Date(), "errMsg");
+ }
+
+ @Test
+ void getNewestVersion() {
+ insert();
+ taskDao.getNewestVersion("123");
+ }
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org