未验证 提交 84409b57 编写于 作者: Y Yelli 提交者: GitHub

fix taskinstance.isSubprocess misjudgment (#2007)

* add processInstanceService UT

* fix taskInstance.isSubProcess
add processInstanceService UT

* add taskInstance.isSubProcess UT

* modify taskInstance.isSubProcess UT

* add license

* remove author&date
上级 f407adcb
......@@ -374,7 +374,7 @@ public class TaskInstance {
public Boolean isSubProcess(){
return TaskType.SUB_PROCESS.toString().equals(this.taskType.toUpperCase());
return TaskType.SUB_PROCESS.getDescp().equals(this.taskType);
}
public String getDependency(){
......
/*
* 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.dolphinscheduler.dao.entity;
import org.junit.Assert;
import org.junit.Test;
public class TaskInstanceTest {
/**
* task instance sub process
*/
@Test
public void testTaskInstanceIsSubProcess() {
TaskInstance taskInstance = new TaskInstance();
//sub process
taskInstance.setTaskType("sub process");
Assert.assertTrue(taskInstance.isSubProcess());
//not sub process
taskInstance.setTaskType("http");
Assert.assertFalse(taskInstance.isSubProcess());
}
}
......@@ -722,6 +722,7 @@
<include>**/dao/mapper/AlertGroupMapperTest.java</include>
<include>**/dao/mapper/AlertMapperTest.java</include>
<include>**/dao/mapper/CommandMapperTest.java</include>
<include>**/dao/entity/TaskInstanceTest.java</include>
<include>**/dao/cron/CronUtilsTest.java</include>
<include>**/dao/utils/DagHelperTest.java</include>
<include>**/alert/template/AlertTemplateFactoryTest.java</include>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册