增加测试用例

This commit is contained in:
everywhere.z
2023-06-19 17:21:15 +08:00
parent 80cbd8366d
commit 0c8622a27f
3 changed files with 39 additions and 0 deletions

View File

@@ -42,6 +42,13 @@ public class FlowExecutorELSpringbootTest extends BaseTest {
Assert.assertNotNull(response.getSlot().getResponseData());
}
//测试在isAccess里setIsEnd(true)
@Test
public void testIsAccess2() throws Exception {
LiteflowResponse response = flowExecutor.execute2Resp("chain1-2", null);
Assert.assertTrue(response.isSuccess());
}
// 组件抛错的功能点测试
@Test(expected = ArithmeticException.class)
public void testComponentException() throws Exception {
@@ -90,4 +97,6 @@ public class FlowExecutorELSpringbootTest extends BaseTest {
Assert.assertEquals("g", response.getExecuteStepStr());
}
}

View File

@@ -0,0 +1,26 @@
/**
* <p>Title: liteflow</p>
* <p>Description: 轻量级的组件式流程框架</p>
* @author Bryan.Zhang
* @email weenyc31@163.com
* @Date 2020/4/1
*/
package com.yomahub.liteflow.test.component.cmp1;
import com.yomahub.liteflow.core.NodeComponent;
import org.springframework.stereotype.Component;
@Component("j")
public class JCmp extends NodeComponent {
@Override
public void process() {
System.out.println("JCmp executed!");
}
@Override
public boolean isAccess() {
this.setIsEnd(true);
return false;
}
}

View File

@@ -4,6 +4,10 @@
THEN(a);
</chain>
<chain name="chain1-2">
THEN(j, h);
</chain>
<chain name="chain2">
THEN(b);
</chain>