From 4324874cd6dfd2bf6cb2a786deac838a56a86c5d Mon Sep 17 00:00:00 2001 From: mll Date: Fri, 8 Jul 2022 14:18:41 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E7=94=A8=E4=BE=8B:=E6=A8=A1=E6=8B=9F=E7=9C=9F=E5=AE=9E?= =?UTF-8?q?=E5=9C=BA=E6=99=AF1:=E7=AE=80=E5=8D=95=E8=90=A5=E9=94=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yomahub/liteflow/test/scenes/CmpUtil.java | 23 +++ .../test/scenes/ScensELSpringbootTest1.java | 44 +++++ .../test/scenes/bean/MarketingDO.java | 157 ++++++++++++++++++ .../test/scenes/bean/RequestDataDO.java | 47 ++++++ .../test/scenes/cmp1/ASwitchChooseOneCmp.java | 64 +++++++ .../liteflow/test/scenes/cmp1/BEventCmp.java | 22 +++ .../liteflow/test/scenes/cmp1/BManualCmp.java | 21 +++ .../liteflow/test/scenes/cmp1/BTimingCmp.java | 21 +++ .../liteflow/test/scenes/cmp1/FinallyCmp.java | 20 +++ .../liteflow/test/scenes/enums/DescEnum.java | 11 ++ .../test/scenes/enums/MarketingModeEnum.java | 26 +++ .../test/scenes/enums/MarketingTypeEnum.java | 26 +++ .../resources/scens/application1.properties | 1 + .../src/test/resources/scens/flow1.el.xml | 6 + 14 files changed, 489 insertions(+) create mode 100644 liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/CmpUtil.java create mode 100644 liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/ScensELSpringbootTest1.java create mode 100644 liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/bean/MarketingDO.java create mode 100644 liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/bean/RequestDataDO.java create mode 100644 liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/cmp1/ASwitchChooseOneCmp.java create mode 100644 liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/cmp1/BEventCmp.java create mode 100644 liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/cmp1/BManualCmp.java create mode 100644 liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/cmp1/BTimingCmp.java create mode 100644 liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/cmp1/FinallyCmp.java create mode 100644 liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/enums/DescEnum.java create mode 100644 liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/enums/MarketingModeEnum.java create mode 100644 liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/enums/MarketingTypeEnum.java create mode 100644 liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/scens/application1.properties create mode 100644 liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/scens/flow1.el.xml diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/CmpUtil.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/CmpUtil.java new file mode 100644 index 000000000..c737cf8f8 --- /dev/null +++ b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/CmpUtil.java @@ -0,0 +1,23 @@ +package com.yomahub.liteflow.test.scenes; + +/** + *

公共方法类

+ *

node Component util

+ */ +public class CmpUtil { + + private static final String SPLIT_STRING = "_"; + + public CmpUtil() {} + + + /** + * 得到:唯一nodeId + * @param mode 模式(枚举) + * @param type 类型(枚举) + * @return String 唯一 node id + * */ + public static String processSwitch(String mode,String type) { + return mode + SPLIT_STRING + type; + } +} diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/ScensELSpringbootTest1.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/ScensELSpringbootTest1.java new file mode 100644 index 000000000..ca80bbfef --- /dev/null +++ b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/ScensELSpringbootTest1.java @@ -0,0 +1,44 @@ +package com.yomahub.liteflow.test.scenes; + +import com.yomahub.liteflow.core.FlowExecutor; +import com.yomahub.liteflow.flow.LiteflowResponse; +import com.yomahub.liteflow.test.BaseTest; +import com.yomahub.liteflow.test.scenes.bean.RequestDataDO; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.test.context.TestPropertySource; +import org.springframework.test.context.junit4.SpringRunner; + +import javax.annotation.Resource; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; + +/** + * springboot环境EL复杂例子测试1 + * @author nmnl + */ +@RunWith(SpringRunner.class) +@TestPropertySource(value = "classpath:/scens/application1.properties") +@SpringBootTest(classes = ScensELSpringbootTest1.class) +@EnableAutoConfiguration +@ComponentScan({"com.yomahub.liteflow.test.scenes.cmp1"}) +public class ScensELSpringbootTest1 extends BaseTest { + + @Resource + private FlowExecutor flowExecutor; + + + // 验证正常finally + /*@Test + public void testScens1_1() throws Exception{ + LocalDateTime x = LocalDateTime.of(LocalDate.now(), LocalTime.of(15,0,0)); + LiteflowResponse response = flowExecutor.execute2Resp("chaintask", RequestDataDO.of(x,"a")); + //Assert.assertTrue(response.isSuccess()); + Assert.assertEquals("ASwitchCmp==>FinallyCmp",response.getExecuteStepStr()); + }*/ +} diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/bean/MarketingDO.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/bean/MarketingDO.java new file mode 100644 index 000000000..1c8139c71 --- /dev/null +++ b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/bean/MarketingDO.java @@ -0,0 +1,157 @@ +package com.yomahub.liteflow.test.scenes.bean; + +import java.time.LocalDateTime; + +public class MarketingDO { + + /** id */ + private String id; + + /** 名称 */ + private String name; + + /** 类型(枚举) + * @see com.yomahub.liteflow.test.scenes.enums.MarketingTypeEnum + * */ + private String type; + + /** 模式(枚举) + * @see com.yomahub.liteflow.test.scenes.enums.MarketingModeEnum + * */ + private String mode; + + /** 开始时间 */ + private LocalDateTime startDatetime; + + /** 结束时间 */ + private LocalDateTime endDatetime; + + /** 限制总次数 */ + private Integer limitTotalNum; + + /** 限制每天次数 */ + private Integer limitDayNum; + + /** 参与区域(运营商) + * */ + private String joinInst; + + /** 用户模型json + * */ + private String userModel; + + /** 消息模版json + */ + private String msgTemplate; + + /** 奖励规则json + * */ + private String rewardRule; + + /** 描述 */ + private String remark; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getMode() { + return mode; + } + + public void setMode(String mode) { + this.mode = mode; + } + + public LocalDateTime getStartDatetime() { + return startDatetime; + } + + public void setStartDatetime(LocalDateTime startDatetime) { + this.startDatetime = startDatetime; + } + + public LocalDateTime getEndDatetime() { + return endDatetime; + } + + public void setEndDatetime(LocalDateTime endDatetime) { + this.endDatetime = endDatetime; + } + + public Integer getLimitTotalNum() { + return limitTotalNum; + } + + public void setLimitTotalNum(Integer limitTotalNum) { + this.limitTotalNum = limitTotalNum; + } + + public Integer getLimitDayNum() { + return limitDayNum; + } + + public void setLimitDayNum(Integer limitDayNum) { + this.limitDayNum = limitDayNum; + } + + public String getJoinInst() { + return joinInst; + } + + public void setJoinInst(String joinInst) { + this.joinInst = joinInst; + } + + public String getUserModel() { + return userModel; + } + + public void setUserModel(String userModel) { + this.userModel = userModel; + } + + public String getMsgTemplate() { + return msgTemplate; + } + + public void setMsgTemplate(String msgTemplate) { + this.msgTemplate = msgTemplate; + } + + public String getRewardRule() { + return rewardRule; + } + + public void setRewardRule(String rewardRule) { + this.rewardRule = rewardRule; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } +} diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/bean/RequestDataDO.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/bean/RequestDataDO.java new file mode 100644 index 000000000..8f4f96569 --- /dev/null +++ b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/bean/RequestDataDO.java @@ -0,0 +1,47 @@ +package com.yomahub.liteflow.test.scenes.bean; + +import java.time.LocalDateTime; +import java.util.Objects; + +/** + * springboot环境EL复杂例子测试1 + * 可以参与的营销 : 1条件:开始时间+区域. + * @author nmnl + */ +public class RequestDataDO { + // LocalDateTime.of(LocalDate.now(), LocalTime.of(15,0,0)); + private LocalDateTime localDateTime; + + private String instId; + + private RequestDataDO(LocalDateTime localDateTime, String instId) { + this.localDateTime = localDateTime; + this.instId = instId; + } + + private static RequestDataDO create(LocalDateTime localDateTime, String instId) { + return new RequestDataDO(localDateTime, instId); + } + + public static RequestDataDO of(LocalDateTime localDateTime, String instId) { + Objects.requireNonNull(localDateTime, "localDateTime"); + Objects.requireNonNull(instId, "instId"); + return create(localDateTime, instId); + } + + public LocalDateTime getLocalDateTime() { + return localDateTime; + } + + public void setLocalDateTime(LocalDateTime localDateTime) { + this.localDateTime = localDateTime; + } + + public String getInstId() { + return instId; + } + + public void setInstId(String instId) { + this.instId = instId; + } +} diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/cmp1/ASwitchChooseOneCmp.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/cmp1/ASwitchChooseOneCmp.java new file mode 100644 index 000000000..10b7d1d3e --- /dev/null +++ b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/cmp1/ASwitchChooseOneCmp.java @@ -0,0 +1,64 @@ +/** + *

Title: liteflow

+ *

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

+ * @author Bryan.Zhang + * @email weenyc31@163.com + * @Date 2020/4/1 + */ +package com.yomahub.liteflow.test.scenes.cmp1; + +import com.yomahub.liteflow.annotation.LiteflowComponent; +import com.yomahub.liteflow.core.NodeSwitchComponent; +import com.yomahub.liteflow.test.scenes.CmpUtil; +import com.yomahub.liteflow.test.scenes.bean.MarketingDO; +import com.yomahub.liteflow.test.scenes.bean.RequestDataDO; + +import java.util.HashMap; +import java.util.Map; + +/** + * springboot环境EL复杂例子测试1 + * 场景描述:可以参与的营销 ASwitchCmp + * 1条件:开始时间+区域. + * 2流程:根据营销信息(类型+模式)->筛选可参与营销(类型+模式) + * 3触发:THEN + * @author nmnl + */ +// @LiteflowComponent("ASwitchCmp") +// @Component("ASwitchCmp") +@LiteflowComponent("a") +public class ASwitchChooseOneCmp extends NodeSwitchComponent { + + // 简单数据结构 + // 虚拟:营销数据 + private final static Map CHOOSE_ONE = new HashMap<>(3); + + static { + MarketingDO a = new MarketingDO(); + CHOOSE_ONE.put("a",a); + + MarketingDO b = new MarketingDO(); + CHOOSE_ONE.put("b",b); + + MarketingDO c = new MarketingDO(); + CHOOSE_ONE.put("c",c); + } + + @Override + public String processSwitch() throws Exception { + RequestDataDO requestDataDO = this.getRequestData(); + if (null == requestDataDO){ + // requestDataDO 为空,无法做进一步的判断 + throw new Exception("requestDataDO 为空"); + } + // 1条件:营销开始时间+区域.. + MarketingDO chooseOne = CHOOSE_ONE.get(requestDataDO.getInstId()); + if (null == chooseOne){ + // 未命中活动 + throw new Exception("未命中营销"); + } + //this.getSlot().setResponseData(chooseOne); + return CmpUtil.processSwitch(chooseOne.getMode(),chooseOne.getType()); + + } +} diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/cmp1/BEventCmp.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/cmp1/BEventCmp.java new file mode 100644 index 000000000..53350edfb --- /dev/null +++ b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/cmp1/BEventCmp.java @@ -0,0 +1,22 @@ +/** + *

Title: liteflow

+ *

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

+ * @author Bryan.Zhang + * @email weenyc31@163.com + * @Date 2020/4/1 + */ +package com.yomahub.liteflow.test.scenes.cmp1; + +import com.yomahub.liteflow.annotation.LiteflowComponent; +import com.yomahub.liteflow.core.NodeComponent; + +@LiteflowComponent("BEventCmp") +public class BEventCmp extends NodeComponent { + + @Override + public void process() { + + System.out.println(" --- " + this.getRequestData().toString()); + } + +} diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/cmp1/BManualCmp.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/cmp1/BManualCmp.java new file mode 100644 index 000000000..4d93086e3 --- /dev/null +++ b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/cmp1/BManualCmp.java @@ -0,0 +1,21 @@ +/** + *

Title: liteflow

+ *

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

+ * @author Bryan.Zhang + * @email weenyc31@163.com + * @Date 2020/4/1 + */ +package com.yomahub.liteflow.test.scenes.cmp1; + +import com.yomahub.liteflow.annotation.LiteflowComponent; +import com.yomahub.liteflow.core.NodeComponent; + +@LiteflowComponent("BManualCmp") +public class BManualCmp extends NodeComponent { + + @Override + public void process() { + System.out.println("BManualCmp executed!"); + } + +} diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/cmp1/BTimingCmp.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/cmp1/BTimingCmp.java new file mode 100644 index 000000000..4da1e44f7 --- /dev/null +++ b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/cmp1/BTimingCmp.java @@ -0,0 +1,21 @@ +/** + *

Title: liteflow

+ *

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

+ * @author Bryan.Zhang + * @email weenyc31@163.com + * @Date 2020/4/1 + */ +package com.yomahub.liteflow.test.scenes.cmp1; + +import com.yomahub.liteflow.annotation.LiteflowComponent; +import com.yomahub.liteflow.core.NodeComponent; + +@LiteflowComponent("BTimingCmp") +public class BTimingCmp extends NodeComponent { + + @Override + public void process() { + System.out.println("BTimingCmp executed!"); + } + +} diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/cmp1/FinallyCmp.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/cmp1/FinallyCmp.java new file mode 100644 index 000000000..9da5cbf9e --- /dev/null +++ b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/cmp1/FinallyCmp.java @@ -0,0 +1,20 @@ +/** + *

Title: liteflow

+ *

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

+ * @author Bryan.Zhang + * @email weenyc31@163.com + * @Date 2020/4/1 + */ +package com.yomahub.liteflow.test.scenes.cmp1; + +import com.yomahub.liteflow.annotation.LiteflowComponent; +import com.yomahub.liteflow.core.NodeComponent; + +@LiteflowComponent("FinallyCmp") +public class FinallyCmp extends NodeComponent { + + @Override + public void process() { + System.out.println("FinallyCmp executed!"); + } +} diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/enums/DescEnum.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/enums/DescEnum.java new file mode 100644 index 000000000..f44ff146c --- /dev/null +++ b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/enums/DescEnum.java @@ -0,0 +1,11 @@ +package com.yomahub.liteflow.test.scenes.enums; + +/** + * 枚举类总接口 + * @author nmnl + */ +public interface DescEnum { + + /** 获取枚举desc属性 */ + String getDesc(); +} diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/enums/MarketingModeEnum.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/enums/MarketingModeEnum.java new file mode 100644 index 000000000..1aff197a2 --- /dev/null +++ b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/enums/MarketingModeEnum.java @@ -0,0 +1,26 @@ +package com.yomahub.liteflow.test.scenes.enums; + +/** + * 模式 + * @author mll + */ +public enum MarketingModeEnum implements DescEnum { + + EVENT("事件模式"), + + MANUAL("手动模式"), + + TIMING("定时模式"); + + private final String desc; + + @Override + public String getDesc() { + return desc; + } + + MarketingModeEnum(String desc) { + this.desc = desc; + } + +} diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/enums/MarketingTypeEnum.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/enums/MarketingTypeEnum.java new file mode 100644 index 000000000..7722c2041 --- /dev/null +++ b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/enums/MarketingTypeEnum.java @@ -0,0 +1,26 @@ +package com.yomahub.liteflow.test.scenes.enums; + +/** + * 类型 + * @author nmnl + */ +public enum MarketingTypeEnum implements DescEnum { + + PAY_DISCOUNT("支付折扣活动"), + + ISSUING_COUPONS("发卷活动"), + + MESSAGE_NOTIFICATION("消息通知活动"); + + private final String desc; + + @Override + public String getDesc() { + return desc; + } + + MarketingTypeEnum(String desc) { + this.desc = desc; + } + +} diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/scens/application1.properties b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/scens/application1.properties new file mode 100644 index 000000000..6841930a1 --- /dev/null +++ b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/scens/application1.properties @@ -0,0 +1 @@ +liteflow.rule-source=scens/flow1.el.xml \ No newline at end of file diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/scens/flow1.el.xml b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/scens/flow1.el.xml new file mode 100644 index 000000000..6896b47f3 --- /dev/null +++ b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/scens/flow1.el.xml @@ -0,0 +1,6 @@ + + + + SWITCH(a).to(BEventCmp,BManualCmp,BTimingCmp) + + \ No newline at end of file From 85207a5f635d0651bc6fc4489a29fc83862328ad Mon Sep 17 00:00:00 2001 From: mll Date: Fri, 8 Jul 2022 16:38:50 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E6=92=A4=E9=94=80:=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B:=E6=A8=A1=E6=8B=9F?= =?UTF-8?q?=E7=9C=9F=E5=AE=9E=E5=9C=BA=E6=99=AF1:=E7=AE=80=E5=8D=95?= =?UTF-8?q?=E8=90=A5=E9=94=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yomahub/liteflow/test/scenes/CmpUtil.java | 23 --- .../test/scenes/ScensELSpringbootTest1.java | 44 ----- .../test/scenes/bean/MarketingDO.java | 157 ------------------ .../test/scenes/bean/RequestDataDO.java | 47 ------ .../test/scenes/cmp1/ASwitchChooseOneCmp.java | 64 ------- .../liteflow/test/scenes/cmp1/BEventCmp.java | 22 --- .../liteflow/test/scenes/cmp1/BManualCmp.java | 21 --- .../liteflow/test/scenes/cmp1/BTimingCmp.java | 21 --- .../liteflow/test/scenes/cmp1/FinallyCmp.java | 20 --- .../liteflow/test/scenes/enums/DescEnum.java | 11 -- .../test/scenes/enums/MarketingModeEnum.java | 26 --- .../test/scenes/enums/MarketingTypeEnum.java | 26 --- .../resources/scens/application1.properties | 1 - .../src/test/resources/scens/flow1.el.xml | 6 - 14 files changed, 489 deletions(-) delete mode 100644 liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/CmpUtil.java delete mode 100644 liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/ScensELSpringbootTest1.java delete mode 100644 liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/bean/MarketingDO.java delete mode 100644 liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/bean/RequestDataDO.java delete mode 100644 liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/cmp1/ASwitchChooseOneCmp.java delete mode 100644 liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/cmp1/BEventCmp.java delete mode 100644 liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/cmp1/BManualCmp.java delete mode 100644 liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/cmp1/BTimingCmp.java delete mode 100644 liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/cmp1/FinallyCmp.java delete mode 100644 liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/enums/DescEnum.java delete mode 100644 liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/enums/MarketingModeEnum.java delete mode 100644 liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/enums/MarketingTypeEnum.java delete mode 100644 liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/scens/application1.properties delete mode 100644 liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/scens/flow1.el.xml diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/CmpUtil.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/CmpUtil.java deleted file mode 100644 index c737cf8f8..000000000 --- a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/CmpUtil.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.yomahub.liteflow.test.scenes; - -/** - *

公共方法类

- *

node Component util

- */ -public class CmpUtil { - - private static final String SPLIT_STRING = "_"; - - public CmpUtil() {} - - - /** - * 得到:唯一nodeId - * @param mode 模式(枚举) - * @param type 类型(枚举) - * @return String 唯一 node id - * */ - public static String processSwitch(String mode,String type) { - return mode + SPLIT_STRING + type; - } -} diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/ScensELSpringbootTest1.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/ScensELSpringbootTest1.java deleted file mode 100644 index ca80bbfef..000000000 --- a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/ScensELSpringbootTest1.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.yomahub.liteflow.test.scenes; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.test.BaseTest; -import com.yomahub.liteflow.test.scenes.bean.RequestDataDO; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.time.LocalTime; - -/** - * springboot环境EL复杂例子测试1 - * @author nmnl - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/scens/application1.properties") -@SpringBootTest(classes = ScensELSpringbootTest1.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.scenes.cmp1"}) -public class ScensELSpringbootTest1 extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - - // 验证正常finally - /*@Test - public void testScens1_1() throws Exception{ - LocalDateTime x = LocalDateTime.of(LocalDate.now(), LocalTime.of(15,0,0)); - LiteflowResponse response = flowExecutor.execute2Resp("chaintask", RequestDataDO.of(x,"a")); - //Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("ASwitchCmp==>FinallyCmp",response.getExecuteStepStr()); - }*/ -} diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/bean/MarketingDO.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/bean/MarketingDO.java deleted file mode 100644 index 1c8139c71..000000000 --- a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/bean/MarketingDO.java +++ /dev/null @@ -1,157 +0,0 @@ -package com.yomahub.liteflow.test.scenes.bean; - -import java.time.LocalDateTime; - -public class MarketingDO { - - /** id */ - private String id; - - /** 名称 */ - private String name; - - /** 类型(枚举) - * @see com.yomahub.liteflow.test.scenes.enums.MarketingTypeEnum - * */ - private String type; - - /** 模式(枚举) - * @see com.yomahub.liteflow.test.scenes.enums.MarketingModeEnum - * */ - private String mode; - - /** 开始时间 */ - private LocalDateTime startDatetime; - - /** 结束时间 */ - private LocalDateTime endDatetime; - - /** 限制总次数 */ - private Integer limitTotalNum; - - /** 限制每天次数 */ - private Integer limitDayNum; - - /** 参与区域(运营商) - * */ - private String joinInst; - - /** 用户模型json - * */ - private String userModel; - - /** 消息模版json - */ - private String msgTemplate; - - /** 奖励规则json - * */ - private String rewardRule; - - /** 描述 */ - private String remark; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getMode() { - return mode; - } - - public void setMode(String mode) { - this.mode = mode; - } - - public LocalDateTime getStartDatetime() { - return startDatetime; - } - - public void setStartDatetime(LocalDateTime startDatetime) { - this.startDatetime = startDatetime; - } - - public LocalDateTime getEndDatetime() { - return endDatetime; - } - - public void setEndDatetime(LocalDateTime endDatetime) { - this.endDatetime = endDatetime; - } - - public Integer getLimitTotalNum() { - return limitTotalNum; - } - - public void setLimitTotalNum(Integer limitTotalNum) { - this.limitTotalNum = limitTotalNum; - } - - public Integer getLimitDayNum() { - return limitDayNum; - } - - public void setLimitDayNum(Integer limitDayNum) { - this.limitDayNum = limitDayNum; - } - - public String getJoinInst() { - return joinInst; - } - - public void setJoinInst(String joinInst) { - this.joinInst = joinInst; - } - - public String getUserModel() { - return userModel; - } - - public void setUserModel(String userModel) { - this.userModel = userModel; - } - - public String getMsgTemplate() { - return msgTemplate; - } - - public void setMsgTemplate(String msgTemplate) { - this.msgTemplate = msgTemplate; - } - - public String getRewardRule() { - return rewardRule; - } - - public void setRewardRule(String rewardRule) { - this.rewardRule = rewardRule; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } -} diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/bean/RequestDataDO.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/bean/RequestDataDO.java deleted file mode 100644 index 8f4f96569..000000000 --- a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/bean/RequestDataDO.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.yomahub.liteflow.test.scenes.bean; - -import java.time.LocalDateTime; -import java.util.Objects; - -/** - * springboot环境EL复杂例子测试1 - * 可以参与的营销 : 1条件:开始时间+区域. - * @author nmnl - */ -public class RequestDataDO { - // LocalDateTime.of(LocalDate.now(), LocalTime.of(15,0,0)); - private LocalDateTime localDateTime; - - private String instId; - - private RequestDataDO(LocalDateTime localDateTime, String instId) { - this.localDateTime = localDateTime; - this.instId = instId; - } - - private static RequestDataDO create(LocalDateTime localDateTime, String instId) { - return new RequestDataDO(localDateTime, instId); - } - - public static RequestDataDO of(LocalDateTime localDateTime, String instId) { - Objects.requireNonNull(localDateTime, "localDateTime"); - Objects.requireNonNull(instId, "instId"); - return create(localDateTime, instId); - } - - public LocalDateTime getLocalDateTime() { - return localDateTime; - } - - public void setLocalDateTime(LocalDateTime localDateTime) { - this.localDateTime = localDateTime; - } - - public String getInstId() { - return instId; - } - - public void setInstId(String instId) { - this.instId = instId; - } -} diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/cmp1/ASwitchChooseOneCmp.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/cmp1/ASwitchChooseOneCmp.java deleted file mode 100644 index 10b7d1d3e..000000000 --- a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/cmp1/ASwitchChooseOneCmp.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.scenes.cmp1; - -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.core.NodeSwitchComponent; -import com.yomahub.liteflow.test.scenes.CmpUtil; -import com.yomahub.liteflow.test.scenes.bean.MarketingDO; -import com.yomahub.liteflow.test.scenes.bean.RequestDataDO; - -import java.util.HashMap; -import java.util.Map; - -/** - * springboot环境EL复杂例子测试1 - * 场景描述:可以参与的营销 ASwitchCmp - * 1条件:开始时间+区域. - * 2流程:根据营销信息(类型+模式)->筛选可参与营销(类型+模式) - * 3触发:THEN - * @author nmnl - */ -// @LiteflowComponent("ASwitchCmp") -// @Component("ASwitchCmp") -@LiteflowComponent("a") -public class ASwitchChooseOneCmp extends NodeSwitchComponent { - - // 简单数据结构 - // 虚拟:营销数据 - private final static Map CHOOSE_ONE = new HashMap<>(3); - - static { - MarketingDO a = new MarketingDO(); - CHOOSE_ONE.put("a",a); - - MarketingDO b = new MarketingDO(); - CHOOSE_ONE.put("b",b); - - MarketingDO c = new MarketingDO(); - CHOOSE_ONE.put("c",c); - } - - @Override - public String processSwitch() throws Exception { - RequestDataDO requestDataDO = this.getRequestData(); - if (null == requestDataDO){ - // requestDataDO 为空,无法做进一步的判断 - throw new Exception("requestDataDO 为空"); - } - // 1条件:营销开始时间+区域.. - MarketingDO chooseOne = CHOOSE_ONE.get(requestDataDO.getInstId()); - if (null == chooseOne){ - // 未命中活动 - throw new Exception("未命中营销"); - } - //this.getSlot().setResponseData(chooseOne); - return CmpUtil.processSwitch(chooseOne.getMode(),chooseOne.getType()); - - } -} diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/cmp1/BEventCmp.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/cmp1/BEventCmp.java deleted file mode 100644 index 53350edfb..000000000 --- a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/cmp1/BEventCmp.java +++ /dev/null @@ -1,22 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.scenes.cmp1; - -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.core.NodeComponent; - -@LiteflowComponent("BEventCmp") -public class BEventCmp extends NodeComponent { - - @Override - public void process() { - - System.out.println(" --- " + this.getRequestData().toString()); - } - -} diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/cmp1/BManualCmp.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/cmp1/BManualCmp.java deleted file mode 100644 index 4d93086e3..000000000 --- a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/cmp1/BManualCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.scenes.cmp1; - -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.core.NodeComponent; - -@LiteflowComponent("BManualCmp") -public class BManualCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BManualCmp executed!"); - } - -} diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/cmp1/BTimingCmp.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/cmp1/BTimingCmp.java deleted file mode 100644 index 4da1e44f7..000000000 --- a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/cmp1/BTimingCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.scenes.cmp1; - -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.core.NodeComponent; - -@LiteflowComponent("BTimingCmp") -public class BTimingCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BTimingCmp executed!"); - } - -} diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/cmp1/FinallyCmp.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/cmp1/FinallyCmp.java deleted file mode 100644 index 9da5cbf9e..000000000 --- a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/cmp1/FinallyCmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.scenes.cmp1; - -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.core.NodeComponent; - -@LiteflowComponent("FinallyCmp") -public class FinallyCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("FinallyCmp executed!"); - } -} diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/enums/DescEnum.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/enums/DescEnum.java deleted file mode 100644 index f44ff146c..000000000 --- a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/enums/DescEnum.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.yomahub.liteflow.test.scenes.enums; - -/** - * 枚举类总接口 - * @author nmnl - */ -public interface DescEnum { - - /** 获取枚举desc属性 */ - String getDesc(); -} diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/enums/MarketingModeEnum.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/enums/MarketingModeEnum.java deleted file mode 100644 index 1aff197a2..000000000 --- a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/enums/MarketingModeEnum.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.yomahub.liteflow.test.scenes.enums; - -/** - * 模式 - * @author mll - */ -public enum MarketingModeEnum implements DescEnum { - - EVENT("事件模式"), - - MANUAL("手动模式"), - - TIMING("定时模式"); - - private final String desc; - - @Override - public String getDesc() { - return desc; - } - - MarketingModeEnum(String desc) { - this.desc = desc; - } - -} diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/enums/MarketingTypeEnum.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/enums/MarketingTypeEnum.java deleted file mode 100644 index 7722c2041..000000000 --- a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/scenes/enums/MarketingTypeEnum.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.yomahub.liteflow.test.scenes.enums; - -/** - * 类型 - * @author nmnl - */ -public enum MarketingTypeEnum implements DescEnum { - - PAY_DISCOUNT("支付折扣活动"), - - ISSUING_COUPONS("发卷活动"), - - MESSAGE_NOTIFICATION("消息通知活动"); - - private final String desc; - - @Override - public String getDesc() { - return desc; - } - - MarketingTypeEnum(String desc) { - this.desc = desc; - } - -} diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/scens/application1.properties b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/scens/application1.properties deleted file mode 100644 index 6841930a1..000000000 --- a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/scens/application1.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=scens/flow1.el.xml \ No newline at end of file diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/scens/flow1.el.xml b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/scens/flow1.el.xml deleted file mode 100644 index 6896b47f3..000000000 --- a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/scens/flow1.el.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - SWITCH(a).to(BEventCmp,BManualCmp,BTimingCmp) - - \ No newline at end of file From 8cab5654b6d002da4d4799ba5f154d939b9f760e Mon Sep 17 00:00:00 2001 From: mll Date: Tue, 12 Jul 2022 18:11:44 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E7=94=A8=E4=BE=8B:switch=20to=E5=8D=95=E4=B8=AAnode=E6=97=B6?= =?UTF-8?q?=E5=87=BA=E9=94=99:=20(2022-07-12=20switch=20=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E9=94=99=E8=AF=AF.c.y.l.builder.el.operator.ToOperator=20=20?= =?UTF-8?q?=20=20=20:=20parameter=20error;=20run=20QlExpress=20Exception?= =?UTF-8?q?=20at=20line=201)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../test/base/BaseELSpringbootTest.java | 8 ++++ .../test/base/BaseELSpringbootTest2.java | 38 +++++++++++++++++++ .../src/test/resources/base/flow.el.xml | 7 ++++ 3 files changed, 53 insertions(+) create mode 100644 liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/base/BaseELSpringbootTest2.java diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/base/BaseELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/base/BaseELSpringbootTest.java index 894c1a630..ff899db21 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/base/BaseELSpringbootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/base/BaseELSpringbootTest.java @@ -62,4 +62,12 @@ public class BaseELSpringbootTest extends BaseTest { LiteflowResponse response = flowExecutor.execute2Resp("chain5", "arg"); Assert.assertTrue(response.isSuccess()); } + + //2022-07-12 switch 异常错误.c.y.l.builder.el.operator.ToOperator : parameter error + //run QlExpress Exception at line 1 : + @Test + public void testBaseSwitch2() throws Exception{ + LiteflowResponse response = flowExecutor.execute2Resp("testBaseSwitch2", "arg"); + Assert.assertTrue(response.isSuccess()); + } } diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/base/BaseELSpringbootTest2.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/base/BaseELSpringbootTest2.java new file mode 100644 index 000000000..d905fe055 --- /dev/null +++ b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/base/BaseELSpringbootTest2.java @@ -0,0 +1,38 @@ +package com.yomahub.liteflow.test.base; + +import com.yomahub.liteflow.core.FlowExecutor; +import com.yomahub.liteflow.flow.LiteflowResponse; +import com.yomahub.liteflow.test.BaseTest; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.test.context.TestPropertySource; +import org.springframework.test.context.junit4.SpringRunner; + +import javax.annotation.Resource; + +/** + * springboot环境EL常规的例子测试 + * @author Bryan.Zhang + */ +@RunWith(SpringRunner.class) +@TestPropertySource(value = "classpath:/base/application.properties") +@SpringBootTest(classes = BaseELSpringbootTest2.class) +@EnableAutoConfiguration +@ComponentScan({"com.yomahub.liteflow.test.base.cmp"}) +public class BaseELSpringbootTest2 extends BaseTest { + + @Resource + private FlowExecutor flowExecutor; + + //最简单的情况 + //2022-07-12 SWITCH 异常错误.[com.yomahub.liteflow.builder.el.operator.ToOperator.executeInner(45)] : The parameter must be Executable item! + @Test + public void testBase1() throws Exception{ + LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); + Assert.assertTrue(response.isSuccess()); + } +} diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/base/flow.el.xml b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/base/flow.el.xml index 578b8468a..c14d25dde 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/base/flow.el.xml +++ b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/base/flow.el.xml @@ -50,4 +50,11 @@ z ); + + + THEN( + z, + SWITCH(e).to(d) + ); + \ No newline at end of file From 86dbd8d3c2778e423d05fc503e611913244e2fb8 Mon Sep 17 00:00:00 2001 From: mll Date: Tue, 12 Jul 2022 18:15:11 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E7=94=A8=E4=BE=8B:switch=20to=E5=8D=95=E4=B8=AAnode=E6=97=B6?= =?UTF-8?q?=E5=87=BA=E9=94=99:=E5=88=A0=E9=99=A4=E5=A4=9A=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../test/base/BaseELSpringbootTest2.java | 38 ------------------- 1 file changed, 38 deletions(-) delete mode 100644 liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/base/BaseELSpringbootTest2.java diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/base/BaseELSpringbootTest2.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/base/BaseELSpringbootTest2.java deleted file mode 100644 index d905fe055..000000000 --- a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/base/BaseELSpringbootTest2.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.yomahub.liteflow.test.base; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * springboot环境EL常规的例子测试 - * @author Bryan.Zhang - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/base/application.properties") -@SpringBootTest(classes = BaseELSpringbootTest2.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.base.cmp"}) -public class BaseELSpringbootTest2 extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //最简单的情况 - //2022-07-12 SWITCH 异常错误.[com.yomahub.liteflow.builder.el.operator.ToOperator.executeInner(45)] : The parameter must be Executable item! - @Test - public void testBase1() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - } -} From 26af9f80e89061317c57f90c381700ffe92e84d1 Mon Sep 17 00:00:00 2001 From: mll Date: Wed, 13 Jul 2022 10:08:22 +0800 Subject: [PATCH 5/5] =?UTF-8?q?1.=E6=96=B0=E5=A2=9E=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E7=94=A8=E4=BE=8B:switch=20to=E5=8D=95=E4=B8=AAnode=E6=97=B6?= =?UTF-8?q?=E5=87=BA=E9=94=99:=E5=88=A0=E9=99=A4=E5=A4=9A=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E7=B1=BB=202.=E5=88=A0=E9=99=A4EL=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E7=94=A8=E4=BE=8B=E4=B8=8BBaseTest=E5=B7=B2=E7=BB=8F=E5=BC=95?= =?UTF-8?q?=E5=85=A5=E7=9A=84IdGeneratorHolder?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yomahub/liteflow/test/BaseTest.java | 1 - .../com/yomahub/liteflow/test/BaseTest.java | 1 - .../com/yomahub/liteflow/test/BaseTest.java | 1 - .../com/yomahub/liteflow/test/BaseTest.java | 1 - .../com/yomahub/liteflow/test/BaseTest.java | 1 - .../test/base/BaseELSpringbootTest.java | 8 ---- .../switchError/SwitchELSpringbootTest.java | 39 +++++++++++++++++++ .../liteflow/test/switchError/cmp/ACmp.java | 20 ++++++++++ .../liteflow/test/switchError/cmp/BCmp.java | 21 ++++++++++ .../liteflow/test/switchError/cmp/CCmp.java | 21 ++++++++++ .../liteflow/test/switchError/cmp/DCmp.java | 21 ++++++++++ .../test/switchError/cmp/ESwitchCmp.java | 20 ++++++++++ .../src/test/resources/base/flow.el.xml | 7 ---- .../switchError/application.properties | 1 + .../test/resources/switchError/flow.el.xml | 10 +++++ .../com/yomahub/liteflow/test/BaseTest.java | 1 - 16 files changed, 153 insertions(+), 21 deletions(-) create mode 100644 liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/switchError/SwitchELSpringbootTest.java create mode 100644 liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/switchError/cmp/ACmp.java create mode 100644 liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/switchError/cmp/BCmp.java create mode 100644 liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/switchError/cmp/CCmp.java create mode 100644 liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/switchError/cmp/DCmp.java create mode 100644 liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/switchError/cmp/ESwitchCmp.java create mode 100644 liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/switchError/application.properties create mode 100644 liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/switchError/flow.el.xml diff --git a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/BaseTest.java b/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/BaseTest.java index 9f5684c5a..3a79ad7b0 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/BaseTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/BaseTest.java @@ -1,7 +1,6 @@ package com.yomahub.liteflow.test; import com.yomahub.liteflow.flow.FlowBus; -import com.yomahub.liteflow.flow.id.IdGeneratorHolder; import com.yomahub.liteflow.property.LiteflowConfigGetter; import com.yomahub.liteflow.spi.holder.SpiFactoryCleaner; import com.yomahub.liteflow.spring.ComponentScanner; diff --git a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/BaseTest.java b/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/BaseTest.java index 406a91d4c..2dc0c9b8e 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/BaseTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/BaseTest.java @@ -2,7 +2,6 @@ package com.yomahub.liteflow.test; import com.yomahub.liteflow.core.FlowExecutorHolder; import com.yomahub.liteflow.flow.FlowBus; -import com.yomahub.liteflow.flow.id.IdGeneratorHolder; import com.yomahub.liteflow.property.LiteflowConfigGetter; import com.yomahub.liteflow.spi.holder.SpiFactoryCleaner; import com.yomahub.liteflow.thread.ExecutorHelper; diff --git a/liteflow-testcase-el/liteflow-testcase-el-script-groovy-springboot/src/test/java/com/yomahub/liteflow/test/BaseTest.java b/liteflow-testcase-el/liteflow-testcase-el-script-groovy-springboot/src/test/java/com/yomahub/liteflow/test/BaseTest.java index 0924ff42c..64886670f 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-script-groovy-springboot/src/test/java/com/yomahub/liteflow/test/BaseTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-script-groovy-springboot/src/test/java/com/yomahub/liteflow/test/BaseTest.java @@ -1,7 +1,6 @@ package com.yomahub.liteflow.test; import com.yomahub.liteflow.flow.FlowBus; -import com.yomahub.liteflow.flow.id.IdGeneratorHolder; import com.yomahub.liteflow.property.LiteflowConfigGetter; import com.yomahub.liteflow.spi.holder.SpiFactoryCleaner; import com.yomahub.liteflow.spring.ComponentScanner; diff --git a/liteflow-testcase-el/liteflow-testcase-el-script-qlexpress-springboot/src/test/java/com/yomahub/liteflow/test/BaseTest.java b/liteflow-testcase-el/liteflow-testcase-el-script-qlexpress-springboot/src/test/java/com/yomahub/liteflow/test/BaseTest.java index 0924ff42c..64886670f 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-script-qlexpress-springboot/src/test/java/com/yomahub/liteflow/test/BaseTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-script-qlexpress-springboot/src/test/java/com/yomahub/liteflow/test/BaseTest.java @@ -1,7 +1,6 @@ package com.yomahub.liteflow.test; import com.yomahub.liteflow.flow.FlowBus; -import com.yomahub.liteflow.flow.id.IdGeneratorHolder; import com.yomahub.liteflow.property.LiteflowConfigGetter; import com.yomahub.liteflow.spi.holder.SpiFactoryCleaner; import com.yomahub.liteflow.spring.ComponentScanner; diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/BaseTest.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/BaseTest.java index 0924ff42c..64886670f 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/BaseTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/BaseTest.java @@ -1,7 +1,6 @@ package com.yomahub.liteflow.test; import com.yomahub.liteflow.flow.FlowBus; -import com.yomahub.liteflow.flow.id.IdGeneratorHolder; import com.yomahub.liteflow.property.LiteflowConfigGetter; import com.yomahub.liteflow.spi.holder.SpiFactoryCleaner; import com.yomahub.liteflow.spring.ComponentScanner; diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/base/BaseELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/base/BaseELSpringbootTest.java index ff899db21..894c1a630 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/base/BaseELSpringbootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/base/BaseELSpringbootTest.java @@ -62,12 +62,4 @@ public class BaseELSpringbootTest extends BaseTest { LiteflowResponse response = flowExecutor.execute2Resp("chain5", "arg"); Assert.assertTrue(response.isSuccess()); } - - //2022-07-12 switch 异常错误.c.y.l.builder.el.operator.ToOperator : parameter error - //run QlExpress Exception at line 1 : - @Test - public void testBaseSwitch2() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("testBaseSwitch2", "arg"); - Assert.assertTrue(response.isSuccess()); - } } diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/switchError/SwitchELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/switchError/SwitchELSpringbootTest.java new file mode 100644 index 000000000..2dac75425 --- /dev/null +++ b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/switchError/SwitchELSpringbootTest.java @@ -0,0 +1,39 @@ +package com.yomahub.liteflow.test.switchError; + +import com.yomahub.liteflow.core.FlowExecutor; +import com.yomahub.liteflow.flow.LiteflowResponse; +import com.yomahub.liteflow.test.BaseTest; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.test.context.TestPropertySource; +import org.springframework.test.context.junit4.SpringRunner; + +import javax.annotation.Resource; + +/** + * springboot环境EL常规的例子测试 + * @author Bryan.Zhang + */ +@RunWith(SpringRunner.class) +@TestPropertySource(value = "classpath:/switchError/application.properties") +@SpringBootTest(classes = SwitchELSpringbootTest.class) +@EnableAutoConfiguration +@ComponentScan({"com.yomahub.liteflow.test.switchError.cmp"}) +public class SwitchELSpringbootTest extends BaseTest { + + @Resource + private FlowExecutor flowExecutor; + + //2022-07-12 switch 异常错误.c.y.l.builder.el.operator.ToOperator : parameter error + //run QlExpress Exception at line 1 : + // switch().to(): 只有一个node时出错 + @Test + public void testBase1() throws Exception{ + LiteflowResponse response = flowExecutor.execute2Resp("testBase1", "arg"); + Assert.assertTrue(response.isSuccess()); + } +} diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/switchError/cmp/ACmp.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/switchError/cmp/ACmp.java new file mode 100644 index 000000000..721f398aa --- /dev/null +++ b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/switchError/cmp/ACmp.java @@ -0,0 +1,20 @@ +/** + *

Title: liteflow

+ *

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

+ * @author Bryan.Zhang + * @email weenyc31@163.com + * @Date 2020/4/1 + */ +package com.yomahub.liteflow.test.switchError.cmp; + +import com.yomahub.liteflow.annotation.LiteflowComponent; +import com.yomahub.liteflow.core.NodeComponent; + +@LiteflowComponent("a") +public class ACmp extends NodeComponent { + + @Override + public void process() { + System.out.println("ACmp executed!"); + } +} diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/switchError/cmp/BCmp.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/switchError/cmp/BCmp.java new file mode 100644 index 000000000..1cf73df35 --- /dev/null +++ b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/switchError/cmp/BCmp.java @@ -0,0 +1,21 @@ +/** + *

Title: liteflow

+ *

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

+ * @author Bryan.Zhang + * @email weenyc31@163.com + * @Date 2020/4/1 + */ +package com.yomahub.liteflow.test.switchError.cmp; + +import com.yomahub.liteflow.annotation.LiteflowComponent; +import com.yomahub.liteflow.core.NodeComponent; + +@LiteflowComponent("b") +public class BCmp extends NodeComponent { + + @Override + public void process() { + System.out.println("BCmp executed!"); + } + +} diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/switchError/cmp/CCmp.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/switchError/cmp/CCmp.java new file mode 100644 index 000000000..1523e77c4 --- /dev/null +++ b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/switchError/cmp/CCmp.java @@ -0,0 +1,21 @@ +/** + *

Title: liteflow

+ *

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

+ * @author Bryan.Zhang + * @email weenyc31@163.com + * @Date 2020/4/1 + */ +package com.yomahub.liteflow.test.switchError.cmp; + +import com.yomahub.liteflow.annotation.LiteflowComponent; +import com.yomahub.liteflow.core.NodeComponent; + +@LiteflowComponent("c") +public class CCmp extends NodeComponent { + + @Override + public void process() { + System.out.println("CCmp executed!"); + } + +} diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/switchError/cmp/DCmp.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/switchError/cmp/DCmp.java new file mode 100644 index 000000000..0ea34fb48 --- /dev/null +++ b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/switchError/cmp/DCmp.java @@ -0,0 +1,21 @@ +/** + *

Title: liteflow

+ *

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

+ * @author Bryan.Zhang + * @email weenyc31@163.com + * @Date 2020/4/1 + */ +package com.yomahub.liteflow.test.switchError.cmp; + +import com.yomahub.liteflow.annotation.LiteflowComponent; +import com.yomahub.liteflow.core.NodeComponent; + +@LiteflowComponent("d") +public class DCmp extends NodeComponent { + + @Override + public void process() { + System.out.println("DCmp executed!"); + } + +} diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/switchError/cmp/ESwitchCmp.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/switchError/cmp/ESwitchCmp.java new file mode 100644 index 000000000..bbbeb4cde --- /dev/null +++ b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/switchError/cmp/ESwitchCmp.java @@ -0,0 +1,20 @@ +/** + *

Title: liteflow

+ *

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

+ * @author Bryan.Zhang + * @email weenyc31@163.com + * @Date 2020/4/1 + */ +package com.yomahub.liteflow.test.switchError.cmp; + +import com.yomahub.liteflow.core.NodeSwitchComponent; +import org.springframework.stereotype.Component; + +@Component("e") +public class ESwitchCmp extends NodeSwitchComponent { + + @Override + public String processSwitch() throws Exception { + return "d"; + } +} diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/base/flow.el.xml b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/base/flow.el.xml index c14d25dde..578b8468a 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/base/flow.el.xml +++ b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/base/flow.el.xml @@ -50,11 +50,4 @@ z ); - - - THEN( - z, - SWITCH(e).to(d) - ); - \ No newline at end of file diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/switchError/application.properties b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/switchError/application.properties new file mode 100644 index 000000000..bc60f8a63 --- /dev/null +++ b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/switchError/application.properties @@ -0,0 +1 @@ +liteflow.rule-source=switchError/flow.el.xml \ No newline at end of file diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/switchError/flow.el.xml b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/switchError/flow.el.xml new file mode 100644 index 000000000..1f580a368 --- /dev/null +++ b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/switchError/flow.el.xml @@ -0,0 +1,10 @@ + + + + THEN( + a, + SWITCH(e).to(d) + b + ); + + \ No newline at end of file diff --git a/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/BaseTest.java b/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/BaseTest.java index 0924ff42c..64886670f 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/BaseTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/BaseTest.java @@ -1,7 +1,6 @@ package com.yomahub.liteflow.test; import com.yomahub.liteflow.flow.FlowBus; -import com.yomahub.liteflow.flow.id.IdGeneratorHolder; import com.yomahub.liteflow.property.LiteflowConfigGetter; import com.yomahub.liteflow.spi.holder.SpiFactoryCleaner; import com.yomahub.liteflow.spring.ComponentScanner;