diff --git a/README.md b/README.md index 4aed29154..31d5086b9 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,10 @@ Discord Link: [https://discord.gg/MpdBSBnFTu](https://discord.gg/MpdBSBnFTu) +**驰骋工作流引擎** + + + **WECHAT OFFICIAL ACCOUNT** Since the community group is over 200 people, you need to be invited to join the group. Follow the WECHAT OFFICIAL ACCOUNT and click `Personal WeChat` to add me, I can invite you into the group diff --git a/README.zh-CN.md b/README.zh-CN.md index 3d66145cb..66de111d2 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -67,6 +67,10 @@ LiteFlow期待你的了解! +**驰骋工作流引擎** + + + **微信公众号** 社区群需要邀请入群。关注公众号后点击`个人微信`加我,我可以拉你入群 diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/LiteFlowChainELBuilder.java b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/LiteFlowChainELBuilder.java index 3b939e0fa..0f1a65ad7 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/LiteFlowChainELBuilder.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/LiteFlowChainELBuilder.java @@ -198,7 +198,8 @@ public class LiteFlowChainELBuilder { public void build() { this.chain.setConditionList(this.conditionList); - checkBuild(); + //暂且去掉循环依赖检测,因为有发现循环依赖检测在对大的EL进行检测的时候,会导致CPU飙升,也或许是jackson低版本的问题 + //checkBuild(); FlowBus.addChain(this.chain); } diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/AndOperator.java b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/AndOperator.java index 73b68f6f4..29d663cbe 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/AndOperator.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/AndOperator.java @@ -16,13 +16,13 @@ import com.yomahub.liteflow.flow.element.condition.BooleanConditionTypeEnum; public class AndOperator extends BaseOperator { @Override public AndOrCondition build(Object[] objects) throws Exception { - OperatorHelper.checkObjectSizeGtTwo(objects); + OperatorHelper.checkObjectSizeGteTwo(objects); AndOrCondition andOrCondition = new AndOrCondition(); andOrCondition.setBooleanConditionType(BooleanConditionTypeEnum.AND); for (Object object : objects){ - OperatorHelper.checkObjectMustBeBooleanItem(object); + OperatorHelper.checkObjMustBeBooleanTypeItem(object); Executable item = OperatorHelper.convert(object, Executable.class); andOrCondition.addItem(item); diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/BreakOperator.java b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/BreakOperator.java index f89a7c332..43a76d114 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/BreakOperator.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/BreakOperator.java @@ -1,12 +1,8 @@ package com.yomahub.liteflow.builder.el.operator; -import cn.hutool.core.collection.ListUtil; -import com.ql.util.express.exception.QLException; import com.yomahub.liteflow.builder.el.operator.base.BaseOperator; import com.yomahub.liteflow.builder.el.operator.base.OperatorHelper; -import com.yomahub.liteflow.enums.NodeTypeEnum; import com.yomahub.liteflow.flow.element.Executable; -import com.yomahub.liteflow.flow.element.Node; import com.yomahub.liteflow.flow.element.condition.LoopCondition; /** @@ -26,8 +22,8 @@ public class BreakOperator extends BaseOperator { LoopCondition condition = OperatorHelper.convert(objects[0], LoopCondition.class, errorMsg); // 获得需要执行的可执行表达式 + OperatorHelper.checkObjMustBeBooleanTypeItem(objects[1]); Executable breakItem = OperatorHelper.convert(objects[1], Executable.class); - OperatorHelper.checkObjectMustBeBooleanItem(breakItem); condition.setBreakItem(breakItem); return condition; } diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/CatchOperator.java b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/CatchOperator.java index 362b484d7..4c19f3809 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/CatchOperator.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/CatchOperator.java @@ -19,6 +19,8 @@ public class CatchOperator extends BaseOperator { public CatchCondition build(Object[] objects) throws Exception { OperatorHelper.checkObjectSizeEq(objects, 1); + OperatorHelper.checkObjMustBeCommonTypeItem(objects[0]); + Executable catchItem = OperatorHelper.convert(objects[0], Executable.class); CatchCondition catchCondition = new CatchCondition(); diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/DefaultOperator.java b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/DefaultOperator.java index 876475c21..d3ef55c4b 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/DefaultOperator.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/DefaultOperator.java @@ -17,9 +17,13 @@ public class DefaultOperator extends BaseOperator { public SwitchCondition build(Object[] objects) throws Exception { OperatorHelper.checkObjectSizeEqTwo(objects); - SwitchCondition switchCondition = OperatorHelper.convert(objects[0], SwitchCondition.class); + String errorMsg = "The caller must be SwitchCondition item"; + SwitchCondition switchCondition = OperatorHelper.convert(objects[0], SwitchCondition.class, errorMsg); + + OperatorHelper.checkObjMustBeCommonTypeItem(objects[1]); Executable target = OperatorHelper.convert(objects[1], Executable.class); + switchCondition.setDefaultExecutor(target); return switchCondition; diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/DoOperator.java b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/DoOperator.java index edc4c2380..c6b3a5f4a 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/DoOperator.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/DoOperator.java @@ -24,6 +24,7 @@ public class DoOperator extends BaseOperator { String errorMsg = "The caller must be CatchCondition item"; CatchCondition condition = OperatorHelper.convert(objects[0], CatchCondition.class, errorMsg); // 获得需要执行的可执行表达式 + OperatorHelper.checkObjMustBeCommonTypeItem(objects[1]); Executable doExecutableItem = OperatorHelper.convert(objects[1], Executable.class); condition.setDoItem(doExecutableItem); return condition; @@ -33,6 +34,7 @@ public class DoOperator extends BaseOperator { // DO关键字有可能用在FOR后面,也有可能用于WHILE后面,所以这里要进行判断是不是这两种类型的超类LoopCondition LoopCondition condition = OperatorHelper.convert(objects[0], LoopCondition.class, errorMsg); // 获得需要执行的可执行表达式 + OperatorHelper.checkObjMustBeCommonTypeItem(objects[1]); Executable doExecutableItem = OperatorHelper.convert(objects[1], Executable.class); condition.setDoExecutor(doExecutableItem); return condition; diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/ElifOperator.java b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/ElifOperator.java index 06ba9ea6d..e29e9f4d4 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/ElifOperator.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/ElifOperator.java @@ -1,12 +1,8 @@ package com.yomahub.liteflow.builder.el.operator; -import cn.hutool.core.collection.ListUtil; -import com.ql.util.express.exception.QLException; import com.yomahub.liteflow.builder.el.operator.base.BaseOperator; import com.yomahub.liteflow.builder.el.operator.base.OperatorHelper; -import com.yomahub.liteflow.enums.NodeTypeEnum; import com.yomahub.liteflow.flow.element.Executable; -import com.yomahub.liteflow.flow.element.Node; import com.yomahub.liteflow.flow.element.condition.IfCondition; /** @@ -22,13 +18,15 @@ public class ElifOperator extends BaseOperator { OperatorHelper.checkObjectSizeEqThree(objects); // 解析caller - IfCondition ifCondition = OperatorHelper.convert(objects[0], IfCondition.class); + String errorMsg = "The caller must be IfCondition item"; + IfCondition ifCondition = OperatorHelper.convert(objects[0], IfCondition.class, errorMsg); // 解析第一个参数 + OperatorHelper.checkObjMustBeBooleanTypeItem(objects[1]); Executable ifItem = OperatorHelper.convert(objects[1], Executable.class); - OperatorHelper.checkObjectMustBeBooleanItem(ifItem); // 解析第二个参数 + OperatorHelper.checkObjMustBeCommonTypeItem(objects[2]); Executable trueCaseExecutableItem = OperatorHelper.convert(objects[2], Executable.class); // 构建一个内部的IfCondition diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/ElseOperator.java b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/ElseOperator.java index 8c6b37e01..028788014 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/ElseOperator.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/ElseOperator.java @@ -18,8 +18,10 @@ public class ElseOperator extends BaseOperator { // 参数只能是1个,但这里为什么是2个呢?第一个是caller,第二个才是参数 OperatorHelper.checkObjectSizeEqTwo(objects); - IfCondition ifCondition = OperatorHelper.convert(objects[0], IfCondition.class); + String errorMsg = "The caller must be IfCondition item"; + IfCondition ifCondition = OperatorHelper.convert(objects[0], IfCondition.class, errorMsg); + OperatorHelper.checkObjMustBeCommonTypeItem(objects[1]); Executable elseExecutableItem = OperatorHelper.convert(objects[1], Executable.class); // 因为当中可能会有多个ELIF,所以并不知道这个ELSE前面有没有ELIF, diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/FinallyOperator.java b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/FinallyOperator.java index d374b0a89..b759b6cac 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/FinallyOperator.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/FinallyOperator.java @@ -20,7 +20,9 @@ public class FinallyOperator extends BaseOperator { FinallyCondition finallyCondition = new FinallyCondition(); for (Object obj : objects) { - finallyCondition.addExecutable(OperatorHelper.convert(obj, Executable.class)); + OperatorHelper.checkObjMustBeCommonTypeItem(obj); + Executable item = OperatorHelper.convert(obj, Executable.class); + finallyCondition.addExecutable(item); } return finallyCondition; } diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/ForOperator.java b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/ForOperator.java index e87f9c279..039374a70 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/ForOperator.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/ForOperator.java @@ -26,10 +26,8 @@ public class ForOperator extends BaseOperator { Node node; if (objects[0] instanceof Node) { + OperatorHelper.checkObjMustBeForTypeItem(objects[0]); node = OperatorHelper.convert(objects[0], Node.class); - if (!ListUtil.toList(NodeTypeEnum.FOR, NodeTypeEnum.FOR_SCRIPT, NodeTypeEnum.FALLBACK).contains(node.getType())) { - throw new QLException("The parameter must be for-node item"); - } } else if (objects[0] instanceof Integer) { Integer forCount = OperatorHelper.convert(objects[0], Integer.class); diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/IdOperator.java b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/IdOperator.java index 3420f10f6..d70b9c8d3 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/IdOperator.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/IdOperator.java @@ -16,7 +16,8 @@ public class IdOperator extends BaseOperator { public Condition build(Object[] objects) throws Exception { OperatorHelper.checkObjectSizeEqTwo(objects); - Condition condition = OperatorHelper.convert(objects[0], Condition.class); + String errorMsg = "The caller must be Condition item"; + Condition condition = OperatorHelper.convert(objects[0], Condition.class, errorMsg); String id = OperatorHelper.convert(objects[1], String.class); diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/IfOperator.java b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/IfOperator.java index ddf6d4b9b..4589829ef 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/IfOperator.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/IfOperator.java @@ -1,15 +1,9 @@ package com.yomahub.liteflow.builder.el.operator; -import cn.hutool.core.collection.ListUtil; -import com.ql.util.express.exception.QLException; import com.yomahub.liteflow.builder.el.operator.base.BaseOperator; import com.yomahub.liteflow.builder.el.operator.base.OperatorHelper; -import com.yomahub.liteflow.enums.NodeTypeEnum; import com.yomahub.liteflow.flow.element.Executable; -import com.yomahub.liteflow.flow.element.Node; -import com.yomahub.liteflow.flow.element.condition.AndOrCondition; import com.yomahub.liteflow.flow.element.condition.IfCondition; -import com.yomahub.liteflow.flow.element.condition.NotCondition; /** * EL规则中的IF的操作符 @@ -24,15 +18,18 @@ public class IfOperator extends BaseOperator { OperatorHelper.checkObjectSizeEq(objects, 2, 3); // 解析第一个参数 + OperatorHelper.checkObjMustBeBooleanTypeItem(objects[0]); Executable ifItem = OperatorHelper.convert(objects[0], Executable.class); - OperatorHelper.checkObjectMustBeBooleanItem(ifItem); + // 解析第二个参数 + OperatorHelper.checkObjMustBeCommonTypeItem(objects[1]); Executable trueCaseExecutableItem = OperatorHelper.convert(objects[1], Executable.class); // 解析第三个参数,如果有的话 Executable falseCaseExecutableItem = null; if (objects.length == 3) { + OperatorHelper.checkObjMustBeCommonTypeItem(objects[2]); falseCaseExecutableItem = OperatorHelper.convert(objects[2], Executable.class); } diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/IgnoreErrorOperator.java b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/IgnoreErrorOperator.java index 8ce63b2d7..b140dce46 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/IgnoreErrorOperator.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/IgnoreErrorOperator.java @@ -17,7 +17,8 @@ public class IgnoreErrorOperator extends BaseOperator { public WhenCondition build(Object[] objects) throws Exception { OperatorHelper.checkObjectSizeEqTwo(objects); - WhenCondition condition = OperatorHelper.convert(objects[0], WhenCondition.class); + String errorMsg = "The caller must be WhenCondition item"; + WhenCondition condition = OperatorHelper.convert(objects[0], WhenCondition.class, errorMsg); Boolean ignoreError = OperatorHelper.convert(objects[1], Boolean.class); condition.setIgnoreError(ignoreError); diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/IteratorOperator.java b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/IteratorOperator.java index 696fdc1e6..0d29a7f07 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/IteratorOperator.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/IteratorOperator.java @@ -14,10 +14,9 @@ public class IteratorOperator extends BaseOperator { public IteratorCondition build(Object[] objects) throws Exception { OperatorHelper.checkObjectSizeEq(objects, 1); + OperatorHelper.checkObjMustBeIteratorTypeItem(objects[0]); + Node node = OperatorHelper.convert(objects[0], Node.class); - if (!ListUtil.toList(NodeTypeEnum.ITERATOR, NodeTypeEnum.FALLBACK).contains(node.getType())) { - throw new QLException("The parameter must be iterator-node item"); - } IteratorCondition iteratorCondition = new IteratorCondition(); iteratorCondition.setIteratorNode(node); diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/MustOperator.java b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/MustOperator.java index 9c819d3be..8a903008c 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/MustOperator.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/MustOperator.java @@ -19,9 +19,10 @@ public class MustOperator extends BaseOperator { @Override public WhenCondition build(Object[] objects) throws Exception { - OperatorHelper.checkObjectSizeGtTwo(objects); + OperatorHelper.checkObjectSizeGteTwo(objects); - WhenCondition whenCondition = OperatorHelper.convert(objects[0], WhenCondition.class); + String errorMsg = "The caller must be WhenCondition item"; + WhenCondition whenCondition = OperatorHelper.convert(objects[0], WhenCondition.class, errorMsg); // 解析指定完成的任务 ID 集合 Set specifyIdSet = new HashSet<>(); diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/NodeOperator.java b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/NodeOperator.java index 5735dcd87..9a9d3b919 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/NodeOperator.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/NodeOperator.java @@ -3,7 +3,7 @@ package com.yomahub.liteflow.builder.el.operator; import com.yomahub.liteflow.builder.el.operator.base.BaseOperator; import com.yomahub.liteflow.builder.el.operator.base.OperatorHelper; import com.yomahub.liteflow.flow.FlowBus; -import com.yomahub.liteflow.flow.element.FallbackNodeProxy; +import com.yomahub.liteflow.flow.element.FallbackNode; import com.yomahub.liteflow.flow.element.Node; /** @@ -25,7 +25,7 @@ public class NodeOperator extends BaseOperator { return FlowBus.getNode(nodeId); } else { // 生成代理节点 - return new FallbackNodeProxy(nodeId); + return new FallbackNode(nodeId); } } diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/NotOperator.java b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/NotOperator.java index cbe58ab85..a2c147dbd 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/NotOperator.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/NotOperator.java @@ -3,8 +3,6 @@ package com.yomahub.liteflow.builder.el.operator; import com.yomahub.liteflow.builder.el.operator.base.BaseOperator; import com.yomahub.liteflow.builder.el.operator.base.OperatorHelper; import com.yomahub.liteflow.flow.element.Executable; -import com.yomahub.liteflow.flow.element.condition.AndOrCondition; -import com.yomahub.liteflow.flow.element.condition.BooleanConditionTypeEnum; import com.yomahub.liteflow.flow.element.condition.NotCondition; /** @@ -20,7 +18,7 @@ public class NotOperator extends BaseOperator { OperatorHelper.checkObjectSizeEqOne(objects); Object object = objects[0]; - OperatorHelper.checkObjectMustBeBooleanItem(object); + OperatorHelper.checkObjMustBeBooleanTypeItem(object); Executable item = OperatorHelper.convert(object, Executable.class); NotCondition notCondition = new NotCondition(); diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/OrOperator.java b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/OrOperator.java index ffe0a91ae..361ab62bb 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/OrOperator.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/OrOperator.java @@ -16,13 +16,13 @@ import com.yomahub.liteflow.flow.element.condition.BooleanConditionTypeEnum; public class OrOperator extends BaseOperator { @Override public AndOrCondition build(Object[] objects) throws Exception { - OperatorHelper.checkObjectSizeGtTwo(objects); + OperatorHelper.checkObjectSizeGteTwo(objects); AndOrCondition andOrCondition = new AndOrCondition(); andOrCondition.setBooleanConditionType(BooleanConditionTypeEnum.OR); for (Object object : objects){ - OperatorHelper.checkObjectMustBeBooleanItem(object); + OperatorHelper.checkObjMustBeBooleanTypeItem(object); Executable item = OperatorHelper.convert(object, Executable.class); andOrCondition.addItem(item); diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/ParallelOperator.java b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/ParallelOperator.java index 44232b353..77627a74f 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/ParallelOperator.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/ParallelOperator.java @@ -16,7 +16,8 @@ public class ParallelOperator extends BaseOperator { public LoopCondition build(Object[] objects) throws Exception { OperatorHelper.checkObjectSizeEqTwo(objects); - LoopCondition loopCondition = OperatorHelper.convert(objects[0], LoopCondition.class); + String errorMsg = "The caller must be LoopCondition item"; + LoopCondition loopCondition = OperatorHelper.convert(objects[0], LoopCondition.class, errorMsg); Boolean parallel = OperatorHelper.convert(objects[1], Boolean.class); loopCondition.setParallel(parallel); diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/PreOperator.java b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/PreOperator.java index 27c65ad06..affcfc090 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/PreOperator.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/PreOperator.java @@ -19,6 +19,7 @@ public class PreOperator extends BaseOperator { PreCondition preCondition = new PreCondition(); for (Object obj : objects) { + OperatorHelper.checkObjMustBeCommonTypeItem(obj); preCondition.addExecutable(OperatorHelper.convert(obj, Executable.class)); } return preCondition; diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/SwitchOperator.java b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/SwitchOperator.java index 041628ee3..c1d0ad3d9 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/SwitchOperator.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/SwitchOperator.java @@ -20,10 +20,8 @@ public class SwitchOperator extends BaseOperator { public SwitchCondition build(Object[] objects) throws Exception { OperatorHelper.checkObjectSizeEqOne(objects); + OperatorHelper.checkObjMustBeSwitchTypeItem(objects[0]); Node switchNode = OperatorHelper.convert(objects[0], Node.class); - if (!ListUtil.toList(NodeTypeEnum.SWITCH, NodeTypeEnum.SWITCH_SCRIPT, NodeTypeEnum.FALLBACK).contains(switchNode.getType())) { - throw new QLException("The caller must be Switch item"); - } SwitchCondition switchCondition = new SwitchCondition(); switchCondition.setSwitchNode(switchNode); diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/ThenOperator.java b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/ThenOperator.java index 619e69c7a..7d944a5b5 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/ThenOperator.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/ThenOperator.java @@ -19,6 +19,7 @@ public class ThenOperator extends BaseOperator { ThenCondition thenCondition = new ThenCondition(); for (Object obj : objects) { + OperatorHelper.checkObjMustBeCommonTypeItem(obj); thenCondition.addExecutable(OperatorHelper.convert(obj, Executable.class)); } return thenCondition; diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/ThreadPoolOperator.java b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/ThreadPoolOperator.java index a5b0791c8..d6ad98b2f 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/ThreadPoolOperator.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/ThreadPoolOperator.java @@ -16,7 +16,8 @@ public class ThreadPoolOperator extends BaseOperator { public WhenCondition build(Object[] objects) throws Exception { OperatorHelper.checkObjectSizeEqTwo(objects); - WhenCondition whenCondition = OperatorHelper.convert(objects[0], WhenCondition.class); + String errorMsg = "The caller must be WhenCondition item"; + WhenCondition whenCondition = OperatorHelper.convert(objects[0], WhenCondition.class, errorMsg); whenCondition.setThreadExecutorClass(OperatorHelper.convert(objects[1], String.class)); diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/ToOperator.java b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/ToOperator.java index 806e559a2..4eede8779 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/ToOperator.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/ToOperator.java @@ -15,11 +15,13 @@ public class ToOperator extends BaseOperator { @Override public SwitchCondition build(Object[] objects) throws Exception { - OperatorHelper.checkObjectSizeGtTwo(objects); + OperatorHelper.checkObjectSizeGteTwo(objects); - SwitchCondition switchCondition = OperatorHelper.convert(objects[0], SwitchCondition.class); + String errorMsg = "The caller must be SwitchCondition item"; + SwitchCondition switchCondition = OperatorHelper.convert(objects[0], SwitchCondition.class, errorMsg); for (int i = 1; i < objects.length; i++) { + OperatorHelper.checkObjMustBeCommonTypeItem(objects[i]); Executable target = OperatorHelper.convert(objects[i], Executable.class); switchCondition.addTargetItem(target); } diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/WhenOperator.java b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/WhenOperator.java index 011c47275..00cfa58e0 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/WhenOperator.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/WhenOperator.java @@ -4,6 +4,8 @@ import com.yomahub.liteflow.builder.el.operator.base.BaseOperator; import com.yomahub.liteflow.builder.el.operator.base.OperatorHelper; import com.yomahub.liteflow.flow.element.Executable; import com.yomahub.liteflow.flow.element.condition.WhenCondition; +import com.yomahub.liteflow.property.LiteflowConfig; +import com.yomahub.liteflow.property.LiteflowConfigGetter; /** * EL规则中的WHEN的操作符 @@ -18,8 +20,12 @@ public class WhenOperator extends BaseOperator { OperatorHelper.checkObjectSizeGtZero(objects); WhenCondition whenCondition = new WhenCondition(); + + LiteflowConfig liteflowConfig = LiteflowConfigGetter.get(); for (Object obj : objects) { + OperatorHelper.checkObjMustBeCommonTypeItem(obj); whenCondition.addExecutable(OperatorHelper.convert(obj, Executable.class)); + whenCondition.setThreadExecutorClass(liteflowConfig.getThreadExecutorClass()); } return whenCondition; } diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/WhileOperator.java b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/WhileOperator.java index a2b5c26c6..19425064c 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/WhileOperator.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/WhileOperator.java @@ -1,12 +1,8 @@ package com.yomahub.liteflow.builder.el.operator; -import cn.hutool.core.collection.ListUtil; -import com.ql.util.express.exception.QLException; import com.yomahub.liteflow.builder.el.operator.base.BaseOperator; import com.yomahub.liteflow.builder.el.operator.base.OperatorHelper; -import com.yomahub.liteflow.enums.NodeTypeEnum; import com.yomahub.liteflow.flow.element.Executable; -import com.yomahub.liteflow.flow.element.Node; import com.yomahub.liteflow.flow.element.condition.WhileCondition; /** @@ -21,8 +17,8 @@ public class WhileOperator extends BaseOperator { public WhileCondition build(Object[] objects) throws Exception { OperatorHelper.checkObjectSizeEqOne(objects); + OperatorHelper.checkObjMustBeBooleanTypeItem(objects[0]); Executable whileItem = OperatorHelper.convert(objects[0], Executable.class); - OperatorHelper.checkObjectMustBeBooleanItem(whileItem); WhileCondition whileCondition = new WhileCondition(); whileCondition.setWhileItem(whileItem); diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/base/OperatorHelper.java b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/base/OperatorHelper.java index 298cdc254..07a163412 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/base/OperatorHelper.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/base/OperatorHelper.java @@ -3,11 +3,13 @@ package com.yomahub.liteflow.builder.el.operator.base; import cn.hutool.core.collection.ListUtil; import cn.hutool.core.util.StrUtil; import com.ql.util.express.exception.QLException; +import com.yomahub.liteflow.enums.ConditionTypeEnum; +import com.yomahub.liteflow.enums.ExecuteTypeEnum; import com.yomahub.liteflow.enums.NodeTypeEnum; import com.yomahub.liteflow.exception.DataNotFoundException; +import com.yomahub.liteflow.flow.element.Condition; +import com.yomahub.liteflow.flow.element.Executable; import com.yomahub.liteflow.flow.element.Node; -import com.yomahub.liteflow.flow.element.condition.AndOrCondition; -import com.yomahub.liteflow.flow.element.condition.NotCondition; import java.util.Objects; @@ -31,13 +33,13 @@ public class OperatorHelper { } /** - * 检查参数数量,大于 2 + * 检查参数数量,大于等于 2 * @param objects objects * @throws QLException QLException */ - public static void checkObjectSizeGtTwo(Object[] objects) throws QLException { + public static void checkObjectSizeGteTwo(Object[] objects) throws QLException { checkObjectSizeGtZero(objects); - if (objects.length <= 1) { + if (objects.length < 2) { throw new QLException("parameter error"); } } @@ -137,18 +139,100 @@ public class OperatorHelper { } } + /** + * 检查对象是否为一个正常可执行的对象。 + * 大部分的Node,Condition,Chain都是正常可执行的对象,这个检查是为了避免THEN(sw,if)类的情况(sw是选择组件,if是条件组件),这种就不能放在THEN里 + */ + public static void checkObjMustBeCommonTypeItem(Object object) throws Exception{ + if (!(object instanceof Executable)){ + throw new QLException("The parameter must be Executable item."); + } + Executable item = (Executable) object; + if (item.getExecuteType().equals(ExecuteTypeEnum.NODE)){ + Node node = (Node) item; + if (!ListUtil.toList(NodeTypeEnum.COMMON, NodeTypeEnum.SCRIPT, NodeTypeEnum.FALLBACK).contains(node.getType())){ + throw new QLException(StrUtil.format("The node[{}] must be a common type component", node.getId())); + } + } + } + /** * 所谓Boolean item,指的是那些最终的结果值为布尔类型的Item * 布尔类型的items有,if,while,break类型的Node,以及AndOrCondition以及NotCondition */ - public static void checkObjectMustBeBooleanItem(Object object) throws Exception{ - if (!(object instanceof Node && ListUtil.toList( - NodeTypeEnum.IF, NodeTypeEnum.IF_SCRIPT, - NodeTypeEnum.WHILE, NodeTypeEnum.WHILE_SCRIPT, - NodeTypeEnum.BREAK, NodeTypeEnum.BREAK_SCRIPT, NodeTypeEnum.FALLBACK) - .contains(((Node) object).getType()) - || object instanceof AndOrCondition || object instanceof NotCondition)) { - throw new QLException("The first parameter must be boolean type Node or boolean type condition"); + public static void checkObjMustBeBooleanTypeItem(Object object) throws Exception{ + if (!(object instanceof Executable)){ + throw new QLException("The parameter must be Executable item."); + } + Executable item = (Executable) object; + if (item.getExecuteType().equals(ExecuteTypeEnum.NODE)){ + Node node = (Node) item; + if (!ListUtil.toList(NodeTypeEnum.IF, + NodeTypeEnum.IF_SCRIPT, + NodeTypeEnum.WHILE, + NodeTypeEnum.WHILE_SCRIPT, + NodeTypeEnum.BREAK, + NodeTypeEnum.BREAK_SCRIPT, + NodeTypeEnum.FALLBACK).contains(node.getType())){ + throw new QLException(StrUtil.format("The node[{}] must be boolean type Node.", node.getId())); + } + }else if(item.getExecuteType().equals(ExecuteTypeEnum.CONDITION)){ + Condition condition = (Condition) item; + if (!ListUtil.toList(ConditionTypeEnum.TYPE_AND_OR_OPT, ConditionTypeEnum.TYPE_NOT_OPT).contains(condition.getConditionType())){ + throw new QLException(StrUtil.format("The condition[{}] must be boolean type Condition.", condition.getId())); + } + }else{ + throw new QLException("The parameter error."); + } + } + + public static void checkObjMustBeForTypeItem(Object object) throws Exception{ + if (!(object instanceof Executable)){ + throw new QLException("The parameter must be Executable item."); + } + Executable item = (Executable) object; + if (item.getExecuteType().equals(ExecuteTypeEnum.NODE)){ + Node node = (Node) item; + if (!ListUtil.toList(NodeTypeEnum.FOR, + NodeTypeEnum.FOR_SCRIPT, + NodeTypeEnum.FALLBACK).contains(node.getType())){ + throw new QLException(StrUtil.format("The node[{}] must be For type Node.", node.getId())); + } + }else{ + throw new QLException("The parameter error."); + } + } + + public static void checkObjMustBeIteratorTypeItem(Object object) throws Exception{ + if (!(object instanceof Executable)){ + throw new QLException("The parameter must be Executable item."); + } + Executable item = (Executable) object; + if (item.getExecuteType().equals(ExecuteTypeEnum.NODE)){ + Node node = (Node) item; + if (!ListUtil.toList(NodeTypeEnum.ITERATOR, + NodeTypeEnum.FALLBACK).contains(node.getType())){ + throw new QLException(StrUtil.format("The node[{}] must be Iterator type Node.", node.getId())); + } + }else{ + throw new QLException("The parameter error."); + } + } + + public static void checkObjMustBeSwitchTypeItem(Object object) throws Exception{ + if (!(object instanceof Executable)){ + throw new QLException("The parameter must be Executable item."); + } + Executable item = (Executable) object; + if (item.getExecuteType().equals(ExecuteTypeEnum.NODE)){ + Node node = (Node) item; + if (!ListUtil.toList(NodeTypeEnum.SWITCH, + NodeTypeEnum.SWITCH_SCRIPT, + NodeTypeEnum.FALLBACK).contains(node.getType())){ + throw new QLException(StrUtil.format("The node[{}] must be Switch type Node.", node.getId())); + } + }else{ + throw new QLException("The parameter error."); } } } diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/enums/NodeTypeEnum.java b/liteflow-core/src/main/java/com/yomahub/liteflow/enums/NodeTypeEnum.java index d86a63e45..7ca1efff7 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/enums/NodeTypeEnum.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/enums/NodeTypeEnum.java @@ -34,8 +34,6 @@ public enum NodeTypeEnum { BREAK("break", "循环跳出", false, NodeBreakComponent.class), ITERATOR("iterator", "循环迭代", false, NodeIteratorComponent.class), - - FALLBACK("fallback", "降级", false, null), SCRIPT("script", "脚本", true, ScriptCommonComponent.class), @@ -47,7 +45,9 @@ public enum NodeTypeEnum { WHILE_SCRIPT("while_script", "循环条件脚本", true, ScriptWhileComponent.class), - BREAK_SCRIPT("break_script", "循环跳出脚本", true, ScriptBreakComponent.class); + BREAK_SCRIPT("break_script", "循环跳出脚本", true, ScriptBreakComponent.class), + + FALLBACK("fallback", "降级", false, null); private static final LFLog LOG = LFLoggerManager.getLogger(NodeTypeEnum.class); @@ -120,7 +120,7 @@ public enum NodeTypeEnum { } for (NodeTypeEnum e : NodeTypeEnum.values()) { - if (e.getMappingClazz().equals(superClazz)) { + if (e.getMappingClazz() != null && e.getMappingClazz().equals(superClazz)) { return e; } } diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/flow/element/FallbackNodeProxy.java b/liteflow-core/src/main/java/com/yomahub/liteflow/flow/element/FallbackNode.java similarity index 97% rename from liteflow-core/src/main/java/com/yomahub/liteflow/flow/element/FallbackNodeProxy.java rename to liteflow-core/src/main/java/com/yomahub/liteflow/flow/element/FallbackNode.java index e19119c93..966f37a61 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/flow/element/FallbackNodeProxy.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/flow/element/FallbackNode.java @@ -23,7 +23,7 @@ import com.yomahub.liteflow.slot.Slot; * @author DaleLee * @since 2.11.1 */ -public class FallbackNodeProxy extends Node { +public class FallbackNode extends Node { // 原节点 id private String expectedNodeId; @@ -31,11 +31,11 @@ public class FallbackNodeProxy extends Node { // 降级节点 private Node fallbackNode; - public FallbackNodeProxy() { + public FallbackNode() { this.setType(NodeTypeEnum.FALLBACK); } - public FallbackNodeProxy(String expectedNodeId) { + public FallbackNode(String expectedNodeId) { this(); this.expectedNodeId = expectedNodeId; } diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/flow/element/condition/WhileCondition.java b/liteflow-core/src/main/java/com/yomahub/liteflow/flow/element/condition/WhileCondition.java index e616db763..df85bfe86 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/flow/element/condition/WhileCondition.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/flow/element/condition/WhileCondition.java @@ -39,7 +39,7 @@ public class WhileCondition extends LoopCondition { int index = 0; if(!this.isParallel()){ //串行循环 - while (getWhileResult(slotIndex)) { + while (getWhileResult(slotIndex, index)) { executableItem.setCurrChainId(this.getCurrChainId()); setLoopIndex(executableItem, index); executableItem.execute(slotIndex); @@ -60,7 +60,7 @@ public class WhileCondition extends LoopCondition { List> futureList = new ArrayList<>(); //获取并行循环的线程池 ExecutorService parallelExecutor = ExecutorHelper.loadInstance().buildLoopParallelExecutor(); - while (getWhileResult(slotIndex)){ + while (getWhileResult(slotIndex, index)){ CompletableFuture future = CompletableFuture.supplyAsync(new LoopParallelSupplier(executableItem, this.getCurrChainId(), slotIndex, index), parallelExecutor); futureList.add(future); @@ -81,10 +81,11 @@ public class WhileCondition extends LoopCondition { } } - private boolean getWhileResult(Integer slotIndex) throws Exception { + private boolean getWhileResult(Integer slotIndex, int loopIndex) throws Exception { Executable whileItem = this.getWhileItem(); // 执行while组件 whileItem.setCurrChainId(this.getCurrChainId()); + setLoopIndex(whileItem, loopIndex); whileItem.execute(slotIndex); return whileItem.getItemResultMetaValue(slotIndex); diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/thread/ExecutorHelper.java b/liteflow-core/src/main/java/com/yomahub/liteflow/thread/ExecutorHelper.java index bdaa120d5..02973448f 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/thread/ExecutorHelper.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/thread/ExecutorHelper.java @@ -157,7 +157,7 @@ public class ExecutorHelper { Class executorClass = (Class) Class.forName(clazz); ExecutorBuilder executorBuilder = ContextAwareHolder.loadContextAware().registerBean(executorClass); ExecutorService executorService = executorBuilder.buildExecutor(); - executorServiceMap.put(clazz, executorService); + executorServiceMap.put(key, executorService); return executorService; } } diff --git a/liteflow-solon-plugin/src/main/java/com/yomahub/liteflow/solon/config/LiteflowMainAutoConfiguration.java b/liteflow-solon-plugin/src/main/java/com/yomahub/liteflow/solon/config/LiteflowMainAutoConfiguration.java index e40faa398..319ed9edf 100644 --- a/liteflow-solon-plugin/src/main/java/com/yomahub/liteflow/solon/config/LiteflowMainAutoConfiguration.java +++ b/liteflow-solon-plugin/src/main/java/com/yomahub/liteflow/solon/config/LiteflowMainAutoConfiguration.java @@ -5,7 +5,7 @@ import com.yomahub.liteflow.property.LiteflowConfig; import org.noear.solon.annotation.Configuration; import org.noear.solon.annotation.Init; import org.noear.solon.annotation.Inject; -import org.noear.solon.core.AopContext; +import org.noear.solon.core.AppContext; /** * 主要的业务装配器 在这个装配器里装配了执行器,执行器初始化类,监控器 @@ -22,7 +22,7 @@ public class LiteflowMainAutoConfiguration { boolean parseOnStart; @Inject - AopContext aopContext; + AppContext appContext; @Inject LiteflowConfig liteflowConfig; @@ -39,7 +39,7 @@ public class LiteflowMainAutoConfiguration { flowExecutor.init(true); } - aopContext.wrapAndPut(FlowExecutor.class, flowExecutor); + appContext.wrapAndPut(FlowExecutor.class, flowExecutor); } } diff --git a/liteflow-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/liteflow-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json index 92197d877..f5eb0bec5 100644 --- a/liteflow-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/liteflow-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -214,13 +214,6 @@ "description": "Custom thread pool implement for parallel-loop executor.", "sourceType": "com.yomahub.liteflow.springboot.LiteflowProperty", "defaultValue": "com.yomahub.liteflow.thread.LiteFlowDefaultParallelLoopExecutorBuilder" - }, - { - "name": "liteflow.fallback-cmp-enable", - "type": "java.lang.Boolean", - "description": "Enable fallback component.", - "sourceType": "com.yomahub.liteflow.springboot.LiteflowProperty", - "defaultValue": false } ] } \ No newline at end of file diff --git a/liteflow-spring/src/main/java/com/yomahub/liteflow/spring/DeclBeanDefinition.java b/liteflow-spring/src/main/java/com/yomahub/liteflow/spring/DeclBeanDefinition.java index 017211abf..2a30ebb2a 100644 --- a/liteflow-spring/src/main/java/com/yomahub/liteflow/spring/DeclBeanDefinition.java +++ b/liteflow-spring/src/main/java/com/yomahub/liteflow/spring/DeclBeanDefinition.java @@ -30,7 +30,11 @@ public class DeclBeanDefinition implements BeanDefinitionRegistryPostProcessor { beanDefinitionHolderMap.entrySet().stream().filter(entry -> { Class rawClass = entry.getValue().getResolvableType().getRawClass(); - return Arrays.stream(rawClass.getMethods()).anyMatch(method -> AnnotationUtil.getAnnotation(method, LiteflowMethod.class) != null); + if (rawClass == null){ + return false; + }else{ + return Arrays.stream(rawClass.getMethods()).anyMatch(method -> AnnotationUtil.getAnnotation(method, LiteflowMethod.class) != null); + } }).forEach(entry -> { Class rawClass = entry.getValue().getResolvableType().getRawClass(); List declWarpBeanList = DeclComponentParserHolder.loadDeclComponentParser().parseDeclBean(rawClass); diff --git a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/endlessLoop/FlowInDifferentConfigTest.java b/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/endlessLoop/FlowInDifferentConfigTest.java index 3017205c4..dac3adbc3 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/endlessLoop/FlowInDifferentConfigTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/endlessLoop/FlowInDifferentConfigTest.java @@ -19,7 +19,7 @@ import org.junit.jupiter.api.Test; public class FlowInDifferentConfigTest extends BaseTest { // 测试 chain 死循环 - @Test + //@Test public void testChainEndlessLoop() { Assertions.assertThrows(CyclicDependencyException.class, () -> { LiteflowConfig config = LiteflowConfigGetter.get(); diff --git a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/endlessLoop/FlowJsonTest.java b/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/endlessLoop/FlowJsonTest.java index 5f36f22aa..9c4e5c4fa 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/endlessLoop/FlowJsonTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/endlessLoop/FlowJsonTest.java @@ -17,7 +17,7 @@ import org.junit.jupiter.api.Test; public class FlowJsonTest extends BaseTest { // 测试 chain 死循环 - @Test + //@Test public void testChainEndlessLoop() { Assertions.assertThrows(CyclicDependencyException.class, () -> { LiteflowConfig config = LiteflowConfigGetter.get(); diff --git a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/endlessLoop/FlowXMLTest.java b/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/endlessLoop/FlowXMLTest.java index 3091e60a9..5edbd2431 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/endlessLoop/FlowXMLTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/endlessLoop/FlowXMLTest.java @@ -17,7 +17,7 @@ import org.junit.jupiter.api.Test; public class FlowXMLTest extends BaseTest { // 测试 chain 死循环 - @Test + //@Test public void testChainEndlessLoop() { Assertions.assertThrows(CyclicDependencyException.class, () -> { LiteflowConfig config = LiteflowConfigGetter.get(); diff --git a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/endlessLoop/FlowYMLTest.java b/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/endlessLoop/FlowYMLTest.java index 654cf63db..50248db24 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/endlessLoop/FlowYMLTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/endlessLoop/FlowYMLTest.java @@ -17,7 +17,7 @@ import org.junit.jupiter.api.Test; public class FlowYMLTest extends BaseTest { // 测试 chain 死循环 - @Test + //@Test public void testChainEndlessLoop() { Assertions.assertThrows(CyclicDependencyException.class, () -> { LiteflowConfig config = LiteflowConfigGetter.get(); diff --git a/liteflow-testcase-el/liteflow-testcase-el-script-python-springboot/src/test/java/com/yomahub/liteflow/test/script/python/common/ScriptPythonCommonELTest.java b/liteflow-testcase-el/liteflow-testcase-el-script-python-springboot/src/test/java/com/yomahub/liteflow/test/script/python/common/ScriptPythonCommonELTest.java index 7deeb878f..36f360b5b 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-script-python-springboot/src/test/java/com/yomahub/liteflow/test/script/python/common/ScriptPythonCommonELTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-script-python-springboot/src/test/java/com/yomahub/liteflow/test/script/python/common/ScriptPythonCommonELTest.java @@ -26,7 +26,7 @@ import javax.annotation.Resource; @TestPropertySource(value = "classpath:/common/application.properties") @SpringBootTest(classes = ScriptPythonCommonELTest.class) @EnableAutoConfiguration -@ComponentScan({ "com.yomahub.liteflow.test.script.python.common.cmp" }) +@ComponentScan({ "com.yomahub.liteflow.test.script.python.common.cmp","com.yomahub.liteflow.test.script.python.common.domain" }) public class ScriptPythonCommonELTest extends BaseTest { @Resource @@ -40,6 +40,7 @@ public class ScriptPythonCommonELTest extends BaseTest { Assertions.assertTrue(response.isSuccess()); Assertions.assertEquals(Integer.valueOf(30), context.getData("s1")); Assertions.assertEquals("杰克", context.getData("name")); + Assertions.assertEquals("hi,jack", context.getData("td")); } } diff --git a/liteflow-testcase-el/liteflow-testcase-el-script-python-springboot/src/test/java/com/yomahub/liteflow/test/script/python/common/domain/TestDomain.java b/liteflow-testcase-el/liteflow-testcase-el-script-python-springboot/src/test/java/com/yomahub/liteflow/test/script/python/common/domain/TestDomain.java new file mode 100644 index 000000000..9ab0f929a --- /dev/null +++ b/liteflow-testcase-el/liteflow-testcase-el-script-python-springboot/src/test/java/com/yomahub/liteflow/test/script/python/common/domain/TestDomain.java @@ -0,0 +1,13 @@ +package com.yomahub.liteflow.test.script.python.common.domain; + +import com.yomahub.liteflow.script.annotation.ScriptBean; +import org.springframework.stereotype.Component; + +@Component +@ScriptBean("td") +public class TestDomain { + + public String sayHi(String name){ + return "hi," + name; + } +} diff --git a/liteflow-testcase-el/liteflow-testcase-el-script-python-springboot/src/test/resources/common/flow.xml b/liteflow-testcase-el/liteflow-testcase-el-script-python-springboot/src/test/resources/common/flow.xml index 43e774df2..b43fdc9ba 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-script-python-springboot/src/test/resources/common/flow.xml +++ b/liteflow-testcase-el/liteflow-testcase-el-script-python-springboot/src/test/resources/common/flow.xml @@ -16,10 +16,11 @@ b=10 if a>5: b=5 - print 'hello' + print '你好'.decode('UTF-8') else: print 'hi' defaultContext.setData("s1",a*b) + defaultContext.setData("td", td.sayHi("jack")) ]]> diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/abstractChain/AbstractChainJsonELSpringBootTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/abstractChain/AbstractChainJsonELSpringBootTest.java index d2a6809ae..e419124ac 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/abstractChain/AbstractChainJsonELSpringBootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/abstractChain/AbstractChainJsonELSpringBootTest.java @@ -6,12 +6,12 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/abstractChain/application-json.properties") +@Import(profiles="classpath:/abstractChain/application-json.properties") public class AbstractChainJsonELSpringBootTest extends BaseTest { @Inject diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/abstractChain/AbstractChainXMLELSpringBootTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/abstractChain/AbstractChainXMLELSpringBootTest.java index e4be4203c..d94db943a 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/abstractChain/AbstractChainXMLELSpringBootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/abstractChain/AbstractChainXMLELSpringBootTest.java @@ -6,9 +6,9 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; /** * 测试显示调用子流程(xml) 单元测试 @@ -16,7 +16,7 @@ import org.noear.solon.test.annotation.TestPropertySource; * @author justin.xu */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/abstractChain/application.properties") +@Import(profiles="classpath:/abstractChain/application.properties") public class AbstractChainXMLELSpringBootTest extends BaseTest { @Inject diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/abstractChain/AbstractChainYmlELSpringBootTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/abstractChain/AbstractChainYmlELSpringBootTest.java index 454011c00..2ce1b74b2 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/abstractChain/AbstractChainYmlELSpringBootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/abstractChain/AbstractChainYmlELSpringBootTest.java @@ -6,9 +6,9 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; /** * 测试显示调用子流程(yml) 单元测试 @@ -16,7 +16,7 @@ import org.noear.solon.test.annotation.TestPropertySource; * @author justin.xu */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/abstractChain/application-yml.properties") +@Import(profiles="classpath:/abstractChain/application-yml.properties") public class AbstractChainYmlELSpringBootTest extends BaseTest { @Inject diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/asyncNode/AsyncNodeELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/asyncNode/AsyncNodeELSpringbootTest.java index 6b223f825..05ca42dc4 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/asyncNode/AsyncNodeELSpringbootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/asyncNode/AsyncNodeELSpringbootTest.java @@ -9,9 +9,9 @@ import com.yomahub.liteflow.test.asyncNode.exception.TestException; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; /** * 测试隐式调用子流程 单元测试 @@ -19,7 +19,7 @@ import org.noear.solon.test.annotation.TestPropertySource; * @author ssss */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/asyncNode/application.properties") +@Import(profiles="classpath:/asyncNode/application.properties") public class AsyncNodeELSpringbootTest extends BaseTest { @Inject diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/base/BaseELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/base/BaseELSpringbootTest.java index 4b6fbc38e..296825816 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/base/BaseELSpringbootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/base/BaseELSpringbootTest.java @@ -6,9 +6,9 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; /** * springboot环境EL常规的例子测试 @@ -16,7 +16,7 @@ import org.noear.solon.test.annotation.TestPropertySource; * @author Bryan.Zhang */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/base/application.properties") +@Import(profiles="classpath:/base/application.properties") public class BaseELSpringbootTest extends BaseTest { @Inject diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/cmpData/CmpDataELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/cmpData/CmpDataELSpringbootTest.java index 46a28ce6e..5297fed2b 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/cmpData/CmpDataELSpringbootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/cmpData/CmpDataELSpringbootTest.java @@ -9,9 +9,9 @@ import com.yomahub.liteflow.test.cmpData.vo.User; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; /** * springboot环境EL常规的例子测试 @@ -19,7 +19,7 @@ import org.noear.solon.test.annotation.TestPropertySource; * @author Bryan.Zhang */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/cmpData/application.properties") +@Import(profiles="classpath:/cmpData/application.properties") public class CmpDataELSpringbootTest extends BaseTest { @Inject diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/cmpRetry/LiteflowRetryELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/cmpRetry/LiteflowRetryELSpringbootTest.java index 8e28792e9..29f92fdb8 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/cmpRetry/LiteflowRetryELSpringbootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/cmpRetry/LiteflowRetryELSpringbootTest.java @@ -7,9 +7,9 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.noear.snack.ONode; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; /** * 测试springboot下的节点执行器 @@ -18,7 +18,7 @@ import org.noear.solon.test.annotation.TestPropertySource; * @since 2.5.10 */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/cmpRetry/application.properties") +@Import(profiles="classpath:/cmpRetry/application.properties") public class LiteflowRetryELSpringbootTest extends BaseTest { @Inject diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/cmpStep/CmpStepELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/cmpStep/CmpStepELSpringbootTest.java index 7624a3690..f7d98c0e2 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/cmpStep/CmpStepELSpringbootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/cmpStep/CmpStepELSpringbootTest.java @@ -7,9 +7,9 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; import java.util.*; @@ -20,7 +20,7 @@ import java.util.*; * @since 2.7.0 */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/cmpStep/application.properties") +@Import(profiles="classpath:/cmpStep/application.properties") public class CmpStepELSpringbootTest extends BaseTest { @Inject diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/comments/LiteflowNodeELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/comments/LiteflowNodeELSpringbootTest.java index c188d3a92..f75a91614 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/comments/LiteflowNodeELSpringbootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/comments/LiteflowNodeELSpringbootTest.java @@ -7,12 +7,12 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/comments/application.properties") +@Import(profiles="classpath:/comments/application.properties") public class LiteflowNodeELSpringbootTest extends BaseTest { @Inject diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/complex/ComplexELSpringbootTest1.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/complex/ComplexELSpringbootTest1.java index adfa6d0da..08e63f399 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/complex/ComplexELSpringbootTest1.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/complex/ComplexELSpringbootTest1.java @@ -6,9 +6,9 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; /** * springboot环境EL复杂例子测试1 @@ -16,7 +16,7 @@ import org.noear.solon.test.annotation.TestPropertySource; * @author Bryan.Zhang */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/complex/application1.properties") +@Import(profiles="classpath:/complex/application1.properties") public class ComplexELSpringbootTest1 extends BaseTest { @Inject diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/complex2/ComplexELSpringbootTest2.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/complex2/ComplexELSpringbootTest2.java index 9d79f629c..21d3c15e4 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/complex2/ComplexELSpringbootTest2.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/complex2/ComplexELSpringbootTest2.java @@ -6,9 +6,9 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; /** * springboot环境EL复杂例子测试1 @@ -16,7 +16,7 @@ import org.noear.solon.test.annotation.TestPropertySource; * @author Bryan.Zhang */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/complex/application2.properties") +@Import(profiles="classpath:/complex/application2.properties") public class ComplexELSpringbootTest2 extends BaseTest { @Inject diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/component/FlowExecutorELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/component/FlowExecutorELSpringbootTest.java index 58450c05e..00068cd0d 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/component/FlowExecutorELSpringbootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/component/FlowExecutorELSpringbootTest.java @@ -6,9 +6,9 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -18,7 +18,7 @@ import org.slf4j.LoggerFactory; * @author donguo.tao */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/component/application.properties") +@Import(profiles="classpath:/component/application.properties") public class FlowExecutorELSpringbootTest extends BaseTest { private static final Logger LOG = LoggerFactory.getLogger(FlowExecutorELSpringbootTest.class); diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/customNodes/CustomNodesELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/customNodes/CustomNodesELSpringbootTest.java index be2c7cbe5..b2e80dc18 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/customNodes/CustomNodesELSpringbootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/customNodes/CustomNodesELSpringbootTest.java @@ -6,9 +6,9 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -19,7 +19,7 @@ import org.slf4j.LoggerFactory; * @since 2.6.4 */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/customNodes/application.properties") +@Import(profiles="classpath:/customNodes/application.properties") public class CustomNodesELSpringbootTest extends BaseTest { private final Logger log = LoggerFactory.getLogger(this.getClass()); diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomWhenThreadPoolELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomWhenThreadPoolELSpringbootTest.java index 3711f87c5..bb4caef34 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomWhenThreadPoolELSpringbootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomWhenThreadPoolELSpringbootTest.java @@ -7,9 +7,9 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -20,7 +20,7 @@ import org.slf4j.LoggerFactory; * @since 2.6.4 */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/customWhenThreadPool/application.properties") +@Import(profiles="classpath:/customWhenThreadPool/application.properties") public class CustomWhenThreadPoolELSpringbootTest extends BaseTest { private final Logger log = LoggerFactory.getLogger(this.getClass()); diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/event/EventELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/event/EventELSpringbootTest.java index 8b7696891..4de9c6ee9 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/event/EventELSpringbootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/event/EventELSpringbootTest.java @@ -7,9 +7,9 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; /** * springboot环境事件回调测试 @@ -18,7 +18,7 @@ import org.noear.solon.test.annotation.TestPropertySource; * @since 2.7.1 */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/event/application.properties") +@Import(profiles="classpath:/event/application.properties") public class EventELSpringbootTest extends BaseTest { @Inject diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/exception/Exception2ELSpringBootTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/exception/Exception2ELSpringBootTest.java index 115f35e55..530fc24da 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/exception/Exception2ELSpringBootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/exception/Exception2ELSpringBootTest.java @@ -2,7 +2,6 @@ package com.yomahub.liteflow.test.exception; import com.yomahub.liteflow.core.FlowExecutor; import com.yomahub.liteflow.exception.ChainNotFoundException; -import com.yomahub.liteflow.exception.FlowSystemException; import com.yomahub.liteflow.exception.LiteFlowException; import com.yomahub.liteflow.exception.NoSwitchTargetNodeException; import com.yomahub.liteflow.flow.LiteflowResponse; @@ -10,10 +9,10 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; -import org.noear.solon.core.AopContext; +import org.noear.solon.core.AppContext; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; /** * 流程执行异常 单元测试 @@ -21,14 +20,14 @@ import org.noear.solon.test.annotation.TestPropertySource; * @author zendwang */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/exception/application.properties") +@Import(profiles="classpath:/exception/application.properties") public class Exception2ELSpringBootTest extends BaseTest { @Inject private FlowExecutor flowExecutor; @Inject - private AopContext context; + private AppContext context; @Test public void testChainNotFoundException() throws Exception { diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/execute2Future/Executor2FutureELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/execute2Future/Executor2FutureELSpringbootTest.java index 2cdcf6ac2..6afc58dda 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/execute2Future/Executor2FutureELSpringbootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/execute2Future/Executor2FutureELSpringbootTest.java @@ -7,9 +7,9 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; import java.util.concurrent.Future; /** @@ -19,7 +19,7 @@ import java.util.concurrent.Future; * @since 2.6.13 */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/execute2Future/application.properties") +@Import(profiles="classpath:/execute2Future/application.properties") public class Executor2FutureELSpringbootTest extends BaseTest { @Inject diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/fallback/FallbackELSolonTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/fallback/FallbackELSolonTest.java index db1603212..dae75cc12 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/fallback/FallbackELSolonTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/fallback/FallbackELSolonTest.java @@ -6,9 +6,9 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; @@ -20,7 +20,7 @@ import java.util.concurrent.Future; * @since 2.11.1 */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/fallback/application.properties") +@Import(profiles="classpath:/fallback/application.properties") public class FallbackELSolonTest extends BaseTest { @Inject diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/getChainName/GetChainNameELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/getChainName/GetChainNameELSpringbootTest.java index c1ec728ed..41bba0aeb 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/getChainName/GetChainNameELSpringbootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/getChainName/GetChainNameELSpringbootTest.java @@ -7,9 +7,9 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; /** * springboot环境获取ChainName的测试 @@ -17,7 +17,7 @@ import org.noear.solon.test.annotation.TestPropertySource; * @author Bryan.Zhang */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/getChainName/application.properties") +@Import(profiles="classpath:/getChainName/application.properties") public class GetChainNameELSpringbootTest extends BaseTest { @Inject diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/ifelse/IfELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/ifelse/IfELSpringbootTest.java index 3138f2f80..92924a969 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/ifelse/IfELSpringbootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/ifelse/IfELSpringbootTest.java @@ -6,9 +6,9 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; /** * springboot环境EL常规的例子测试 @@ -16,7 +16,7 @@ import org.noear.solon.test.annotation.TestPropertySource; * @author Bryan.Zhang */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/ifelse/application.properties") +@Import(profiles="classpath:/ifelse/application.properties") public class IfELSpringbootTest extends BaseTest { @Inject diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/lfCmpAnno/LiteflowComponentELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/lfCmpAnno/LiteflowComponentELSpringbootTest.java index 1e40ced58..5260c9dad 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/lfCmpAnno/LiteflowComponentELSpringbootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/lfCmpAnno/LiteflowComponentELSpringbootTest.java @@ -6,9 +6,9 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; /** * 测试@LiteflowComponent标注 @@ -17,7 +17,7 @@ import org.noear.solon.test.annotation.TestPropertySource; * @since 2.5.10 */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/lfCmpAnno/application.properties") +@Import(profiles="classpath:/lfCmpAnno/application.properties") public class LiteflowComponentELSpringbootTest extends BaseTest { @Inject diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/loop/LoopELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/loop/LoopELSpringbootTest.java index e70731910..00abc254e 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/loop/LoopELSpringbootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/loop/LoopELSpringbootTest.java @@ -7,9 +7,9 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; /** * springboot环境EL循环的例子测试 @@ -17,7 +17,7 @@ import org.noear.solon.test.annotation.TestPropertySource; * @author Bryan.Zhang */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/loop/application.properties") +@Import(profiles="classpath:/loop/application.properties") public class LoopELSpringbootTest extends BaseTest { @Inject diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/maxWaitMilliseconds/MaxWaitMillisecondsSolonTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/maxWaitMilliseconds/MaxWaitMillisecondsSolonTest.java index d246c786b..3c977c1ed 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/maxWaitMilliseconds/MaxWaitMillisecondsSolonTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/maxWaitMilliseconds/MaxWaitMillisecondsSolonTest.java @@ -14,9 +14,9 @@ import com.yomahub.liteflow.test.maxWaitSeconds.cmp.CCmp; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; import java.util.concurrent.TimeoutException; @@ -29,7 +29,7 @@ import static com.yomahub.liteflow.test.maxWaitSeconds.cmp.DCmp.CONTENT_KEY; * @since 2.11.1 */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/maxWaitMilliseconds/application.properties") +@Import(profiles="classpath:/maxWaitMilliseconds/application.properties") public class MaxWaitMillisecondsSolonTest extends BaseTest { @Inject diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/maxWaitSeconds/MaxWaitSecondsSolonTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/maxWaitSeconds/MaxWaitSecondsSolonTest.java index 981d6b215..b4c40a3ad 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/maxWaitSeconds/MaxWaitSecondsSolonTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/maxWaitSeconds/MaxWaitSecondsSolonTest.java @@ -14,9 +14,9 @@ import com.yomahub.liteflow.test.maxWaitSeconds.cmp.CCmp; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; import java.util.concurrent.TimeoutException; @@ -29,7 +29,7 @@ import static com.yomahub.liteflow.test.maxWaitSeconds.cmp.DCmp.CONTENT_KEY; * @since 2.11.0 */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/maxWaitSeconds/application.properties") +@Import(profiles="classpath:/maxWaitSeconds/application.properties") public class MaxWaitSecondsSolonTest extends BaseTest { @Inject diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/monitor/MonitorELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/monitor/MonitorELSpringbootTest.java index 69db27030..dbdf47464 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/monitor/MonitorELSpringbootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/monitor/MonitorELSpringbootTest.java @@ -9,9 +9,9 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; /** * springboot环境最普通的例子测试 @@ -20,7 +20,7 @@ import org.noear.solon.test.annotation.TestPropertySource; * @since 2.6.4 */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/monitor/application.properties") +@Import(profiles="classpath:/monitor/application.properties") public class MonitorELSpringbootTest extends BaseTest { @Inject diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/multiContext/MultiContextELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/multiContext/MultiContextELSpringbootTest.java index 8c9173c28..5a718dc70 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/multiContext/MultiContextELSpringbootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/multiContext/MultiContextELSpringbootTest.java @@ -9,9 +9,9 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; /** * springboot环境最普通的例子测试 @@ -20,7 +20,7 @@ import org.noear.solon.test.annotation.TestPropertySource; * @since 2.6.4 */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/multiContext/application.properties") +@Import(profiles="classpath:/multiContext/application.properties") public class MultiContextELSpringbootTest extends BaseTest { @Inject diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/multipleType/LiteflowMultipleTypeELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/multipleType/LiteflowMultipleTypeELSpringbootTest.java index 5052d86a5..3a10ed4cf 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/multipleType/LiteflowMultipleTypeELSpringbootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/multipleType/LiteflowMultipleTypeELSpringbootTest.java @@ -6,9 +6,9 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; /** * 测试springboot下混合格式规则的场景 @@ -17,7 +17,7 @@ import org.noear.solon.test.annotation.TestPropertySource; * @since 2.5.10 */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/multipleType/application.properties") +@Import(profiles="classpath:/multipleType/application.properties") public class LiteflowMultipleTypeELSpringbootTest extends BaseTest { @Inject diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/nodeExecutor/LiteflowNodeExecutorELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/nodeExecutor/LiteflowNodeExecutorELSpringbootTest.java index 524199bbd..063675732 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/nodeExecutor/LiteflowNodeExecutorELSpringbootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/nodeExecutor/LiteflowNodeExecutorELSpringbootTest.java @@ -7,9 +7,9 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; /** * 测试springboot下的组件重试 @@ -18,7 +18,7 @@ import org.noear.solon.test.annotation.TestPropertySource; * @since 2.5.10 */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/nodeExecutor/application.properties") +@Import(profiles="classpath:/nodeExecutor/application.properties") public class LiteflowNodeExecutorELSpringbootTest extends BaseTest { @Inject diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/nullParam/NullParamELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/nullParam/NullParamELSpringbootTest.java index f2ffff350..ad15f97c7 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/nullParam/NullParamELSpringbootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/nullParam/NullParamELSpringbootTest.java @@ -6,9 +6,9 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; /** * 单元测试:传递null param导致NPE的优化代码 @@ -17,7 +17,7 @@ import org.noear.solon.test.annotation.TestPropertySource; * @since 2.6.6 */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/nullParam/application.properties") +@Import(profiles="classpath:/nullParam/application.properties") public class NullParamELSpringbootTest extends BaseTest { @Inject diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/parallelLoop/ParallelLoopELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/parallelLoop/ParallelLoopELSpringbootTest.java index fffe2b305..e19394d65 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/parallelLoop/ParallelLoopELSpringbootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/parallelLoop/ParallelLoopELSpringbootTest.java @@ -9,11 +9,10 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; -//import javax.annotation.Resource; import java.util.List; import java.util.regex.Pattern; @@ -24,7 +23,7 @@ import java.util.regex.Pattern; * @since 2.11.0 */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/parallelLoop/application.properties") +@Import(profiles="classpath:/parallelLoop/application.properties") public class ParallelLoopELSpringbootTest extends BaseTest { @Inject diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomParserJsonELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomParserJsonELSpringbootTest.java index 60911af80..3ecccc553 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomParserJsonELSpringbootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomParserJsonELSpringbootTest.java @@ -6,9 +6,9 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; /** * springboot环境的自定义json parser单元测试 @@ -17,7 +17,7 @@ import org.noear.solon.test.annotation.TestPropertySource; * @since 2.5.0 */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/parsecustom/application-custom-json.properties") +@Import(profiles="classpath:/parsecustom/application-custom-json.properties") public class CustomParserJsonELSpringbootTest extends BaseTest { @Inject diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomParserXmlELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomParserXmlELSpringbootTest.java index 9a6b92ab2..8fff7ff8a 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomParserXmlELSpringbootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomParserXmlELSpringbootTest.java @@ -6,9 +6,9 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; /** * springboot环境的自定义xml parser单元测试 主要测试自定义配置源类是否能引入springboot中的其他依赖 @@ -17,7 +17,7 @@ import org.noear.solon.test.annotation.TestPropertySource; * @since 2.5.7 */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/parsecustom/application-custom-xml.properties") +@Import(profiles="classpath:/parsecustom/application-custom-xml.properties") public class CustomParserXmlELSpringbootTest extends BaseTest { @Inject diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomParserYmlELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomParserYmlELSpringbootTest.java index 7a61da242..798c368de 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomParserYmlELSpringbootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomParserYmlELSpringbootTest.java @@ -6,9 +6,9 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; /** * springboot环境的自定义yml parser单元测试 主要测试自定义配置源类是否能引入springboot中的其他依赖 @@ -16,7 +16,7 @@ import org.noear.solon.test.annotation.TestPropertySource; * @author junjun */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/parsecustom/application-custom-yml.properties") +@Import(profiles="classpath:/parsecustom/application-custom-yml.properties") public class CustomParserYmlELSpringbootTest extends BaseTest { @Inject diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/parser/JsonParserELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/parser/JsonParserELSpringbootTest.java index 13e66a5f9..f50590f02 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/parser/JsonParserELSpringbootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/parser/JsonParserELSpringbootTest.java @@ -6,9 +6,9 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; /** * spring环境的json parser单元测试 @@ -17,7 +17,7 @@ import org.noear.solon.test.annotation.TestPropertySource; * @since 2.5.0 */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/parser/application-json.properties") +@Import(profiles="classpath:/parser/application-json.properties") public class JsonParserELSpringbootTest extends BaseTest { @Inject diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/parser/SpringELSupportELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/parser/SpringELSupportELSpringbootTest.java index 0e03bbc88..b66b02b1c 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/parser/SpringELSupportELSpringbootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/parser/SpringELSupportELSpringbootTest.java @@ -6,12 +6,12 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/parser/application-springEL.properties") +@Import(profiles="classpath:/parser/application-springEL.properties") public class SpringELSupportELSpringbootTest extends BaseTest { @Inject diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/parser/XmlParserELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/parser/XmlParserELSpringbootTest.java index 5df5042b7..e77846c3b 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/parser/XmlParserELSpringbootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/parser/XmlParserELSpringbootTest.java @@ -6,9 +6,9 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; /** * springboot环境的xml parser单元测试 @@ -17,7 +17,7 @@ import org.noear.solon.test.annotation.TestPropertySource; * @since 2.5.0 */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/parser/application-xml.properties") +@Import(profiles="classpath:/parser/application-xml.properties") public class XmlParserELSpringbootTest extends BaseTest { @Inject diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/parser/YmlParserELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/parser/YmlParserELSpringbootTest.java index ba528c532..ad2ddac0d 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/parser/YmlParserELSpringbootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/parser/YmlParserELSpringbootTest.java @@ -6,9 +6,9 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; /** * springboot下的yml parser测试用例 @@ -17,7 +17,7 @@ import org.noear.solon.test.annotation.TestPropertySource; * @since 2.5.0 */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/parser/application-yml.properties") +@Import(profiles="classpath:/parser/application-yml.properties") public class YmlParserELSpringbootTest extends BaseTest { @Inject diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/preAndFinally/PreAndFinallyELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/preAndFinally/PreAndFinallyELSpringbootTest.java index b652e25ef..2e9d4841f 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/preAndFinally/PreAndFinallyELSpringbootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/preAndFinally/PreAndFinallyELSpringbootTest.java @@ -7,9 +7,9 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; /** * springboot环境下pre节点和finally节点的测试 @@ -18,7 +18,7 @@ import org.noear.solon.test.annotation.TestPropertySource; * @since 2.6.4 */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/preAndFinally/application.properties") +@Import(profiles="classpath:/preAndFinally/application.properties") public class PreAndFinallyELSpringbootTest extends BaseTest { @Inject diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/privateDelivery/PrivateDeliveryELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/privateDelivery/PrivateDeliveryELSpringbootTest.java index ed0558750..2d5498757 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/privateDelivery/PrivateDeliveryELSpringbootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/privateDelivery/PrivateDeliveryELSpringbootTest.java @@ -8,9 +8,9 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; /** * springboot环境下隐私投递的测试 @@ -19,7 +19,7 @@ import org.noear.solon.test.annotation.TestPropertySource; * @since 2.5.0 */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/privateDelivery/application.properties") +@Import(profiles="classpath:/privateDelivery/application.properties") public class PrivateDeliveryELSpringbootTest extends BaseTest { @Inject diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/refreshRule/RefreshRuleELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/refreshRule/RefreshRuleELSpringbootTest.java index 605880ee6..33a870d20 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/refreshRule/RefreshRuleELSpringbootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/refreshRule/RefreshRuleELSpringbootTest.java @@ -9,9 +9,9 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; /** * springboot环境下重新加载规则测试 @@ -20,7 +20,7 @@ import org.noear.solon.test.annotation.TestPropertySource; * @since 2.6.4 */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/refreshRule/application.properties") +@Import(profiles="classpath:/refreshRule/application.properties") public class RefreshRuleELSpringbootTest extends BaseTest { @Inject diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/reload/ReloadELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/reload/ReloadELSpringbootTest.java index a42a3112b..07b7666b4 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/reload/ReloadELSpringbootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/reload/ReloadELSpringbootTest.java @@ -6,9 +6,9 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; /** * springboot环境下重新加载规则测试 @@ -17,7 +17,7 @@ import org.noear.solon.test.annotation.TestPropertySource; * @since 2.5.0 */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/reload/application.properties") +@Import(profiles="classpath:/reload/application.properties") public class ReloadELSpringbootTest extends BaseTest { @Inject diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/removeChain/RemoveChainELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/removeChain/RemoveChainELSpringbootTest.java index c9d81b0b8..38a201f96 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/removeChain/RemoveChainELSpringbootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/removeChain/RemoveChainELSpringbootTest.java @@ -7,9 +7,9 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; /** * springboot环境最普通的例子测试 @@ -18,7 +18,7 @@ import org.noear.solon.test.annotation.TestPropertySource; * @since 2.6.4 */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/removeChain/application.properties") +@Import(profiles="classpath:/removeChain/application.properties") public class RemoveChainELSpringbootTest extends BaseTest { @Inject diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/requestId/LiteflowRequestIdELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/requestId/LiteflowRequestIdELSpringbootTest.java index 269add359..95ef6040d 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/requestId/LiteflowRequestIdELSpringbootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/requestId/LiteflowRequestIdELSpringbootTest.java @@ -6,15 +6,15 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; /** * @author tangkc */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/requestId/application.properties") +@Import(profiles="classpath:/requestId/application.properties") public class LiteflowRequestIdELSpringbootTest extends BaseTest { @Inject diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/rollback/RollbackSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/rollback/RollbackSpringbootTest.java index fdaa63d62..03f08da50 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/rollback/RollbackSpringbootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/rollback/RollbackSpringbootTest.java @@ -7,13 +7,14 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; import org.noear.solon.test.annotation.TestPropertySource; @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/rollback/application.properties") +@Import(profiles="classpath:/rollback/application.properties") public class RollbackSpringbootTest extends BaseTest { @Inject diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/subflow/ImplicitSubFlowELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/subflow/ImplicitSubFlowELSpringbootTest.java index d463b70ac..dba7ce268 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/subflow/ImplicitSubFlowELSpringbootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/subflow/ImplicitSubFlowELSpringbootTest.java @@ -7,9 +7,9 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; import java.util.HashSet; import java.util.Set; @@ -20,7 +20,7 @@ import java.util.Set; * @author justin.xu */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/subflow/application-implicit.properties") +@Import(profiles="classpath:/subflow/application-implicit.properties") public class ImplicitSubFlowELSpringbootTest extends BaseTest { @Inject diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/subflow/SubflowInDifferentConfigELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/subflow/SubflowInDifferentConfigELSpringbootTest.java index 46d611a9a..9f85741a8 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/subflow/SubflowInDifferentConfigELSpringbootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/subflow/SubflowInDifferentConfigELSpringbootTest.java @@ -8,10 +8,10 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; -import org.noear.solon.core.AopContext; +import org.noear.solon.core.AppContext; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; /** * 测试主流程与子流程在不同的配置文件的场景 @@ -19,7 +19,7 @@ import org.noear.solon.test.annotation.TestPropertySource; * @author Bryan.Zhang */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/subflow/application-subInDifferentConfig1.properties") +@Import(profiles = "classpath:/subflow/application-subInDifferentConfig1.properties") public class SubflowInDifferentConfigELSpringbootTest extends BaseTest { @Inject @@ -34,7 +34,7 @@ public class SubflowInDifferentConfigELSpringbootTest extends BaseTest { } @Inject - private AopContext context; + private AppContext context; // 主要测试有不同的配置类型后会不会报出既定的错误 @Test diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/subflow/SubflowXMLELSpringBootTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/subflow/SubflowXMLELSpringBootTest.java index 30d2e5ee4..428d218fa 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/subflow/SubflowXMLELSpringBootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/subflow/SubflowXMLELSpringBootTest.java @@ -6,9 +6,9 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; /** * 测试显示调用子流程(xml) 单元测试 @@ -16,7 +16,7 @@ import org.noear.solon.test.annotation.TestPropertySource; * @author justin.xu */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/subflow/application-xml.properties") +@Import(profiles ="classpath:/subflow/application-xml.properties") public class SubflowXMLELSpringBootTest extends BaseTest { @Inject diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/subflow/SubflowYmlELSpringBootTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/subflow/SubflowYmlELSpringBootTest.java index a85349784..d0bffb02d 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/subflow/SubflowYmlELSpringBootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/subflow/SubflowYmlELSpringBootTest.java @@ -6,9 +6,9 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; /** * 测试显示调用子流程(yml) 单元测试 @@ -16,7 +16,7 @@ import org.noear.solon.test.annotation.TestPropertySource; * @author justin.xu */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/subflow/application-yml.properties") +@Import(profiles ="classpath:/subflow/application-yml.properties") public class SubflowYmlELSpringBootTest extends BaseTest { @Inject diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/subflow2/SubflowJsonELSpringBootTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/subflow2/SubflowJsonELSpringBootTest.java index 512d4870f..b0bf2c19f 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/subflow2/SubflowJsonELSpringBootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/subflow2/SubflowJsonELSpringBootTest.java @@ -6,9 +6,9 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; /** * 测试显示调用子流程(json) 单元测试 @@ -16,7 +16,7 @@ import org.noear.solon.test.annotation.TestPropertySource; * @author justin.xu */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/subflow/application-json.properties") +@Import(profiles ="classpath:/subflow/application-json.properties") public class SubflowJsonELSpringBootTest extends BaseTest { @Inject diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/switchcase/SwitchELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/switchcase/SwitchELSpringbootTest.java index 7d1b2c09f..54cabd667 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/switchcase/SwitchELSpringbootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/switchcase/SwitchELSpringbootTest.java @@ -6,9 +6,9 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; /** * springboot环境EL常规的例子测试 @@ -16,7 +16,7 @@ import org.noear.solon.test.annotation.TestPropertySource; * @author Bryan.Zhang */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/switchcase/application.properties") +@Import(profiles ="classpath:/switchcase/application.properties") public class SwitchELSpringbootTest extends BaseTest { @Inject diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/tag/NodeTagELSpringbootJsonTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/tag/NodeTagELSpringbootJsonTest.java index d5301e3f3..277096fd8 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/tag/NodeTagELSpringbootJsonTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/tag/NodeTagELSpringbootJsonTest.java @@ -8,9 +8,9 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; /** * springboot环境下隐私投递的测试 @@ -19,7 +19,7 @@ import org.noear.solon.test.annotation.TestPropertySource; * @since 2.5.0 */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/tag/application-json.properties") +@Import(profiles ="classpath:/tag/application-json.properties") public class NodeTagELSpringbootJsonTest extends BaseTest { @Inject diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/tag/NodeTagELSpringbootXmlTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/tag/NodeTagELSpringbootXmlTest.java index a25f63b63..2d123f80c 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/tag/NodeTagELSpringbootXmlTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/tag/NodeTagELSpringbootXmlTest.java @@ -8,9 +8,9 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; /** * springboot环境下隐私投递的测试 @@ -19,7 +19,7 @@ import org.noear.solon.test.annotation.TestPropertySource; * @since 2.5.0 */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/tag/application-xml.properties") +@Import(profiles ="classpath:/tag/application-xml.properties") public class NodeTagELSpringbootXmlTest extends BaseTest { @Inject diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/UseTTLInWhenELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/UseTTLInWhenELSpringbootTest.java index f12ece677..49b7cd5f6 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/UseTTLInWhenELSpringbootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/UseTTLInWhenELSpringbootTest.java @@ -7,9 +7,9 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; /** * 在when异步节点的情况下去拿ThreadLocal里的测试场景 @@ -18,7 +18,7 @@ import org.noear.solon.test.annotation.TestPropertySource; * @since 2.6.3 */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/useTTLInWhen/application.properties") +@Import(profiles ="classpath:/useTTLInWhen/application.properties") public class UseTTLInWhenELSpringbootTest extends BaseTest { @Inject diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/whenTimeOut/WhenTimeOutELSpringbootTest1.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/whenTimeOut/WhenTimeOutELSpringbootTest1.java index 904fbcc9b..4d109e4da 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/whenTimeOut/WhenTimeOutELSpringbootTest1.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/whenTimeOut/WhenTimeOutELSpringbootTest1.java @@ -7,9 +7,9 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -20,7 +20,7 @@ import org.slf4j.LoggerFactory; * @since 2.6.4 */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/whenTimeOut/application1.properties") +@Import(profiles ="classpath:/whenTimeOut/application1.properties") public class WhenTimeOutELSpringbootTest1 extends BaseTest { private final Logger log = LoggerFactory.getLogger(this.getClass()); diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/whenTimeOut/WhenTimeOutELSpringbootTest2.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/whenTimeOut/WhenTimeOutELSpringbootTest2.java index 3612d67d3..f797525f1 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/whenTimeOut/WhenTimeOutELSpringbootTest2.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/whenTimeOut/WhenTimeOutELSpringbootTest2.java @@ -6,9 +6,9 @@ import com.yomahub.liteflow.test.BaseTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.noear.solon.annotation.Import; import org.noear.solon.annotation.Inject; import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -19,7 +19,7 @@ import org.slf4j.LoggerFactory; * @since 2.6.4 */ @ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/whenTimeOut/application2.properties") +@Import(profiles ="classpath:/whenTimeOut/application2.properties") public class WhenTimeOutELSpringbootTest2 extends BaseTest { private final Logger log = LoggerFactory.getLogger(this.getClass()); diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/pom.xml b/liteflow-testcase-el/liteflow-testcase-el-springboot/pom.xml index 5a7a63a07..2d0f915a0 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-springboot/pom.xml +++ b/liteflow-testcase-el/liteflow-testcase-el-springboot/pom.xml @@ -19,6 +19,12 @@ ${revision} + + com.yomahub + liteflow-el-builder + ${revision} + + org.springframework.boot spring-boot-starter-test diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/endlessLoop/FlowInDifferentConfigELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/endlessLoop/FlowInDifferentConfigELSpringbootTest.java index 90efa473c..39b9cd1e2 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/endlessLoop/FlowInDifferentConfigELSpringbootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/endlessLoop/FlowInDifferentConfigELSpringbootTest.java @@ -28,7 +28,7 @@ public class FlowInDifferentConfigELSpringbootTest extends BaseTest { private FlowExecutor flowExecutor; // 测试 chain 死循环 - @Test + //@Test public void testChainEndlessLoop() { Assertions.assertThrows(CyclicDependencyException.class, () -> { LiteflowConfig config = LiteflowConfigGetter.get(); diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/endlessLoop/FlowJsonELSpringBootTest.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/endlessLoop/FlowJsonELSpringBootTest.java index 8bcb71cbf..74d6379e2 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/endlessLoop/FlowJsonELSpringBootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/endlessLoop/FlowJsonELSpringBootTest.java @@ -28,7 +28,7 @@ public class FlowJsonELSpringBootTest extends BaseTest { private FlowExecutor flowExecutor; // 测试 chain 死循环 - @Test + //@Test public void testChainEndlessLoop() { Assertions.assertThrows(CyclicDependencyException.class, () -> { LiteflowConfig config = LiteflowConfigGetter.get(); diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/endlessLoop/FlowXMLELSpringBootTest.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/endlessLoop/FlowXMLELSpringBootTest.java index 585cb02eb..1104e30cd 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/endlessLoop/FlowXMLELSpringBootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/endlessLoop/FlowXMLELSpringBootTest.java @@ -28,7 +28,7 @@ public class FlowXMLELSpringBootTest extends BaseTest { private FlowExecutor flowExecutor; // 测试 chain 死循环 - @Test + //@Test public void testChainEndlessLoop() { Assertions.assertThrows(CyclicDependencyException.class, () -> { LiteflowConfig config = LiteflowConfigGetter.get(); diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/endlessLoop/FlowYmlELSpringBootTest.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/endlessLoop/FlowYmlELSpringBootTest.java index 4df3d56db..e8ec0a0e4 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/endlessLoop/FlowYmlELSpringBootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/endlessLoop/FlowYmlELSpringBootTest.java @@ -28,7 +28,7 @@ public class FlowYmlELSpringBootTest extends BaseTest { private FlowExecutor flowExecutor; // 测试 chain 死循环 - @Test + //@Test public void testChainEndlessLoop() { Assertions.assertThrows(CyclicDependencyException.class, () -> { LiteflowConfig config = LiteflowConfigGetter.get(); diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/fallback/FallbackELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/fallback/FallbackELSpringbootTest.java index dfa7f1ab1..e0485ab0b 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/fallback/FallbackELSpringbootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/fallback/FallbackELSpringbootTest.java @@ -1,5 +1,8 @@ package com.yomahub.liteflow.test.fallback; +import com.yomahub.liteflow.builder.el.ELBus; +import com.yomahub.liteflow.builder.el.ELWrapper; +import com.yomahub.liteflow.builder.el.LiteFlowChainELBuilder; import com.yomahub.liteflow.core.FlowExecutor; import com.yomahub.liteflow.flow.LiteflowResponse; import com.yomahub.liteflow.test.BaseTest; @@ -222,4 +225,13 @@ public class FallbackELSpringbootTest extends BaseTest { String stepStr2 = response2.getExecuteStepStrWithoutTime(); Assertions.assertTrue("c==>ifn2".equals(stepStr2) || "ifn2==>c".equals(stepStr2)); } + + @Test + public void testWithElBuild(){ + ELWrapper el = ELBus.then("a", "b", "az"); + LiteFlowChainELBuilder.createChain().setChainId("elBuilder").setEL(el.toEL()).build(); + LiteflowResponse response = flowExecutor.execute2Resp("elBuilder"); + Assertions.assertTrue(response.isSuccess()); + Assertions.assertEquals("a==>b==>c", response.getExecuteStepStrWithoutTime()); + } } diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/loop/cmp/CCmp.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/loop/cmp/CCmp.java index eb8bc9d64..9de22280d 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/loop/cmp/CCmp.java +++ b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/loop/cmp/CCmp.java @@ -15,7 +15,6 @@ public class CCmp extends NodeComponent { @Override public void process() { - System.out.println(this.getLoopIndex()); System.out.println("CCmp executed!"); } diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/loop/cmp/DCmp.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/loop/cmp/DCmp.java index de42f8651..21602bea3 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/loop/cmp/DCmp.java +++ b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/loop/cmp/DCmp.java @@ -16,15 +16,7 @@ public class DCmp extends NodeComponent { @Override public void process() { - DefaultContext context = this.getFirstContextBean(); - String key = "test"; - if (context.hasData(key)) { - int count = context.getData(key); - context.setData(key, ++count); - } - else { - context.setData(key, 1); - } + System.out.println("DCmp executed!"); } } diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/loop/cmp/YCmp.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/loop/cmp/YCmp.java index c4bb114c9..b70b16114 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/loop/cmp/YCmp.java +++ b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/loop/cmp/YCmp.java @@ -10,9 +10,7 @@ public class YCmp extends NodeBreakComponent { @Override public boolean processBreak() throws Exception { - DefaultContext context = this.getFirstContextBean(); - int count = context.getData("test"); - return count > 3; + return this.getLoopIndex() > 2; } } diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/loop/cmp/ZCmp.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/loop/cmp/ZCmp.java index c7bb40e7c..1d464cae7 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/loop/cmp/ZCmp.java +++ b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/loop/cmp/ZCmp.java @@ -10,15 +10,7 @@ public class ZCmp extends NodeWhileComponent { @Override public boolean processWhile() throws Exception { - DefaultContext context = this.getFirstContextBean(); - String key = "test"; - if (context.hasData(key)) { - int count = context.getData("test"); - return count < 5; - } - else { - return true; - } + return this.getLoopIndex()<5; } } diff --git a/liteflow-testcase-el/liteflow-testcase-el-sql-springboot-dynamic/src/test/java/com/yomahub/liteflow/test/sql/SQLWithXmlELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-sql-springboot-dynamic/src/test/java/com/yomahub/liteflow/test/sql/SQLWithXmlELSpringbootTest.java index d694f7bf8..5282642e5 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-sql-springboot-dynamic/src/test/java/com/yomahub/liteflow/test/sql/SQLWithXmlELSpringbootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-sql-springboot-dynamic/src/test/java/com/yomahub/liteflow/test/sql/SQLWithXmlELSpringbootTest.java @@ -1,8 +1,13 @@ package com.yomahub.liteflow.test.sql; +import com.baomidou.dynamic.datasource.DynamicRoutingDataSource; +import com.baomidou.dynamic.datasource.ds.ItemDataSource; import com.yomahub.liteflow.core.FlowExecutor; import com.yomahub.liteflow.flow.LiteflowResponse; import com.yomahub.liteflow.test.BaseTest; +import com.zaxxer.hikari.HikariDataSource; +import com.zaxxer.hikari.HikariPoolMXBean; +import com.zaxxer.hikari.pool.HikariPool; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -13,6 +18,11 @@ import org.springframework.test.context.TestPropertySource; import org.springframework.test.context.junit.jupiter.SpringExtension; import javax.annotation.Resource; +import javax.sql.DataSource; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledThreadPoolExecutor; +import java.util.concurrent.TimeUnit; /** * @author tangkc @@ -27,6 +37,7 @@ public class SQLWithXmlELSpringbootTest extends BaseTest { @Resource private FlowExecutor flowExecutor; + @Test public void testSQLWithXml() { LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); diff --git a/liteflow-testcase-el/liteflow-testcase-el-sql-springboot-dynamic/src/test/resources/application-dynamic-data-source-xml.properties b/liteflow-testcase-el/liteflow-testcase-el-sql-springboot-dynamic/src/test/resources/application-dynamic-data-source-xml.properties index 8645c0b2e..283b01e89 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-sql-springboot-dynamic/src/test/resources/application-dynamic-data-source-xml.properties +++ b/liteflow-testcase-el/liteflow-testcase-el-sql-springboot-dynamic/src/test/resources/application-dynamic-data-source-xml.properties @@ -4,6 +4,9 @@ liteflow.rule-source-ext-data={\ "chainApplicationNameField":"application_name",\ "chainNameField":"chain_name",\ "elDataField":"EL_DATA",\ + "pollingEnabled": true,\ + "pollingIntervalSeconds": 10,\ + "pollingStartSeconds": 5,\ "scriptTableName":"script_node_table",\ "scriptApplicationNameField":"application_name",\ "scriptIdField":"script_node_id",\ @@ -21,11 +24,15 @@ spring.datasource.dynamic.datasource.h2-first.username=root1 spring.datasource.dynamic.datasource.h2-first.password=123456 spring.datasource.dynamic.datasource.h2-first.init.schema=classpath:/sql/schema.sql spring.datasource.dynamic.datasource.h2-first.init.data=classpath:/sql/data.sql +spring.datasource.dynamic.datasource.h2-first.hikari.min-idle=1 +spring.datasource.dynamic.datasource.h2-first.hikari.max-pool-size=5 spring.datasource.dynamic.datasource.h2-second.url=jdbc:h2:mem:test_db2 spring.datasource.dynamic.datasource.h2-second.username=root2 spring.datasource.dynamic.datasource.h2-second.password=123456 spring.datasource.dynamic.datasource.h2-second.init.schema=classpath:/sql/second/schema.sql spring.datasource.dynamic.datasource.h2-second.init.data=classpath:/sql/second/data.sql +spring.datasource.dynamic.datasource.h2-second.hikari.min-idle=1 +spring.datasource.dynamic.datasource.h2-second.hikari.max-pool-size=5 diff --git a/pom.xml b/pom.xml index 89ae0c398..d71032f10 100644 --- a/pom.xml +++ b/pom.xml @@ -39,7 +39,7 @@ - 2.11.4-BETA2 + 2.11.4.1 UTF-8 UTF-8 8 @@ -64,7 +64,7 @@ 1.14.10 1.8.13 1.2.3 - 2.5.3 + 2.6.5 4.1.84.Final 4.5.13 1.9.4 diff --git a/static/img/chicheng-banner.png b/static/img/chicheng-banner.png new file mode 100644 index 000000000..de72e259d Binary files /dev/null and b/static/img/chicheng-banner.png differ