From 78b95b7a40caecb3665602c3142935f3d398ed36 Mon Sep 17 00:00:00 2001 From: "everywhere.z" Date: Tue, 21 Feb 2023 19:14:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0switch=E7=9A=84=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../switchcase/SwitchELSpringbootTest.java | 8 ++++++++ .../test/switchcase/cmp/KSwitchCmp.java | 20 +++++++++++++++++++ .../src/test/resources/switchcase/flow.el.xml | 8 ++++++++ 3 files changed, 36 insertions(+) create mode 100644 liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/switchcase/cmp/KSwitchCmp.java diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/switchcase/SwitchELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/switchcase/SwitchELSpringbootTest.java index d043364b9..674858d4f 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/switchcase/SwitchELSpringbootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/switchcase/SwitchELSpringbootTest.java @@ -92,4 +92,12 @@ public class SwitchELSpringbootTest extends BaseTest { Assert.assertEquals("a==>j==>d",response.getExecuteStepStr()); } + //测试跳转到某个链路上 + @Test + public void testSwitch9() throws Exception{ + LiteflowResponse response = flowExecutor.execute2Resp("chain9", "arg"); + Assert.assertTrue(response.isSuccess()); + Assert.assertEquals("k==>a==>b",response.getExecuteStepStr()); + } + } diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/switchcase/cmp/KSwitchCmp.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/switchcase/cmp/KSwitchCmp.java new file mode 100644 index 000000000..efea50e3a --- /dev/null +++ b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/switchcase/cmp/KSwitchCmp.java @@ -0,0 +1,20 @@ +/** + *

Title: liteflow

+ *

Description: 轻量级的组件式流程框架

+ * @author Tingliang Wang + * @email bytlwang@126.com + * @Date 2022/12/09 + */ +package com.yomahub.liteflow.test.switchcase.cmp; + +import com.yomahub.liteflow.core.NodeSwitchComponent; +import org.springframework.stereotype.Component; + +@Component("k") +public class KSwitchCmp extends NodeSwitchComponent { + + @Override + public String processSwitch() throws Exception { + return "chain10"; + } +} diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/switchcase/flow.el.xml b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/switchcase/flow.el.xml index 227eaf43a..0717559e8 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/switchcase/flow.el.xml +++ b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/switchcase/flow.el.xml @@ -56,4 +56,12 @@ SWITCH(j).to(b, c).DEFAULT(d) ); + + + SWITCH(k).TO(a, chain10); + + + + THEN(a, b); + \ No newline at end of file