mirror of
https://gitee.com/dromara/liteFlow.git
synced 2026-05-14 04:02:09 +08:00
增加tag的测试用例
This commit is contained in:
@@ -74,4 +74,16 @@ public class NodeTagELSpringbootXmlTest extends BaseTest {
|
||||
Assertions.assertEquals("1", context.getData("test"));
|
||||
}
|
||||
|
||||
// 测试同id的节点在when场景中tag是否正常
|
||||
@Test
|
||||
public void testTag6() throws Exception {
|
||||
for (int i = 0; i < 1; i++) {
|
||||
LiteflowResponse response = flowExecutor.execute2Resp("chain6", "arg");
|
||||
DefaultContext context = response.getFirstContextBean();
|
||||
Assertions.assertTrue(response.isSuccess());
|
||||
ConcurrentHashSet<String> testSet = context.getData("test");
|
||||
Assertions.assertEquals(5, testSet.size());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* <p>Title: liteflow</p>
|
||||
* <p>Description: 轻量级的组件式流程框架</p>
|
||||
* @author Bryan.Zhang
|
||||
* @email weenyc31@163.com
|
||||
* @Date 2020/4/1
|
||||
*/
|
||||
package com.yomahub.liteflow.test.tag.cmp;
|
||||
|
||||
import cn.hutool.core.collection.ConcurrentHashSet;
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import com.yomahub.liteflow.slot.DefaultContext;
|
||||
|
||||
@LiteflowComponent("j")
|
||||
public class JCmp extends NodeComponent {
|
||||
|
||||
@Override
|
||||
public void process() {
|
||||
DefaultContext context = this.getFirstContextBean();
|
||||
ConcurrentHashSet<String> set = context.getData("test");
|
||||
set.add(this.getTag());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -19,4 +19,8 @@
|
||||
<chain name="chain5">
|
||||
WHEN(h.tag("1"));
|
||||
</chain>
|
||||
|
||||
<chain name="chain6">
|
||||
THEN(b1, WHEN(j.tag("1"), j.tag("2"), j.tag("3"), j.tag("4"), j.tag("5")));
|
||||
</chain>
|
||||
</flow>
|
||||
Reference in New Issue
Block a user