mirror of
https://gitee.com/dromara/liteFlow.git
synced 2026-05-14 12:12:08 +08:00
增加测试用例
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,10 @@
|
||||
THEN(a);
|
||||
</chain>
|
||||
|
||||
<chain name="chain1-2">
|
||||
THEN(j, h);
|
||||
</chain>
|
||||
|
||||
<chain name="chain2">
|
||||
THEN(b);
|
||||
</chain>
|
||||
|
||||
Reference in New Issue
Block a user