diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/LiteFlowConditionBuilder.java b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/LiteFlowConditionBuilder.java deleted file mode 100644 index 34b762a31..000000000 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/LiteFlowConditionBuilder.java +++ /dev/null @@ -1,158 +0,0 @@ -package com.yomahub.liteflow.builder; - -import cn.hutool.core.collection.CollUtil; -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.core.util.StrUtil; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.flow.element.Chain; -import com.yomahub.liteflow.flow.element.condition.*; -import com.yomahub.liteflow.builder.entity.ExecutableEntity; -import com.yomahub.liteflow.flow.element.Node; -import com.yomahub.liteflow.enums.ConditionTypeEnum; -import com.yomahub.liteflow.exception.ExecutableItemNotFoundException; -import com.yomahub.liteflow.flow.FlowBus; -import com.yomahub.liteflow.parser.RegexEntity; -import com.yomahub.liteflow.parser.RegexNodeEntity; -import com.yomahub.liteflow.spi.holder.ContextAwareHolder; - -import java.util.List; - -/** - * Condition基于代码形式的组装器 - * @author Bryan.Zhang - * @since 2.6.8 - */ -public class LiteFlowConditionBuilder { - - protected Condition condition; - - public static LiteFlowConditionBuilder createCondition(ConditionTypeEnum conditionType){ - switch (conditionType){ - case TYPE_THEN: - return createThenCondition(); - case TYPE_WHEN: - return createWhenCondition(); - case TYPE_PRE: - return createPreCondition(); - case TYPE_FINALLY: - return createFinallyCondition(); - default: - return null; - } - } - - public static LiteFlowConditionBuilder createThenCondition(){ - return new LiteFlowConditionBuilder(new ThenCondition()); - } - - public static LiteFlowWhenConditionBuilder createWhenCondition(){ - return new LiteFlowWhenConditionBuilder(new WhenCondition()); - } - - public static LiteFlowConditionBuilder createPreCondition(){ - return new LiteFlowConditionBuilder(new PreCondition()); - } - - public static LiteFlowConditionBuilder createFinallyCondition(){ - return new LiteFlowConditionBuilder(new FinallyCondition()); - } - - public LiteFlowConditionBuilder(Condition condition){ - this.condition = condition; - } - - public LiteFlowConditionBuilder setValue(String value){ - if (StrUtil.isBlank(value)){ - return this; - } - String[] condArray = value.split(","); - - RegexEntity regexEntity; - String itemExpression; - for (String s : condArray) { - itemExpression = s.trim(); - regexEntity = RegexEntity.parse(itemExpression); - // 先转化为执行实体对象 - ExecutableEntity executableEntity = convertExecutableEntity(regexEntity); - // 构建节点或流程 - setExecutable(executableEntity); - } - return this; - } - - // 将正则表达式实体转化为执行实体 - private ExecutableEntity convertExecutableEntity(RegexEntity regexEntity) { - RegexNodeEntity item = regexEntity.getItem(); - ExecutableEntity executableEntity = new ExecutableEntity(item.getId(), item.getTag()); - if (ObjectUtil.isNotNull(regexEntity.getRealItemArray())) { - for (RegexNodeEntity realItem : regexEntity.getRealItemArray()) { - executableEntity.addNodeCondComponent(new ExecutableEntity(realItem.getId(), realItem.getTag())); - } - } - return executableEntity; - } - - // 设置执行节点或者流程 - public LiteFlowConditionBuilder setExecutable(ExecutableEntity executableEntity) { - if (FlowBus.containNode(executableEntity.getId())) { - Node node = FlowBus.copyNode(executableEntity.getId()); - node.setTag(executableEntity.getTag()); - - //如果没有条件节点,说明是普通组件,如果有条件节点,就去构建SwitchCondition - if (CollUtil.isEmpty(executableEntity.getNodeCondComponents())) { - this.condition.getExecutableList().add(node); - }else{ - buildSwitchNode(node, executableEntity.getNodeCondComponents()); - } - } else if (hasChain(executableEntity.getId())) { - Chain chain = FlowBus.getChain(executableEntity.getId()); - this.condition.getExecutableList().add(chain); - } else { - //元数据没有的话,从spring上下文再取一遍 - //这部分有2个目的 - //一是为了防止标有@Lazy懒加载的组件,二是spring负责扫描,而用动态代码的形式加载组件这种情况。 - NodeComponent nodeComponent = ContextAwareHolder.loadContextAware().getBean(executableEntity.getId()); - if (ObjectUtil.isNotNull(nodeComponent)){ - FlowBus.addSpringScanNode(executableEntity.getId(), nodeComponent); - setExecutable(executableEntity); - } else{ - String errorMsg = StrUtil.format("executable node[{}] is not found!", executableEntity.getId()); - throw new ExecutableItemNotFoundException(errorMsg); - } - } - return this; - } - - // 构建条件节点 - private void buildSwitchNode(Node node, List executableEntities) { - if (CollUtil.isEmpty(executableEntities)) { - return; - } - - SwitchCondition switchCondition = new SwitchCondition(); - switchCondition.setSwitchNode(node); - - for (ExecutableEntity realItem : executableEntities) { - if (FlowBus.containNode(realItem.getId())) { - Node targetNode = FlowBus.copyNode(realItem.getId()); - targetNode.setTag(realItem.getTag()); - switchCondition.addTargetItem(targetNode); - } else if (hasChain(realItem.getId())) { - Chain chain = FlowBus.getChain(realItem.getId()); - switchCondition.addTargetItem(chain); - } else{ - String errorMsg = StrUtil.format("executable node[{}] is not found!", realItem.getId()); - throw new ExecutableItemNotFoundException(errorMsg); - } - } - this.condition.getExecutableList().add(switchCondition); - } - - public Condition build(){ - return this.condition; - } - - private boolean hasChain(String chainId){ - return FlowBus.containChain(chainId); - } -} diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/LiteFlowWhenConditionBuilder.java b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/LiteFlowWhenConditionBuilder.java deleted file mode 100644 index f914a8c44..000000000 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/LiteFlowWhenConditionBuilder.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.yomahub.liteflow.builder; - -import cn.hutool.core.util.StrUtil; -import com.yomahub.liteflow.common.LocalDefaultFlowConstant; -import com.yomahub.liteflow.flow.element.condition.Condition; -import com.yomahub.liteflow.flow.element.condition.WhenCondition; - -/** - * WhenCondition基于代码形式的组装器 - * 这个为LiteFlowConditionBuilder的子类,因为when有单独的设置项,所以区分开 - * @author Bryan.Zhang - * @since 2.6.8 - */ -public class LiteFlowWhenConditionBuilder extends LiteFlowConditionBuilder{ - - public LiteFlowWhenConditionBuilder(Condition condition) { - super(condition); - } - - public LiteFlowWhenConditionBuilder setErrorResume(boolean errorResume){ - WhenCondition whenCondition = (WhenCondition) this.condition; - whenCondition.setErrorResume(errorResume); - return this; - } - - public LiteFlowWhenConditionBuilder setErrorResume(String errorResume){ - if (StrUtil.isBlank(errorResume)){ - return this; - } - return setErrorResume(Boolean.parseBoolean(errorResume)); - } - - public LiteFlowWhenConditionBuilder setGroup(String group){ - WhenCondition whenCondition = (WhenCondition) this.condition; - if (StrUtil.isBlank(group)){ - whenCondition.setGroup(LocalDefaultFlowConstant.DEFAULT); - }else{ - whenCondition.setGroup(group); - } - return this; - } - - public LiteFlowWhenConditionBuilder setAny(boolean any){ - WhenCondition whenCondition = (WhenCondition) this.condition; - whenCondition.setAny(any); - return this; - } - - public LiteFlowWhenConditionBuilder setAny(String any){ - if (StrUtil.isBlank(any)){ - return this; - } - return setAny(Boolean.parseBoolean(any)); - } - - - public LiteFlowWhenConditionBuilder setThreadExecutorClass(String executorServiceName){ - WhenCondition whenCondition = (WhenCondition) this.condition; - if (StrUtil.isBlank(executorServiceName)) { - return this; - } - whenCondition.setThreadExecutorClass(executorServiceName); - return this; - } -} diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/flow/FlowBus.java b/liteflow-core/src/main/java/com/yomahub/liteflow/flow/FlowBus.java index b00450087..681cd85ce 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/flow/FlowBus.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/flow/FlowBus.java @@ -8,7 +8,6 @@ */ package com.yomahub.liteflow.flow; -import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.ListUtil; import cn.hutool.core.map.MapUtil; import cn.hutool.core.util.ObjectUtil; @@ -20,9 +19,6 @@ import com.yomahub.liteflow.exception.ComponentCannotRegisterException; import com.yomahub.liteflow.exception.NullNodeTypeException; import com.yomahub.liteflow.flow.element.Chain; import com.yomahub.liteflow.flow.element.Node; -import com.yomahub.liteflow.parser.LocalJsonFlowParser; -import com.yomahub.liteflow.parser.LocalXmlFlowParser; -import com.yomahub.liteflow.parser.LocalYmlFlowParser; import com.yomahub.liteflow.parser.el.LocalJsonFlowELParser; import com.yomahub.liteflow.parser.el.LocalXmlFlowELParser; import com.yomahub.liteflow.parser.el.LocalYmlFlowELParser; @@ -315,13 +311,7 @@ public class FlowBus { } public static void refreshFlowMetaData(FlowParserTypeEnum type, String content) throws Exception { - if (type.equals(FlowParserTypeEnum.TYPE_XML)) { - new LocalXmlFlowParser().parse(content); - } else if (type.equals(FlowParserTypeEnum.TYPE_JSON)) { - new LocalJsonFlowParser().parse(content); - } else if (type.equals(FlowParserTypeEnum.TYPE_YML)) { - new LocalYmlFlowParser().parse(content); - } else if (type.equals(FlowParserTypeEnum.TYPE_EL_XML)) { + if (type.equals(FlowParserTypeEnum.TYPE_EL_XML)) { new LocalXmlFlowELParser().parse(content); } else if (type.equals(FlowParserTypeEnum.TYPE_EL_JSON)) { new LocalJsonFlowELParser().parse(content); diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/ClassJsonFlowParser.java b/liteflow-core/src/main/java/com/yomahub/liteflow/parser/ClassJsonFlowParser.java deleted file mode 100644 index f449a1813..000000000 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/ClassJsonFlowParser.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.yomahub.liteflow.parser; - -import cn.hutool.core.collection.ListUtil; - -import java.util.List; - -/** - * 基于自定义的Json方式解析器 - * @author guodongqing - * @since 1.2.5 - */ -public abstract class ClassJsonFlowParser extends JsonFlowParser { - @Override - public void parseMain(List pathList) throws Exception { - String content = parseCustom(); - parse(content); - } - - public abstract String parseCustom(); -} diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/ClassXmlFlowParser.java b/liteflow-core/src/main/java/com/yomahub/liteflow/parser/ClassXmlFlowParser.java deleted file mode 100644 index 2a4488ce9..000000000 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/ClassXmlFlowParser.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.yomahub.liteflow.parser; - -import cn.hutool.core.collection.ListUtil; - -import java.util.List; - -/** - * 基于自定义的xml方式解析器 - * @author Bryan.Zhang - */ -public abstract class ClassXmlFlowParser extends XmlFlowParser { - @Override - public void parseMain(List pathList) throws Exception { - String content = parseCustom(); - parse(content); - } - - public abstract String parseCustom(); -} diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/ClassYmlFlowParser.java b/liteflow-core/src/main/java/com/yomahub/liteflow/parser/ClassYmlFlowParser.java deleted file mode 100644 index 8eaea2300..000000000 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/ClassYmlFlowParser.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.yomahub.liteflow.parser; - -import cn.hutool.core.collection.ListUtil; - -import java.util.List; - -/** - * 基于自定义的Yml方式解析器 - * @author guodongqing - * @since 2.5.0 - */ -public abstract class ClassYmlFlowParser extends YmlFlowParser{ - @Override - public void parseMain(List pathList) throws Exception { - String content = parseCustom(); - parse(content); - } - - public abstract String parseCustom(); -} diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/JsonFlowParser.java b/liteflow-core/src/main/java/com/yomahub/liteflow/parser/JsonFlowParser.java deleted file mode 100644 index 56d65a31c..000000000 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/JsonFlowParser.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.yomahub.liteflow.parser; - -import com.fasterxml.jackson.databind.JsonNode; -import com.yomahub.liteflow.parser.base.BaseJsonFlowParser; -import com.yomahub.liteflow.parser.helper.ParserHelper; - -/** - * Json格式解析器 - * - * @author guodongqing - * @since 2.5.0 - */ -public abstract class JsonFlowParser extends BaseJsonFlowParser { - - /** - * 解析一个chain的过程 - */ - @Override - public void parseOneChain(JsonNode chainObject) { - ParserHelper.parseOneChain(chainObject); - } - -} diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/LocalJsonFlowParser.java b/liteflow-core/src/main/java/com/yomahub/liteflow/parser/LocalJsonFlowParser.java deleted file mode 100644 index 100e530fd..000000000 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/LocalJsonFlowParser.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.yomahub.liteflow.parser; - -import com.yomahub.liteflow.spi.holder.PathContentParserHolder; - -import java.util.List; - -/** - * @author guodongqing - * @since 2.5.0 - */ -public class LocalJsonFlowParser extends JsonFlowParser{ - - @Override - public void parseMain(List pathList) throws Exception { - List contentList = PathContentParserHolder.loadContextAware().parseContent(pathList); - parse(contentList); - } -} diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/LocalXmlFlowParser.java b/liteflow-core/src/main/java/com/yomahub/liteflow/parser/LocalXmlFlowParser.java deleted file mode 100644 index d6ecc28ec..000000000 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/LocalXmlFlowParser.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.parser; - -import com.yomahub.liteflow.spi.holder.PathContentParserHolder; - -import java.util.List; - -/** - * 基于本地的xml方式解析器 - * @author Bryan.Zhang - */ -public class LocalXmlFlowParser extends XmlFlowParser{ - - @Override - public void parseMain(List pathList) throws Exception { - List contentList = PathContentParserHolder.loadContextAware().parseContent(pathList); - parse(contentList); - } -} diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/LocalYmlFlowParser.java b/liteflow-core/src/main/java/com/yomahub/liteflow/parser/LocalYmlFlowParser.java deleted file mode 100644 index dc62c7e06..000000000 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/LocalYmlFlowParser.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.yomahub.liteflow.parser; - -import com.yomahub.liteflow.spi.holder.PathContentParserHolder; - -import java.util.List; - -/** - * Yaml格式转换 - * - * @author guodongqing - * @since 2.5.0 - */ -public class LocalYmlFlowParser extends YmlFlowParser { - - @Override - public void parseMain(List pathList) throws Exception { - List contentList = PathContentParserHolder.loadContextAware().parseContent(pathList); - parse(contentList); - } - -} diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/RegexEntity.java b/liteflow-core/src/main/java/com/yomahub/liteflow/parser/RegexEntity.java deleted file mode 100644 index 2ae964ed5..000000000 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/RegexEntity.java +++ /dev/null @@ -1,65 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.parser; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.function.Function; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import java.util.stream.Collectors; - -/** - * 正则实体,主要用于条件节点 - * @author Bryan.Zhang - */ -public class RegexEntity { - - private static final Pattern p = Pattern.compile("[^\\)\\(]+"); - - private RegexNodeEntity item; - - private RegexNodeEntity[] realItemArray; - - public static RegexEntity parse(String nodeStr){ - List list = new ArrayList(); - Matcher m = p.matcher(nodeStr); - while(m.find()){ - list.add(m.group()); - } - - RegexEntity regexEntity = new RegexEntity(); - regexEntity.setItem(RegexNodeEntity.parse(list.get(0))); - try{ - String[] array = list.get(1).split("\\|"); - - List regexNodeEntityList - = Arrays.stream(array).map(s -> RegexNodeEntity.parse(s.trim())).collect(Collectors.toList()); - - regexEntity.setRealItemArray(regexNodeEntityList.toArray(new RegexNodeEntity[]{})); - }catch (Exception ignored){} - return regexEntity; - } - - public RegexNodeEntity getItem() { - return item; - } - - public void setItem(RegexNodeEntity item) { - this.item = item; - } - - public RegexNodeEntity[] getRealItemArray() { - return realItemArray; - } - - public void setRealItemArray(RegexNodeEntity[] realItemArray) { - this.realItemArray = realItemArray; - } -} diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/RegexNodeEntity.java b/liteflow-core/src/main/java/com/yomahub/liteflow/parser/RegexNodeEntity.java deleted file mode 100644 index d806fe183..000000000 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/RegexNodeEntity.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.yomahub.liteflow.parser; - -import java.util.ArrayList; -import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * 节点解析,主要用于解析节点name的重命名 - * @author Bryan.Zhang - * @since 2.6.2 - */ -public class RegexNodeEntity { - - private static final Pattern p = Pattern.compile("[^\\[\\]]+"); - - private String id; - - private String tag; - - public static RegexNodeEntity parse(String itemStr){ - List list = new ArrayList(); - Matcher m = p.matcher(itemStr); - while(m.find()){ - list.add(m.group()); - } - - RegexNodeEntity regexNodeEntity = new RegexNodeEntity(); - regexNodeEntity.setId(list.get(0)); - try{ - regexNodeEntity.setTag(list.get(1)); - }catch (Exception ignored){} - return regexNodeEntity; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getTag() { - return tag; - } - - public void setTag(String tag) { - this.tag = tag; - } -} diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/XmlFlowParser.java b/liteflow-core/src/main/java/com/yomahub/liteflow/parser/XmlFlowParser.java deleted file mode 100644 index ccb99de31..000000000 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/XmlFlowParser.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.yomahub.liteflow.parser; - -import com.yomahub.liteflow.parser.base.BaseXmlFlowParser; -import com.yomahub.liteflow.parser.helper.ParserHelper; -import org.dom4j.Element; - -; - -/** - * xml形式的解析器 - * - * @author Bryan.Zhang - */ -public abstract class XmlFlowParser extends BaseXmlFlowParser { - - /** - * 解析一个chain的过程 - */ - @Override - public void parseOneChain(Element e) { - ParserHelper.parseOneChain(e); - } - -} diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/YmlFlowParser.java b/liteflow-core/src/main/java/com/yomahub/liteflow/parser/YmlFlowParser.java deleted file mode 100644 index c9133a86d..000000000 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/YmlFlowParser.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.yomahub.liteflow.parser; - -import com.fasterxml.jackson.databind.JsonNode; -import com.yomahub.liteflow.parser.base.BaseYmlFlowParser; -import com.yomahub.liteflow.parser.helper.ParserHelper; - -/** - * Yml格式解析器,转换为json格式进行解析 - * @author guodongqing - * @since 2.5.0 - */ -public abstract class YmlFlowParser extends BaseYmlFlowParser { - - /** - * 解析一个chain的过程 - */ - @Override - public void parseOneChain(JsonNode chainObject) { - ParserHelper.parseOneChain(chainObject); - } - -} diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/el/ClassJsonFlowELParser.java b/liteflow-core/src/main/java/com/yomahub/liteflow/parser/el/ClassJsonFlowELParser.java index 33dd4b685..e84a6677e 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/el/ClassJsonFlowELParser.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/parser/el/ClassJsonFlowELParser.java @@ -1,7 +1,5 @@ package com.yomahub.liteflow.parser.el; -import com.yomahub.liteflow.parser.JsonFlowParser; - import java.util.List; /** diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/factory/ClassParserFactory.java b/liteflow-core/src/main/java/com/yomahub/liteflow/parser/factory/ClassParserFactory.java index ed1be9691..adcb7b3f4 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/factory/ClassParserFactory.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/parser/factory/ClassParserFactory.java @@ -1,8 +1,5 @@ package com.yomahub.liteflow.parser.factory; -import com.yomahub.liteflow.parser.JsonFlowParser; -import com.yomahub.liteflow.parser.XmlFlowParser; -import com.yomahub.liteflow.parser.YmlFlowParser; import com.yomahub.liteflow.parser.base.BaseJsonFlowParser; import com.yomahub.liteflow.parser.base.BaseXmlFlowParser; import com.yomahub.liteflow.parser.base.BaseYmlFlowParser; @@ -19,24 +16,6 @@ import com.yomahub.liteflow.spi.holder.ContextAwareHolder; */ public class ClassParserFactory implements FlowParserFactory { - @Override - public JsonFlowParser createJsonParser(String path) { - Class c = forName(path); - return (JsonFlowParser) ContextAwareHolder.loadContextAware().registerBean(c); - } - - @Override - public XmlFlowParser createXmlParser(String path) { - Class c = forName(path); - return (XmlFlowParser) ContextAwareHolder.loadContextAware().registerBean(c); - } - - @Override - public YmlFlowParser createYmlParser(String path) { - Class c = forName(path); - return (YmlFlowParser) ContextAwareHolder.loadContextAware().registerBean(c); - } - @Override public BaseJsonFlowParser createJsonELParser(String path) { Class c = forName(path); diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/factory/FlowParserFactory.java b/liteflow-core/src/main/java/com/yomahub/liteflow/parser/factory/FlowParserFactory.java index 8330d3ca5..813d2a7a7 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/factory/FlowParserFactory.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/parser/factory/FlowParserFactory.java @@ -12,12 +12,6 @@ import com.yomahub.liteflow.parser.base.BaseYmlFlowParser; */ public interface FlowParserFactory { - BaseJsonFlowParser createJsonParser(String path); - - BaseXmlFlowParser createXmlParser(String path); - - BaseYmlFlowParser createYmlParser(String path); - BaseJsonFlowParser createJsonELParser(String path); BaseXmlFlowParser createXmlELParser(String path); diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/factory/FlowParserProvider.java b/liteflow-core/src/main/java/com/yomahub/liteflow/parser/factory/FlowParserProvider.java index 2526837b0..2b9c48d66 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/factory/FlowParserProvider.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/parser/factory/FlowParserProvider.java @@ -4,9 +4,6 @@ import cn.hutool.core.util.ReUtil; import cn.hutool.core.util.StrUtil; import com.yomahub.liteflow.core.FlowExecutor; import com.yomahub.liteflow.exception.ErrorSupportPathException; -import com.yomahub.liteflow.parser.ClassJsonFlowParser; -import com.yomahub.liteflow.parser.ClassXmlFlowParser; -import com.yomahub.liteflow.parser.ClassYmlFlowParser; import com.yomahub.liteflow.parser.base.FlowParser; import com.yomahub.liteflow.parser.el.ClassJsonFlowELParser; import com.yomahub.liteflow.parser.el.ClassXmlFlowELParser; @@ -49,9 +46,9 @@ public class FlowParserProvider { */ private static final Map, Function> LOCAL_PARSER_DICT = new HashMap, Function>() {{ - put(path -> ReUtil.isMatch(LOCAL_XML_CONFIG_REGEX, path), LOCAL_PARSER_FACTORY::createXmlParser); - put(path -> ReUtil.isMatch(LOCAL_JSON_CONFIG_REGEX, path), LOCAL_PARSER_FACTORY::createJsonParser); - put(path -> ReUtil.isMatch(LOCAL_YML_CONFIG_REGEX, path), LOCAL_PARSER_FACTORY::createYmlParser); + put(path -> ReUtil.isMatch(LOCAL_XML_CONFIG_REGEX, path), LOCAL_PARSER_FACTORY::createXmlELParser); + put(path -> ReUtil.isMatch(LOCAL_JSON_CONFIG_REGEX, path), LOCAL_PARSER_FACTORY::createJsonELParser); + put(path -> ReUtil.isMatch(LOCAL_YML_CONFIG_REGEX, path), LOCAL_PARSER_FACTORY::createYmlELParser); put(path -> ReUtil.isMatch(LOCAL_EL_XML_CONFIG_REGEX, path), LOCAL_PARSER_FACTORY::createXmlELParser); put(path -> ReUtil.isMatch(LOCAL_EL_JSON_CONFIG_REGEX, path), LOCAL_PARSER_FACTORY::createJsonELParser); put(path -> ReUtil.isMatch(LOCAL_EL_YML_CONFIG_REGEX, path), LOCAL_PARSER_FACTORY::createYmlELParser); @@ -68,9 +65,6 @@ public class FlowParserProvider { */ private static final Map>, Function> CLASS_PARSER_DICT = new HashMap>, Function>() {{ - put(ClassXmlFlowParser.class::isAssignableFrom, CLASS_PARSER_FACTORY::createXmlParser); - put(ClassJsonFlowParser.class::isAssignableFrom, CLASS_PARSER_FACTORY::createJsonParser); - put(ClassYmlFlowParser.class::isAssignableFrom, CLASS_PARSER_FACTORY::createYmlParser); put(ClassXmlFlowELParser.class::isAssignableFrom, CLASS_PARSER_FACTORY::createXmlELParser); put(ClassJsonFlowELParser.class::isAssignableFrom, CLASS_PARSER_FACTORY::createJsonELParser); put(ClassYmlFlowELParser.class::isAssignableFrom, CLASS_PARSER_FACTORY::createYmlELParser); diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/factory/LocalParserFactory.java b/liteflow-core/src/main/java/com/yomahub/liteflow/parser/factory/LocalParserFactory.java index 89a6b88a1..0a46afdfa 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/factory/LocalParserFactory.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/parser/factory/LocalParserFactory.java @@ -11,21 +11,6 @@ import com.yomahub.liteflow.parser.el.*; */ public class LocalParserFactory implements FlowParserFactory { - @Override - public JsonFlowParser createJsonParser(String path) { - return new LocalJsonFlowParser(); - } - - @Override - public XmlFlowParser createXmlParser(String path) { - return new LocalXmlFlowParser(); - } - - @Override - public YmlFlowParser createYmlParser(String path) { - return new LocalYmlFlowParser(); - } - @Override public JsonFlowELParser createJsonELParser(String path) { return new LocalJsonFlowELParser(); diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/helper/ParserHelper.java b/liteflow-core/src/main/java/com/yomahub/liteflow/parser/helper/ParserHelper.java index 2234940b9..7f038ad9b 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/helper/ParserHelper.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/parser/helper/ParserHelper.java @@ -3,30 +3,23 @@ package com.yomahub.liteflow.parser.helper; import cn.hutool.core.annotation.AnnotationUtil; import cn.hutool.core.text.CharSequenceUtil; import cn.hutool.core.util.ObjectUtil; -import cn.hutool.core.util.ReflectUtil; import cn.hutool.core.util.StrUtil; import com.fasterxml.jackson.databind.JsonNode; import com.yomahub.liteflow.annotation.*; import com.yomahub.liteflow.builder.LiteFlowChainBuilder; -import com.yomahub.liteflow.builder.LiteFlowConditionBuilder; import com.yomahub.liteflow.builder.LiteFlowNodeBuilder; import com.yomahub.liteflow.builder.el.LiteFlowChainELBuilder; import com.yomahub.liteflow.builder.prop.ChainPropBean; import com.yomahub.liteflow.builder.prop.NodePropBean; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.core.NodeIfComponent; -import com.yomahub.liteflow.core.NodeSwitchComponent; import com.yomahub.liteflow.enums.ConditionTypeEnum; import com.yomahub.liteflow.enums.NodeTypeEnum; import com.yomahub.liteflow.exception.*; import com.yomahub.liteflow.flow.FlowBus; -import com.yomahub.liteflow.util.JsonUtil; import org.dom4j.Document; import org.dom4j.Element; import java.util.Iterator; import java.util.List; -import java.util.Map; import java.util.Set; import java.util.function.Consumer; import java.util.regex.Pattern; @@ -140,48 +133,6 @@ public class ParserHelper { .build(); } - /** - * 构建 chain - * - * @param chainPropBean 构建 chain 的中间属性 - * @param chainBuilder chainBuilder - */ - public static void buildChain(ChainPropBean chainPropBean, LiteFlowChainBuilder chainBuilder) { - String condValueStr = chainPropBean.getCondValueStr(); - String group = chainPropBean.getGroup(); - String errorResume = chainPropBean.getErrorResume(); - String any = chainPropBean.getAny(); - String threadExecutorClass = chainPropBean.getThreadExecutorClass(); - ConditionTypeEnum conditionType = chainPropBean.getConditionType(); - - if (ObjectUtil.isNull(conditionType)) { - throw new NotSupportConditionException("ConditionType is not supported"); - } - - if (StrUtil.isBlank(condValueStr)) { - throw new EmptyConditionValueException("Condition value cannot be empty"); - } - - //如果是when类型的话,有特殊化参数要设置,只针对于when的 - if (conditionType.equals(ConditionTypeEnum.TYPE_WHEN)) { - chainBuilder.setCondition( - LiteFlowConditionBuilder.createWhenCondition() - .setErrorResume(errorResume) - .setGroup(group) - .setAny(any) - .setThreadExecutorClass(threadExecutorClass) - .setValue(condValueStr) - .build() - ).build(); - } else { - chainBuilder.setCondition( - LiteFlowConditionBuilder.createCondition(conditionType) - .setValue(condValueStr) - .build() - ).build(); - } - } - /** * xml 形式的主要解析过程 * @@ -307,83 +258,6 @@ public class ParserHelper { } } - - /** - * 解析一个chain的过程 - * - * @param chainNode chain 节点 - */ - public static void parseOneChain(JsonNode chainNode) { - String condValueStr; - ConditionTypeEnum conditionType; - String group; - String errorResume; - String any; - String threadExecutorClass; - - //构建chainBuilder - String chainName = chainNode.get(NAME).textValue(); - LiteFlowChainBuilder chainBuilder = LiteFlowChainBuilder.createChain().setChainName(chainName); - Iterator iterator = chainNode.get(CONDITION).iterator(); - while (iterator.hasNext()) { - JsonNode condNode = iterator.next(); - conditionType = ConditionTypeEnum.getEnumByCode(condNode.get(TYPE).textValue()); - condValueStr = condNode.get(VALUE).textValue(); - errorResume = condNode.hasNonNull(ERROR_RESUME) ? condNode.get(ERROR_RESUME).textValue() : ""; - group = condNode.hasNonNull(GROUP) ? condNode.get(GROUP).textValue() : ""; - any = condNode.hasNonNull(ANY) ? condNode.get(ANY).textValue() : ""; - threadExecutorClass = condNode.hasNonNull(THREAD_EXECUTOR_CLASS) ? condNode.get(THREAD_EXECUTOR_CLASS).textValue() : ""; - - ChainPropBean chainPropBean = new ChainPropBean() - .setCondValueStr(condValueStr) - .setGroup(group) - .setErrorResume(errorResume) - .setAny(any) - .setThreadExecutorClass(threadExecutorClass) - .setConditionType(conditionType); - - // 构建 chain - ParserHelper.buildChain(chainPropBean, chainBuilder); - } - } - /** - * 解析一个chain的过程 - * @param e chain 节点 - */ - public static void parseOneChain(Element e) { - String condValueStr; - String group; - String errorResume; - String any; - String threadExecutorClass; - ConditionTypeEnum conditionType; - - //构建chainBuilder - String chainName = e.attributeValue(NAME); - LiteFlowChainBuilder chainBuilder = LiteFlowChainBuilder.createChain().setChainName(chainName); - - for (Iterator it = e.elementIterator(); it.hasNext(); ) { - Element condE = it.next(); - conditionType = ConditionTypeEnum.getEnumByCode(condE.getName()); - condValueStr = condE.attributeValue(VALUE); - errorResume = condE.attributeValue(ERROR_RESUME); - group = condE.attributeValue(GROUP); - any = condE.attributeValue(ANY); - threadExecutorClass = condE.attributeValue(THREAD_EXECUTOR_CLASS); - - ChainPropBean chainPropBean = new ChainPropBean() - .setCondValueStr(condValueStr) - .setGroup(group) - .setErrorResume(errorResume) - .setAny(any) - .setThreadExecutorClass(threadExecutorClass) - .setConditionType(conditionType); - - // 构建 chain - ParserHelper.buildChain(chainPropBean, chainBuilder); - } - } - /** * 解析一个chain的过程 * diff --git a/liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/java/com/yomahub/liteflow/test/builder/BuilderELDeclMultiSpringbootTest1.java b/liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/java/com/yomahub/liteflow/test/builder/BuilderELDeclMultiSpringbootTest1.java index 3d376ed45..d09596292 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/java/com/yomahub/liteflow/test/builder/BuilderELDeclMultiSpringbootTest1.java +++ b/liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/java/com/yomahub/liteflow/test/builder/BuilderELDeclMultiSpringbootTest1.java @@ -1,7 +1,6 @@ package com.yomahub.liteflow.test.builder; import com.yomahub.liteflow.builder.LiteFlowChainBuilder; -import com.yomahub.liteflow.builder.LiteFlowConditionBuilder; import com.yomahub.liteflow.builder.LiteFlowNodeBuilder; import com.yomahub.liteflow.builder.el.LiteFlowChainELBuilder; import com.yomahub.liteflow.builder.entity.ExecutableEntity; @@ -123,17 +122,12 @@ public class BuilderELDeclMultiSpringbootTest1 extends BaseTest { .build(); - LiteFlowChainBuilder.createChain().setChainName("chain2").setCondition( - LiteFlowConditionBuilder.createThenCondition().setValue("c,d").build() + LiteFlowChainELBuilder.createChain().setChainName("chain2").setEL( + "THEN(c, d)" ).build(); - LiteFlowChainBuilder.createChain().setChainName("chain1").setCondition( - LiteFlowConditionBuilder - .createThenCondition() - .setValue("a,b").build() - ).setCondition( - LiteFlowConditionBuilder.createWhenCondition() - .setValue("e(f|g|chain2)").build() + LiteFlowChainELBuilder.createChain().setChainName("chain1").setEL( + "THEN(a, b, WHEN(SWITCH(e).to(f, g, chain2)))" ).build(); LiteflowResponse response = flowExecutor.execute2Resp("chain1"); @@ -142,71 +136,35 @@ public class BuilderELDeclMultiSpringbootTest1 extends BaseTest { } - //基于普通组件的builder模式测试 @Test - public void testBuilderForConditionNode() throws Exception { - LiteFlowNodeBuilder.createNode().setId("a") - .setName("组件A") + public void testBuilderForSameNodeMultiTimes() throws Exception { + LiteFlowNodeBuilder.createNode().setId("a1") + .setName("组件A1") .setType(NodeTypeEnum.COMMON) .setClazz(ACmp.class) .build(); - LiteFlowNodeBuilder.createNode().setId("b") - .setName("组件B") + LiteFlowNodeBuilder.createNode().setId("a2") + .setName("组件A2") .setType(NodeTypeEnum.COMMON) - .setClazz(BCmp.class) + .setClazz(ACmp.class) .build(); - LiteFlowNodeBuilder.createNode().setId("c") - .setName("组件C") + LiteFlowNodeBuilder.createNode().setId("c1") + .setName("组件C1") .setType(NodeTypeEnum.COMMON) .setClazz(CCmp.class) .build(); - LiteFlowNodeBuilder.createNode().setId("d") - .setName("组件D") + LiteFlowNodeBuilder.createNode().setId("c2") + .setName("组件C2") .setType(NodeTypeEnum.COMMON) - .setClazz(DCmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("e") - .setName("组件E") - .setType(NodeTypeEnum.SWITCH) - .setClazz(ECmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("f") - .setName("组件F") - .setType(NodeTypeEnum.COMMON) - .setClazz(FCmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("g") - .setName("组件G") - .setType(NodeTypeEnum.COMMON) - .setClazz(GCmp.class) + .setClazz(CCmp.class) .build(); - - LiteFlowChainBuilder.createChain().setChainName("chain2").setCondition( - LiteFlowConditionBuilder.createThenCondition() - .setExecutable(new ExecutableEntity().setId("c")) - .setExecutable(new ExecutableEntity().setId("d")) - .build() - ).build(); - - LiteFlowChainBuilder.createChain().setChainName("chain1").setCondition( - LiteFlowConditionBuilder - .createThenCondition() - .setExecutable(new ExecutableEntity().setId("a").setTag("hello")) - .setExecutable(new ExecutableEntity().setId("b")) - .build() - ).setCondition( - LiteFlowConditionBuilder.createWhenCondition() - .setExecutable( - new ExecutableEntity().setId("e") - .addNodeCondComponent(new ExecutableEntity().setId("f").setTag("FHello")) - .addNodeCondComponent(new ExecutableEntity().setId("g")) - .addNodeCondComponent(new ExecutableEntity().setId("chain2") - )).build() + LiteFlowChainELBuilder.createChain().setChainName("chain1").setEL( + "THEN(a1,c2,a2,c1)" ).build(); LiteflowResponse response = flowExecutor.execute2Resp("chain1"); Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a[组件A]==>b[组件B]==>e[组件E]==>c[组件C]==>d[组件D]", response.getExecuteStepStr()); + Assert.assertEquals("a1[组件A1]==>c2[组件C2]==>a2[组件A2]==>c1[组件C1]", response.getExecuteStepStr()); } } diff --git a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/BuilderELDeclSpringbootTest2.java b/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/BuilderELDeclSpringbootTest2.java index 73c6402f2..e0de93873 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/BuilderELDeclSpringbootTest2.java +++ b/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/BuilderELDeclSpringbootTest2.java @@ -1,7 +1,5 @@ package com.yomahub.liteflow.test.builder; -import com.yomahub.liteflow.builder.LiteFlowChainBuilder; -import com.yomahub.liteflow.builder.LiteFlowConditionBuilder; import com.yomahub.liteflow.builder.el.LiteFlowChainELBuilder; import com.yomahub.liteflow.core.FlowExecutor; import com.yomahub.liteflow.flow.LiteflowResponse; diff --git a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/builder/BuilderTest.java b/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/builder/BuilderTest.java index ef1d57115..8fc172c81 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/builder/BuilderTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/builder/BuilderTest.java @@ -1,8 +1,8 @@ package com.yomahub.liteflow.test.builder; import com.yomahub.liteflow.builder.LiteFlowChainBuilder; -import com.yomahub.liteflow.builder.LiteFlowConditionBuilder; import com.yomahub.liteflow.builder.LiteFlowNodeBuilder; +import com.yomahub.liteflow.builder.el.LiteFlowChainELBuilder; import com.yomahub.liteflow.builder.entity.ExecutableEntity; import com.yomahub.liteflow.core.FlowExecutor; import com.yomahub.liteflow.core.FlowExecutorHolder; @@ -65,17 +65,12 @@ public class BuilderTest extends BaseTest { .build(); - LiteFlowChainBuilder.createChain().setChainName("chain2").setCondition( - LiteFlowConditionBuilder.createThenCondition().setValue("c,d").build() + LiteFlowChainELBuilder.createChain().setChainName("chain2").setEL( + "THEN(c, d)" ).build(); - LiteFlowChainBuilder.createChain().setChainName("chain1").setCondition( - LiteFlowConditionBuilder - .createThenCondition() - .setValue("a,b").build() - ).setCondition( - LiteFlowConditionBuilder.createWhenCondition() - .setValue("e(f|g|chain2)").build() + LiteFlowChainELBuilder.createChain().setChainName("chain1").setEL( + "THEN(a, b, WHEN(SWITCH(e).to(f, g, chain2)))" ).build(); LiteflowResponse response = flowExecutor.execute2Resp("chain1"); @@ -122,17 +117,12 @@ public class BuilderTest extends BaseTest { .setClazz(GCmp.class) .build(); - LiteFlowChainBuilder.createChain().setChainName("chain2").setCondition( - LiteFlowConditionBuilder.createThenCondition().setValue("c,d").build() + LiteFlowChainELBuilder.createChain().setChainName("chain2").setEL( + "THEN(c, d)" ).build(); - LiteFlowChainBuilder.createChain().setChainName("chain1").setCondition( - LiteFlowConditionBuilder - .createThenCondition() - .setValue("a,b").build() - ).setCondition( - LiteFlowConditionBuilder.createWhenCondition() - .setValue("e(f|g|chain2)").build() + LiteFlowChainELBuilder.createChain().setChainName("chain1").setEL( + "THEN(a, b, WHEN(SWITCH(e).to(f, g, chain2)))" ).build(); LiteflowResponse response = flowExecutor.execute2Resp("chain1"); @@ -142,69 +132,34 @@ public class BuilderTest extends BaseTest { //基于普通组件的builder模式测试 @Test - public void testBuilderForConditionNode() throws Exception { - LiteFlowNodeBuilder.createNode().setId("a") - .setName("组件A") + public void testBuilderForSameNodeMultiTimes() throws Exception { + LiteFlowNodeBuilder.createNode().setId("a1") + .setName("组件A1") .setType(NodeTypeEnum.COMMON) .setClazz(ACmp.class) .build(); - LiteFlowNodeBuilder.createNode().setId("b") - .setName("组件B") + LiteFlowNodeBuilder.createNode().setId("a2") + .setName("组件A2") .setType(NodeTypeEnum.COMMON) - .setClazz(BCmp.class) + .setClazz(ACmp.class) .build(); - LiteFlowNodeBuilder.createNode().setId("c") - .setName("组件C") + LiteFlowNodeBuilder.createNode().setId("c1") + .setName("组件C1") .setType(NodeTypeEnum.COMMON) .setClazz(CCmp.class) .build(); - LiteFlowNodeBuilder.createNode().setId("d") - .setName("组件D") + LiteFlowNodeBuilder.createNode().setId("c2") + .setName("组件C2") .setType(NodeTypeEnum.COMMON) - .setClazz(DCmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("e") - .setName("组件E") - .setType(NodeTypeEnum.SWITCH) - .setClazz(ECmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("f") - .setName("组件F") - .setType(NodeTypeEnum.COMMON) - .setClazz(FCmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("g") - .setName("组件G") - .setType(NodeTypeEnum.COMMON) - .setClazz(GCmp.class) + .setClazz(CCmp.class) .build(); - - LiteFlowChainBuilder.createChain().setChainName("chain2").setCondition( - LiteFlowConditionBuilder.createThenCondition() - .setExecutable(new ExecutableEntity().setId("c")) - .setExecutable(new ExecutableEntity().setId("d")) - .build() - ).build(); - - LiteFlowChainBuilder.createChain().setChainName("chain1").setCondition( - LiteFlowConditionBuilder - .createThenCondition() - .setExecutable(new ExecutableEntity().setId("a").setTag("hello")) - .setExecutable(new ExecutableEntity().setId("b")) - .build() - ).setCondition( - LiteFlowConditionBuilder.createWhenCondition() - .setExecutable( - new ExecutableEntity().setId("e") - .addNodeCondComponent(new ExecutableEntity().setId("f").setTag("FHello")) - .addNodeCondComponent(new ExecutableEntity().setId("g")) - .addNodeCondComponent(new ExecutableEntity().setId("chain2") - )).build() + LiteFlowChainELBuilder.createChain().setChainName("chain1").setEL( + "THEN(a1,c2,a2,c1)" ).build(); LiteflowResponse response = flowExecutor.execute2Resp("chain1"); Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a[组件A]==>b[组件B]==>e[组件E]==>c[组件C]==>d[组件D]", response.getExecuteStepStr()); + Assert.assertEquals("a1[组件A1]==>c2[组件C2]==>a2[组件A2]==>c1[组件C1]", response.getExecuteStepStr()); } } diff --git a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/parsecustom/parser/CustomJsonFlowParser.java b/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/parsecustom/parser/CustomJsonFlowParser.java index d8308c32a..42f5eeed5 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/parsecustom/parser/CustomJsonFlowParser.java +++ b/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/parsecustom/parser/CustomJsonFlowParser.java @@ -1,16 +1,17 @@ package com.yomahub.liteflow.test.parsecustom.parser; -import com.yomahub.liteflow.parser.ClassJsonFlowParser; +import com.yomahub.liteflow.parser.el.ClassJsonFlowELParser; /** * 模拟用户自定义源解析 * @author dongguo.tao * @since 2.5.0 */ -public class CustomJsonFlowParser extends ClassJsonFlowParser { +public class CustomJsonFlowParser extends ClassJsonFlowELParser { @Override public String parseCustom() { //模拟自定义解析结果 - return "{\"flow\":{\"nodes\":{\"node\":[{\"id\":\"a\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.ACmp\"},{\"id\":\"b\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.BCmp\"},{\"id\":\"c\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.CCmp\"},{\"id\":\"d\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.DCmp\"},{\"id\":\"e\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.ECmp\"},{\"id\":\"f\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.FCmp\"},{\"id\":\"g\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.GCmp\"}]},\"chain\":[{\"name\":\"chain2\",\"condition\":[{\"type\":\"then\",\"value\":\"c,g,f\"}]},{\"name\":\"chain1\",\"condition\":[{\"type\":\"then\",\"value\":\"a,c\"},{\"type\":\"when\",\"value\":\"b,d,e(f|g)\"},{\"type\":\"then\",\"value\":\"chain2\"}]}]}}"; + String content = "{\"flow\":{\"nodes\":{\"node\":[{\"id\":\"a\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.ACmp\"},{\"id\":\"b\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.BCmp\"},{\"id\":\"c\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.CCmp\"},{\"id\":\"d\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.DCmp\"},{\"id\":\"e\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.ECmp\"},{\"id\":\"f\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.FCmp\"},{\"id\":\"g\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.GCmp\"}]},\"chain\":[{\"name\":\"chain2\",\"value\":\"THEN(c, g, f)\"},{\"name\":\"chain1\",\"value\":\"THEN(a, c, WHEN(b, d, SWITCH(e).to(f, g), chain2))\"}]}}"; + return content; } } diff --git a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/parsecustom/parser/CustomXmlFlowParser.java b/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/parsecustom/parser/CustomXmlFlowParser.java index 0c305e579..857142d6a 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/parsecustom/parser/CustomXmlFlowParser.java +++ b/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/parsecustom/parser/CustomXmlFlowParser.java @@ -1,6 +1,6 @@ package com.yomahub.liteflow.test.parsecustom.parser; -import com.yomahub.liteflow.parser.ClassXmlFlowParser; +import com.yomahub.liteflow.parser.el.ClassXmlFlowELParser; /** * 非spring环境的自定义xml parser单元测试 @@ -8,10 +8,10 @@ import com.yomahub.liteflow.parser.ClassXmlFlowParser; * @author bryan.zhang * @since 2.5.7 */ -public class CustomXmlFlowParser extends ClassXmlFlowParser { +public class CustomXmlFlowParser extends ClassXmlFlowELParser { @Override public String parseCustom() { - return ""; + return "THEN(a,b,c,d)"; } } diff --git a/liteflow-testcase-el/liteflow-testcase-el-script-groovy-springboot/src/test/java/com/yomahub/liteflow/test/script/groovy/LiteFlowXmlScriptBuilderGroovyELTest.java b/liteflow-testcase-el/liteflow-testcase-el-script-groovy-springboot/src/test/java/com/yomahub/liteflow/test/script/groovy/LiteFlowXmlScriptBuilderGroovyELTest.java index 2607885fa..ede70c123 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-script-groovy-springboot/src/test/java/com/yomahub/liteflow/test/script/groovy/LiteFlowXmlScriptBuilderGroovyELTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-script-groovy-springboot/src/test/java/com/yomahub/liteflow/test/script/groovy/LiteFlowXmlScriptBuilderGroovyELTest.java @@ -1,7 +1,5 @@ package com.yomahub.liteflow.test.script.groovy; -import com.yomahub.liteflow.builder.LiteFlowChainBuilder; -import com.yomahub.liteflow.builder.LiteFlowConditionBuilder; import com.yomahub.liteflow.builder.LiteFlowNodeBuilder; import com.yomahub.liteflow.builder.el.LiteFlowChainELBuilder; import com.yomahub.liteflow.core.FlowExecutor; diff --git a/liteflow-testcase-el/liteflow-testcase-el-script-qlexpress-springboot/src/test/java/com/yomahub/liteflow/test/script/qlexpress/LiteFlowXmlScriptBuilderQLExpressELTest.java b/liteflow-testcase-el/liteflow-testcase-el-script-qlexpress-springboot/src/test/java/com/yomahub/liteflow/test/script/qlexpress/LiteFlowXmlScriptBuilderQLExpressELTest.java index e93e3b012..dca3ebd67 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-script-qlexpress-springboot/src/test/java/com/yomahub/liteflow/test/script/qlexpress/LiteFlowXmlScriptBuilderQLExpressELTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-script-qlexpress-springboot/src/test/java/com/yomahub/liteflow/test/script/qlexpress/LiteFlowXmlScriptBuilderQLExpressELTest.java @@ -1,7 +1,5 @@ package com.yomahub.liteflow.test.script.qlexpress; -import com.yomahub.liteflow.builder.LiteFlowChainBuilder; -import com.yomahub.liteflow.builder.LiteFlowConditionBuilder; import com.yomahub.liteflow.builder.LiteFlowNodeBuilder; import com.yomahub.liteflow.builder.el.LiteFlowChainELBuilder; import com.yomahub.liteflow.core.FlowExecutor; diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/builder/BuilderELSpringbootTest1.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/builder/BuilderELSpringbootTest1.java index 1e93294e8..4b2213569 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/builder/BuilderELSpringbootTest1.java +++ b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/builder/BuilderELSpringbootTest1.java @@ -1,10 +1,7 @@ package com.yomahub.liteflow.test.builder; -import com.yomahub.liteflow.builder.LiteFlowChainBuilder; -import com.yomahub.liteflow.builder.LiteFlowConditionBuilder; import com.yomahub.liteflow.builder.LiteFlowNodeBuilder; import com.yomahub.liteflow.builder.el.LiteFlowChainELBuilder; -import com.yomahub.liteflow.builder.entity.ExecutableEntity; import com.yomahub.liteflow.core.FlowExecutor; import com.yomahub.liteflow.enums.NodeTypeEnum; import com.yomahub.liteflow.flow.LiteflowResponse; diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/builder/BuilderELSpringbootTest2.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/builder/BuilderELSpringbootTest2.java index 6f1e8dd06..794244149 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/builder/BuilderELSpringbootTest2.java +++ b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/builder/BuilderELSpringbootTest2.java @@ -1,7 +1,5 @@ package com.yomahub.liteflow.test.builder; -import com.yomahub.liteflow.builder.LiteFlowChainBuilder; -import com.yomahub.liteflow.builder.LiteFlowConditionBuilder; import com.yomahub.liteflow.builder.el.LiteFlowChainELBuilder; import com.yomahub.liteflow.core.FlowExecutor; import com.yomahub.liteflow.flow.LiteflowResponse; diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/parser/CustomJsonFlowParser.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/parser/CustomJsonFlowParser.java index dbf61f563..42f5eeed5 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/parser/CustomJsonFlowParser.java +++ b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/parser/CustomJsonFlowParser.java @@ -1,6 +1,5 @@ package com.yomahub.liteflow.test.parsecustom.parser; -import com.yomahub.liteflow.parser.ClassJsonFlowParser; import com.yomahub.liteflow.parser.el.ClassJsonFlowELParser; /** diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/parser/CustomXmlFlowParser.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/parser/CustomXmlFlowParser.java index 9563b1f6e..473ad502f 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/parser/CustomXmlFlowParser.java +++ b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/parser/CustomXmlFlowParser.java @@ -1,6 +1,5 @@ package com.yomahub.liteflow.test.parsecustom.parser; -import com.yomahub.liteflow.parser.ClassXmlFlowParser; import com.yomahub.liteflow.parser.el.ClassXmlFlowELParser; import com.yomahub.liteflow.test.parsecustom.bean.TestBean; diff --git a/liteflow-testcase-old/.gitignore b/liteflow-testcase-old/.gitignore deleted file mode 100644 index 34e58e256..000000000 --- a/liteflow-testcase-old/.gitignore +++ /dev/null @@ -1,83 +0,0 @@ -# Compiled source # -################### -*.com -*.class -*.dll -*.exe -*.o -*.so - - -# Packages # -############ -# it's better to unpack these files and commit the raw source -# git has its own built in compression methods -*.7z -*.dmg -*.gz -*.iso -*.jar -*.rar -*.tar -*.zip -*.war -*.del -*.pmd -.tern-project - - -# Logs and databases # -###################### -*.log -*.log.* -# OS generated files # -###################### -.DS_Store* -ehthumbs.db -Icon? -Thumbs.db - - -# Editor Files # -################ -*~ -*.swp - - -# Gradle Files # -################ -.gradle - - -# Build output directies -/target -*/target -/build -*/build - - -# IntelliJ specific files/directories -out -.idea -*.ipr -*.iws -*.iml -atlassian-ide-plugin.xml - - -# Eclipse specific files/directories -.classpath -.project -.settings -.metadata -.myeclipse - - -# NetBeans specific files/directories -.nbattrs - -*.mymetadata -/logs -*/logs - -.flattened-pom.xml diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/pom.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/pom.xml deleted file mode 100644 index 709b54ff6..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/pom.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - liteflow-testcase-old - com.yomahub - ${revision} - ../pom.xml - - 4.0.0 - - liteflow-testcase-declare-springboot - - - - com.yomahub - liteflow-spring-boot-starter - ${revision} - - - - org.springframework.boot - spring-boot-starter-test - test - - - org.aspectj - aspectjweaver - test - - - - - - - org.springframework.boot - spring-boot-maven-plugin - ${springboot.version} - - - org.apache.maven.plugins - maven-deploy-plugin - 2.8.2 - - true - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/BaseTest.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/BaseTest.java deleted file mode 100644 index 3a79ad7b0..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/BaseTest.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.yomahub.liteflow.test; - -import com.yomahub.liteflow.flow.FlowBus; -import com.yomahub.liteflow.property.LiteflowConfigGetter; -import com.yomahub.liteflow.spi.holder.SpiFactoryCleaner; -import com.yomahub.liteflow.spring.ComponentScanner; -import com.yomahub.liteflow.thread.ExecutorHelper; -import org.junit.AfterClass; - -public class BaseTest { - - @AfterClass - public static void cleanScanCache(){ - ComponentScanner.cleanCache(); - FlowBus.cleanCache(); - ExecutorHelper.loadInstance().clearExecutorServiceMap(); - SpiFactoryCleaner.clean(); - LiteflowConfigGetter.clean(); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/AbsoluteConfigPathSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/AbsoluteConfigPathSpringbootTest.java deleted file mode 100644 index 02913478c..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/AbsoluteConfigPathSpringbootTest.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.yomahub.liteflow.test.absoluteConfigPath; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * springboot环境下异步线程超时日志打印测试 - * @author Bryan.Zhang - * @since 2.6.4 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/absoluteConfigPath/application.properties") -@SpringBootTest(classes = AbsoluteConfigPathSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.absoluteConfigPath.cmp"}) -public class AbsoluteConfigPathSpringbootTest extends BaseTest { - - private final Logger log = LoggerFactory.getLogger(this.getClass()); - - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testAbsoluteConfig() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/ACmp.java deleted file mode 100644 index f2370fa61..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/ACmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.absoluteConfigPath.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("a") -@LiteflowCmpDefine -public class ACmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/BCmp.java deleted file mode 100644 index e83723bdb..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/BCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.absoluteConfigPath.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("b") -@LiteflowCmpDefine -public class BCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/CCmp.java deleted file mode 100644 index 17a096598..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/CCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.absoluteConfigPath.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("c") -@LiteflowCmpDefine -public class CCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/CustomAOPSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/CustomAOPSpringbootTest.java deleted file mode 100644 index 6ebacfc7d..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/CustomAOPSpringbootTest.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.yomahub.liteflow.test.aop; - -import com.yomahub.liteflow.test.BaseTest; - -/** - * 切面场景单元测试 - * 在声明式组件场景中,自定义aspect的aop不生效的,因为生成的代理类并不是原类,也不是原类的子类,而是NodeComponent的子类 - * 所以切不到,暂且没有想出办法来解决,这个测试类暂时不用 - * @author Bryan.Zhang - */ -/*@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/aop/application.properties") -@SpringBootTest(classes = CustomAOPSpringbootTest.class) -@EnableAutoConfiguration -@Import(CustomAspect.class) -@ComponentScan({"com.yomahub.liteflow.test.aop.cmp1","com.yomahub.liteflow.test.aop.cmp2"})*/ -public class CustomAOPSpringbootTest extends BaseTest { - - /*@Resource - private FlowExecutor flowExecutor; - - //测试自定义AOP,串行场景 - @Test - public void testCustomAopS() { - LiteflowResponse response= flowExecutor.execute2Resp("chain1", "it's a request"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("before_after", response.getContextBean.getData("a")); - Assert.assertEquals("before_after", context.getData("b")); - Assert.assertEquals("before_after", context.getData("c")); - } - - //测试自定义AOP,并行场景 - @Test - public void testCustomAopP() { - LiteflowResponse response= flowExecutor.execute2Resp("chain2", "it's a request"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("before_after", context.getData("a")); - Assert.assertEquals("before_after", context.getData("b")); - Assert.assertEquals("before_after", context.getData("c")); - }*/ -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/GlobalAOPSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/GlobalAOPSpringbootTest.java deleted file mode 100644 index 04bcbc997..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/GlobalAOPSpringbootTest.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.yomahub.liteflow.test.aop; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.spring.ComponentScanner; -import com.yomahub.liteflow.test.BaseTest; -import com.yomahub.liteflow.test.aop.aspect.CmpAspect; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Import; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * 切面场景单元测试 - * @author Bryan.Zhang - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/aop/application.properties") -@SpringBootTest(classes = GlobalAOPSpringbootTest.class) -@EnableAutoConfiguration -@Import(CmpAspect.class) -@ComponentScan({"com.yomahub.liteflow.test.aop.cmp1","com.yomahub.liteflow.test.aop.cmp2"}) -public class GlobalAOPSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //测试全局AOP,串行场景 - @Test - public void testGlobalAopS() { - LiteflowResponse response= flowExecutor.execute2Resp("chain1", "it's a request"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("before_after", context.getData("a")); - Assert.assertEquals("before_after", context.getData("b")); - Assert.assertEquals("before_after", context.getData("c")); - Assert.assertEquals("before_after", context.getData("d")); - Assert.assertEquals("before_after", context.getData("e")); - } - - //测试全局AOP,并行场景 - @Test - public void testGlobalAopP() { - LiteflowResponse response= flowExecutor.execute2Resp("chain2", "it's a request"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("before_after", context.getData("a")); - Assert.assertEquals("before_after", context.getData("b")); - Assert.assertEquals("before_after", context.getData("c")); - Assert.assertEquals("before_after", context.getData("d")); - Assert.assertEquals("before_after", context.getData("e")); - } - - @Test - public void testGlobalAopException() { - LiteflowResponse response= flowExecutor.execute2Resp("chain3", "it's a request"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertFalse(response.isSuccess()); - Assert.assertEquals("before_after", context.getData("a")); - Assert.assertEquals("before_after", context.getData("b")); - Assert.assertEquals("before_after", context.getData("c")); - Assert.assertEquals("before_after", context.getData("f")); - } - - @AfterClass - public static void cleanScanCache(){ - BaseTest.cleanScanCache(); - ComponentScanner.cmpAroundAspect = null; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/aspect/CmpAspect.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/aspect/CmpAspect.java deleted file mode 100644 index 3704a146d..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/aspect/CmpAspect.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.yomahub.liteflow.test.aop.aspect; - -import cn.hutool.core.util.StrUtil; -import com.yomahub.liteflow.aop.ICmpAroundAspect; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; - -public class CmpAspect implements ICmpAroundAspect { - @Override - public void beforeProcess(String nodeId, Slot slot) { - DefaultContext context = slot.getFirstContextBean(); - context.setData(nodeId, "before"); - } - - @Override - public void afterProcess(String nodeId, Slot slot) { - DefaultContext context = slot.getFirstContextBean(); - context.setData(nodeId, StrUtil.format("{}_{}", context.getData(nodeId), "after")); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/aspect/CustomAspect.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/aspect/CustomAspect.java deleted file mode 100644 index dd2e61453..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/aspect/CustomAspect.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.yomahub.liteflow.test.aop.aspect; - -import cn.hutool.core.util.StrUtil; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; -import org.aspectj.lang.ProceedingJoinPoint; -import org.aspectj.lang.annotation.Around; -import org.aspectj.lang.annotation.Aspect; -import org.aspectj.lang.annotation.Pointcut; - -@Aspect -public class CustomAspect { - - @Pointcut("execution(* com.yomahub.liteflow.test.aop.cmp1.*.process(*))") - public void cut() { - } - - @Around("cut()") - public Object around(ProceedingJoinPoint jp) throws Throwable { - NodeComponent cmp = (NodeComponent) jp.getThis(); - DefaultContext context = cmp.getFirstContextBean(); - context.setData(cmp.getNodeId(), "before"); - Object returnObj = jp.proceed(); - context.setData(cmp.getNodeId(), StrUtil.format("{}_{}", context.getData(cmp.getNodeId()), "after")); - return returnObj; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp1/ACmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp1/ACmp.java deleted file mode 100644 index 8802336f1..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp1/ACmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.aop.cmp1; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("a") -@LiteflowCmpDefine -public class ACmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("Acomp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp1/BCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp1/BCmp.java deleted file mode 100644 index 8b688aef5..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp1/BCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.aop.cmp1; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("b") -@LiteflowCmpDefine -public class BCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("Bcomp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp1/CCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp1/CCmp.java deleted file mode 100644 index b8c52b500..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp1/CCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.aop.cmp1; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("c") -@LiteflowCmpDefine -public class CCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("Ccomp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp2/DCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp2/DCmp.java deleted file mode 100644 index ff4680e1f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp2/DCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.aop.cmp2; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("d") -@LiteflowCmpDefine -public class DCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("Dcomp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp2/ECmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp2/ECmp.java deleted file mode 100644 index 99db4df8a..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp2/ECmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.aop.cmp2; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("e") -@LiteflowCmpDefine -public class ECmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("Ecomp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp2/FCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp2/FCmp.java deleted file mode 100644 index 38b8971c7..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp2/FCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.aop.cmp2; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("f") -@LiteflowCmpDefine -public class FCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - throw new RuntimeException("test error"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/AsyncNodeSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/AsyncNodeSpringbootTest.java deleted file mode 100644 index 71264d840..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/AsyncNodeSpringbootTest.java +++ /dev/null @@ -1,139 +0,0 @@ -package com.yomahub.liteflow.test.asyncNode; - -import cn.hutool.core.collection.ListUtil; -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import com.yomahub.liteflow.test.asyncNode.exception.TestException; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * 测试隐式调用子流程 - * 单元测试 - * - * @author ssss - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/asyncNode/application.properties") -@SpringBootTest(classes = AsyncNodeSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.asyncNode.cmp"}) -public class AsyncNodeSpringbootTest extends BaseTest { - @Resource - private FlowExecutor flowExecutor; - - /***** - * 标准chain 嵌套选择 嵌套子chain进行执行 - * 验证了when情况下 多个node是并行执行 - * 验证了默认参数情况下 when可以加载执行 - * **/ - @Test - public void testAsyncFlow1() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "it's a base request"); - Assert.assertTrue(response.isSuccess()); - System.out.println(response.getExecuteStepStr()); - } - - //这个和test1有点类似,只不过进一步验证了步骤 - @Test - public void testAsyncFlow2() { - LiteflowResponse response = flowExecutor.execute2Resp("chain2", "it's a base request"); - Assert.assertTrue(ListUtil.toList("b==>j==>g==>f==>h","b==>j==>g==>h==>f", - "b==>j==>h==>g==>f","b==>j==>h==>f==>g", - "b==>j==>f==>h==>g","b==>j==>f==>g==>h" - ).contains(response.getExecuteStepStr())); - } - - //测试errorResume,默认的errorResume为false,这里测试默认的 - @Test - public void testAsyncFlow3_1() { - LiteflowResponse response = flowExecutor.execute2Resp("chain3-1", "it's a base request"); - Assert.assertFalse(response.isSuccess()); - Assert.assertEquals(response.getSlot().getException().getClass(), TestException.class); - } - - //测试errorResume,默认的errorResume为false,这里设置为true - @Test - public void testAsyncFlow3_2() { - LiteflowResponse response = flowExecutor.execute2Resp("chain3-2", "it's a base request"); - Assert.assertTrue(response.isSuccess()); - } - - //相同group的并行组,会合并,并且errorResume根据第一个when来,这里第一个when配置了不抛错 - @Test - public void testAsyncFlow4() { - LiteflowResponse response = flowExecutor.execute2Resp("chain4", "it's a base request"); - DefaultContext context = response.getFirstContextBean(); - //因为不记录错误,所以最终结果是true - Assert.assertTrue(response.isSuccess()); - //因为是并行组,所以即便抛错了,其他组件也会执行,i在流程里配置了2遍,i抛错,但是也执行了2遍,这里验证下 - Integer count = context.getData("count"); - Assert.assertEquals(new Integer(2), count); - //因为配置了不抛错,所以response里的cause应该为null - Assert.assertNull(response.getCause()); - } - - //相同group的并行组,会合并,并且errorResume根据第一个when来,这里第一个when配置了会抛错 - @Test - public void testAsyncFlow5() throws Exception { - LiteflowResponse response = flowExecutor.execute2Resp("chain5", "it's a base request"); - DefaultContext context = response.getFirstContextBean(); - //整个并行组是报错的,所以最终结果是false - Assert.assertFalse(response.isSuccess()); - //因为是并行组,所以即便抛错了,其他组件也会执行,i在流程里配置了2遍,i抛错,但是也执行了2遍,这里验证下 - Integer count = context.getData("count"); - Assert.assertEquals(new Integer(2), count); - //因为第一个when配置了会报错,所以response里的cause里应该会有TestException - Assert.assertEquals(TestException.class, response.getCause().getClass()); - } - - //不同group的并行组,不会合并,第一个when的errorResume是false,会抛错,那第二个when就不会执行 - @Test - public void testAsyncFlow6() throws Exception { - LiteflowResponse response = flowExecutor.execute2Resp("chain6", "it's a base request"); - DefaultContext context = response.getFirstContextBean(); - //第一个when会抛错,所以最终结果是false - Assert.assertFalse(response.isSuccess()); - //因为是不同组并行组,第一组的when里的i就抛错了,所以i就执行了1遍 - Integer count = context.getData("count"); - Assert.assertEquals(new Integer(1), count); - //第一个when会报错,所以最终response的cause里应该会有TestException - Assert.assertEquals(TestException.class, response.getCause().getClass()); - } - - //不同group的并行组,不会合并,第一个when的errorResume是true,不会报错,那第二个when还会继续执行,但是第二个when的errorResume是false,所以第二个when会报错 - @Test - public void testAsyncFlow7() throws Exception { - LiteflowResponse response = flowExecutor.execute2Resp("chain7", "it's a base request"); - DefaultContext context = response.getFirstContextBean(); - //第二个when会抛错,所以最终结果是false - Assert.assertFalse(response.isSuccess()); - // 传递了slotIndex,则set的size==2 - Integer count = context.getData("count"); - Assert.assertEquals(new Integer(2), count); - //第一个when会报错,所以最终response的cause里应该会有TestException - Assert.assertEquals(TestException.class, response.getCause().getClass()); - } - - //测试任意异步一个执行完即继续的场景 - //d g h并行,配置了any=true,其中d耗时1秒,g耗时0.5秒,其他都不设耗时 - //最终执行效果应该是h先返回,然后执行abc,最后gd - //这里要注意的是,由于step是先加入,所以step的打印顺序并不是这样的。但是实际执行是正确的 - @Test - public void testAsyncFlow8() throws Exception { - LiteflowResponse response = flowExecutor.execute2Resp("chain8", "it's a base request"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - Assert.assertTrue(context.getData("check").toString().startsWith("habc")); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ACmp.java deleted file mode 100644 index 043d58eda..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ACmp.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.yomahub.liteflow.test.asyncNode.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - - -@Component("a") -@LiteflowCmpDefine -public class ACmp{ - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - DefaultContext context = bindCmp.getFirstContextBean(); - synchronized (NodeComponent.class){ - if (context.hasData("check")){ - String str = context.getData("check"); - str += bindCmp.getNodeId(); - context.setData("check", str); - }else{ - context.setData("check", bindCmp.getNodeId()); - } - } - System.out.println("Acomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/BCmp.java deleted file mode 100644 index 94e0eac96..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/BCmp.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.yomahub.liteflow.test.asyncNode.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - - -@Component("b") -@LiteflowCmpDefine -public class BCmp{ - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - DefaultContext context = bindCmp.getFirstContextBean(); - synchronized (NodeComponent.class){ - if (context.hasData("check")){ - String str = context.getData("check"); - str += bindCmp.getNodeId(); - context.setData("check", str); - }else{ - context.setData("check", bindCmp.getNodeId()); - } - } - System.out.println("Bcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/CCmp.java deleted file mode 100644 index 64e3a43c3..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/CCmp.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.yomahub.liteflow.test.asyncNode.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - - -@Component("c") -@LiteflowCmpDefine -public class CCmp{ - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) throws Exception { - DefaultContext context = bindCmp.getFirstContextBean(); - synchronized (NodeComponent.class){ - if (context.hasData("check")){ - String str = context.getData("check"); - str += bindCmp.getNodeId(); - context.setData("check", str); - }else{ - context.setData("check", bindCmp.getNodeId()); - } - } - System.out.println("Ccomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/DCmp.java deleted file mode 100644 index 16398b8de..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/DCmp.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.yomahub.liteflow.test.asyncNode.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - - -@Component("d") -@LiteflowCmpDefine -public class DCmp{ - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) throws Exception { - Thread.sleep(1000); - DefaultContext context = bindCmp.getFirstContextBean(); - synchronized (NodeComponent.class){ - if (context.hasData("check")){ - String str = context.getData("check"); - str += bindCmp.getNodeId(); - context.setData("check", str); - }else{ - context.setData("check", bindCmp.getNodeId()); - } - } - System.out.println("Dcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ECmp.java deleted file mode 100644 index d4142abc0..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ECmp.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.yomahub.liteflow.test.asyncNode.cmp; - -import com.yomahub.liteflow.annotation.LiteflowSwitchCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - - -@Component("e") -@LiteflowSwitchCmpDefine -public class ECmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS_SWITCH) - public String processSwitch(NodeComponent bindCmp) throws Exception { - System.out.println("Ecomp executed!"); - return "g"; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/FCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/FCmp.java deleted file mode 100644 index 83eac4042..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/FCmp.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.yomahub.liteflow.test.asyncNode.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - - -@Component("f") -@LiteflowCmpDefine -public class FCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) throws Exception { - System.out.println("Fcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/GCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/GCmp.java deleted file mode 100644 index b835cfb4d..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/GCmp.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.yomahub.liteflow.test.asyncNode.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - - -@Component("g") -@LiteflowCmpDefine -public class GCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) throws Exception { - Thread.sleep(500); - DefaultContext context = bindCmp.getFirstContextBean(); - synchronized (NodeComponent.class){ - if (context.hasData("check")){ - String str = context.getData("check"); - str += bindCmp.getNodeId(); - context.setData("check", str); - }else{ - context.setData("check", bindCmp.getNodeId()); - } - } - System.out.println("Gcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/HCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/HCmp.java deleted file mode 100644 index 00aec49ef..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/HCmp.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.yomahub.liteflow.test.asyncNode.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - - -@Component("h") -@LiteflowCmpDefine -public class HCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) throws Exception { - DefaultContext context = bindCmp.getFirstContextBean(); - synchronized (NodeComponent.class){ - if (context.hasData("check")){ - String str = context.getData("check"); - str += bindCmp.getNodeId(); - context.setData("check", str); - }else{ - context.setData("check", bindCmp.getNodeId()); - } - } - - System.out.println("Hcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ICmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ICmp.java deleted file mode 100644 index 657b9b138..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ICmp.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.yomahub.liteflow.test.asyncNode.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import com.yomahub.liteflow.test.asyncNode.exception.TestException; -import org.springframework.stereotype.Component; - - -@Component("i") -@LiteflowCmpDefine -public class ICmp { - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) throws Exception { - DefaultContext context = bindCmp.getFirstContextBean(); - synchronized (ICmp.class){ - if (context.hasData("count")){ - Integer count = context.getData("count"); - context.setData("count", ++count); - } else{ - context.setData("count", 1); - } - } - System.out.println("Icomp executed! throw Exception!"); - throw new TestException(); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/JCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/JCmp.java deleted file mode 100644 index cf77ff942..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/JCmp.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.yomahub.liteflow.test.asyncNode.cmp; - -import com.yomahub.liteflow.annotation.LiteflowSwitchCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - - -@Component("j") -@LiteflowSwitchCmpDefine -public class JCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS_SWITCH) - public String processSwitch(NodeComponent bindCmp) throws Exception { - System.out.println("Jcomp executed!"); - return "chain3"; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/exception/TestException.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/exception/TestException.java deleted file mode 100644 index e786e9f86..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/exception/TestException.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.yomahub.liteflow.test.asyncNode.exception; - -public class TestException extends Exception{ -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/base/BaseSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/base/BaseSpringbootTest.java deleted file mode 100644 index 608e90986..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/base/BaseSpringbootTest.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.yomahub.liteflow.test.base; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * springboot环境最普通的例子测试 - * @author Bryan.Zhang - * @since 2.6.4 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/base/application.properties") -@SpringBootTest(classes = BaseSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.base.cmp"}) -public class BaseSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testBase() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/base/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/base/cmp/ACmp.java deleted file mode 100644 index d192c24aa..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/base/cmp/ACmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.base.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("a") -@LiteflowCmpDefine -public class ACmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/base/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/base/cmp/BCmp.java deleted file mode 100644 index 0f29823cc..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/base/cmp/BCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.base.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("b") -@LiteflowCmpDefine -public class BCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/base/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/base/cmp/CCmp.java deleted file mode 100644 index d147a02c1..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/base/cmp/CCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.base.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("c") -@LiteflowCmpDefine -public class CCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/base/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/base/cmp/DCmp.java deleted file mode 100644 index 937c79b9b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/base/cmp/DCmp.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.base.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; - -@Component("d") -@LiteflowCmpDefine -public class DCmp{ - - @Resource - private TestDomain testDomain; - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - testDomain.sayHi(); - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/base/cmp/TestDomain.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/base/cmp/TestDomain.java deleted file mode 100644 index 16f159324..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/base/cmp/TestDomain.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.yomahub.liteflow.test.base.cmp; - -import org.springframework.stereotype.Component; - -@Component -public class TestDomain { - public void sayHi(){ - System.out.println("hello"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/BuilderSpringbootTest1.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/BuilderSpringbootTest1.java deleted file mode 100644 index d7fcd4e1b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/BuilderSpringbootTest1.java +++ /dev/null @@ -1,217 +0,0 @@ -package com.yomahub.liteflow.test.builder; - -import com.yomahub.liteflow.builder.LiteFlowChainBuilder; -import com.yomahub.liteflow.builder.LiteFlowConditionBuilder; -import com.yomahub.liteflow.builder.LiteFlowNodeBuilder; -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.builder.entity.ExecutableEntity; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.enums.NodeTypeEnum; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import com.yomahub.liteflow.test.builder.cmp1.*; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -//基于builder模式的单元测试 -//这里只是最基本的builder模式的测试,只是为了验证在springboot模式下的正常性 -//更详细的builder模式测试用例会单独拉testcase去做 -@RunWith(SpringRunner.class) -@SpringBootTest(classes = BuilderSpringbootTest1.class) -@EnableAutoConfiguration -public class BuilderSpringbootTest1 extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //基于普通组件的builder模式测试 - @Test - public void testBuilder() throws Exception { - LiteFlowNodeBuilder.createNode().setId("a") - .setName("组件A") - .setType(NodeTypeEnum.COMMON) - .setClazz("com.yomahub.liteflow.test.builder.cmp1.ACmp") - .build(); - LiteFlowNodeBuilder.createNode().setId("b") - .setName("组件B") - .setType(NodeTypeEnum.COMMON) - .setClazz("com.yomahub.liteflow.test.builder.cmp1.BCmp") - .build(); - LiteFlowNodeBuilder.createNode().setId("c") - .setName("组件C") - .setType(NodeTypeEnum.COMMON) - .setClazz("com.yomahub.liteflow.test.builder.cmp1.CCmp") - .build(); - LiteFlowNodeBuilder.createNode().setId("d") - .setName("组件D") - .setType(NodeTypeEnum.COMMON) - .setClazz("com.yomahub.liteflow.test.builder.cmp1.DCmp") - .build(); - LiteFlowNodeBuilder.createNode().setId("e") - .setName("组件E") - .setType(NodeTypeEnum.SWITCH) - .setClazz("com.yomahub.liteflow.test.builder.cmp1.ECmp") - .build(); - LiteFlowNodeBuilder.createNode().setId("f") - .setName("组件F") - .setType(NodeTypeEnum.COMMON) - .setClazz("com.yomahub.liteflow.test.builder.cmp1.FCmp") - .build(); - LiteFlowNodeBuilder.createNode().setId("g") - .setName("组件G") - .setType(NodeTypeEnum.COMMON) - .setClazz("com.yomahub.liteflow.test.builder.cmp1.GCmp") - .build(); - - - LiteFlowChainBuilder.createChain().setChainName("chain2").setCondition( - LiteFlowConditionBuilder.createThenCondition().setValue("c,d").build() - ).build(); - - LiteFlowChainBuilder.createChain().setChainName("chain1").setCondition( - LiteFlowConditionBuilder - .createThenCondition() - .setValue("a,b").build() - ).setCondition( - LiteFlowConditionBuilder.createWhenCondition() - .setValue("e(f|g|chain2)").build() - ).build(); - - LiteflowResponse response = flowExecutor.execute2Resp("chain1"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a[组件A]==>b[组件B]==>e[组件E]==>c[组件C]==>d[组件D]", response.getExecuteStepStr()); - } - - //基于普通组件的builder模式测试 - @Test - public void testBuilderForClassAndCode() throws Exception { - LiteFlowNodeBuilder.createNode().setId("a") - .setName("组件A") - .setType(NodeTypeEnum.COMMON) - .setClazz(ACmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("b") - .setName("组件B") - .setType(NodeTypeEnum.COMMON) - .setClazz(BCmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("c") - .setName("组件C") - .setType(NodeTypeEnum.COMMON) - .setClazz(CCmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("d") - .setName("组件D") - .setType(NodeTypeEnum.COMMON) - .setClazz(DCmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("e") - .setName("组件E") - .setType(NodeTypeEnum.SWITCH) - .setClazz(ECmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("f") - .setName("组件F") - .setType(NodeTypeEnum.COMMON) - .setClazz(FCmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("g") - .setName("组件G") - .setType(NodeTypeEnum.COMMON) - .setClazz(GCmp.class) - .build(); - - - LiteFlowChainBuilder.createChain().setChainName("chain2").setCondition( - LiteFlowConditionBuilder.createThenCondition().setValue("c,d").build() - ).build(); - - LiteFlowChainBuilder.createChain().setChainName("chain1").setCondition( - LiteFlowConditionBuilder - .createThenCondition() - .setValue("a,b").build() - ).setCondition( - LiteFlowConditionBuilder.createWhenCondition() - .setValue("e(f|g|chain2)").build() - ).build(); - - LiteflowResponse response = flowExecutor.execute2Resp("chain1"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a[组件A]==>b[组件B]==>e[组件E]==>c[组件C]==>d[组件D]", response.getExecuteStepStr()); - } - - - //基于普通组件的builder模式测试 - @Test - public void testBuilderForConditionNode() throws Exception { - LiteFlowNodeBuilder.createNode().setId("a") - .setName("组件A") - .setType(NodeTypeEnum.COMMON) - .setClazz(ACmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("b") - .setName("组件B") - .setType(NodeTypeEnum.COMMON) - .setClazz(BCmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("c") - .setName("组件C") - .setType(NodeTypeEnum.COMMON) - .setClazz(CCmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("d") - .setName("组件D") - .setType(NodeTypeEnum.COMMON) - .setClazz(DCmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("e") - .setName("组件E") - .setType(NodeTypeEnum.SWITCH) - .setClazz(ECmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("f") - .setName("组件F") - .setType(NodeTypeEnum.COMMON) - .setClazz(FCmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("g") - .setName("组件G") - .setType(NodeTypeEnum.COMMON) - .setClazz(GCmp.class) - .build(); - - - LiteFlowChainBuilder.createChain().setChainName("chain2").setCondition( - LiteFlowConditionBuilder.createThenCondition() - .setExecutable(new ExecutableEntity().setId("c")) - .setExecutable(new ExecutableEntity().setId("d")) - .build() - ).build(); - - LiteFlowChainBuilder.createChain().setChainName("chain1").setCondition( - LiteFlowConditionBuilder - .createThenCondition() - .setExecutable(new ExecutableEntity().setId("a").setTag("hello")) - .setExecutable(new ExecutableEntity().setId("b")) - .build() - ).setCondition( - LiteFlowConditionBuilder.createWhenCondition() - .setExecutable( - new ExecutableEntity().setId("e") - .addNodeCondComponent(new ExecutableEntity().setId("f").setTag("FHello")) - .addNodeCondComponent(new ExecutableEntity().setId("g")) - .addNodeCondComponent(new ExecutableEntity().setId("chain2") - )).build() - ).build(); - - LiteflowResponse response = flowExecutor.execute2Resp("chain1"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a[组件A]==>b[组件B]==>e[组件E]==>c[组件C]==>d[组件D]", response.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/BuilderSpringbootTest2.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/BuilderSpringbootTest2.java deleted file mode 100644 index fc8d67074..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/BuilderSpringbootTest2.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.yomahub.liteflow.test.builder; - -import com.yomahub.liteflow.builder.LiteFlowChainBuilder; -import com.yomahub.liteflow.builder.LiteFlowConditionBuilder; -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -//基于builder模式的单元测试 -//这里测试的是通过spring去扫描,但是通过代码去构建chain的用例 -@RunWith(SpringRunner.class) -@SpringBootTest(classes = BuilderSpringbootTest2.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.builder.cmp2"}) -public class BuilderSpringbootTest2 extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //通过spring去扫描组件,通过代码去构建chain - @Test - public void testBuilder() throws Exception { - LiteFlowChainBuilder.createChain().setChainName("chain1").setCondition( - LiteFlowConditionBuilder.createThenCondition().setValue("h,i,j").build() - ).build(); - - LiteflowResponse response = flowExecutor.execute2Resp("chain1"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("h==>i==>j", response.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/ACmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/ACmp.java deleted file mode 100644 index a9ffd1f01..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/ACmp.java +++ /dev/null @@ -1,22 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.builder.cmp1; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; - -@LiteflowCmpDefine -public class ACmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/BCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/BCmp.java deleted file mode 100644 index e13b0434f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/BCmp.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.builder.cmp1; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; - -@LiteflowCmpDefine -public class BCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/CCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/CCmp.java deleted file mode 100644 index 6fbbc10e6..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/CCmp.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.builder.cmp1; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; - -@LiteflowCmpDefine -public class CCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/DCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/DCmp.java deleted file mode 100644 index 27fb0fd46..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/DCmp.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.builder.cmp1; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; - -@LiteflowCmpDefine -public class DCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("DCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/ECmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/ECmp.java deleted file mode 100644 index 0e4627ec5..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/ECmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.builder.cmp1; - -import com.yomahub.liteflow.annotation.LiteflowSwitchCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; - -@LiteflowSwitchCmpDefine -public class ECmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS_SWITCH) - public String processSwitch(NodeComponent bindCmp) throws Exception { - System.out.println("ECmp executed!"); - return "chain2"; - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/FCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/FCmp.java deleted file mode 100644 index a300c50fd..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/FCmp.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.builder.cmp1; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; - -@LiteflowCmpDefine -public class FCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("FCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/GCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/GCmp.java deleted file mode 100644 index 4035e89ca..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/GCmp.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.builder.cmp1; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; - -@LiteflowCmpDefine -public class GCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("GCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp2/HCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp2/HCmp.java deleted file mode 100644 index a3bd495ac..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp2/HCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.builder.cmp2; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; - -@LiteflowComponent("h") -@LiteflowCmpDefine -public class HCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("HCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp2/ICmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp2/ICmp.java deleted file mode 100644 index a7546b330..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp2/ICmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.builder.cmp2; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; - -@LiteflowComponent("i") -@LiteflowCmpDefine -public class ICmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("ICmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp2/JCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp2/JCmp.java deleted file mode 100644 index a270fc3c9..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp2/JCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.builder.cmp2; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; - -@LiteflowComponent("j") -@LiteflowCmpDefine -public class JCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("JCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/LiteflowRetrySpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/LiteflowRetrySpringbootTest.java deleted file mode 100644 index bae024e7f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/LiteflowRetrySpringbootTest.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.yomahub.liteflow.test.cmpRetry; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - - -/** - * 测试springboot下的节点执行器 - * @author Bryan.Zhang - * @since 2.5.10 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/cmpRetry/application.properties") -@SpringBootTest(classes = LiteflowRetrySpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.cmpRetry.cmp"}) -public class LiteflowRetrySpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //全局重试配置测试 - @Test - public void testRetry1() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a==>b==>b==>b", response.getExecuteStepStr()); - } - - //单个组件重试配置测试 - @Test - public void testRetry2() { - LiteflowResponse response = flowExecutor.execute2Resp("chain2", "arg"); - Assert.assertFalse(response.isSuccess()); - Assert.assertEquals("c==>c==>c==>c==>c==>c", response.getExecuteStepStr()); - } - - //单个组件指定异常,但抛出的并不是指定异常的场景测试 - @Test - public void testRetry3() { - LiteflowResponse response = flowExecutor.execute2Resp("chain3", "arg"); - Assert.assertFalse(response.isSuccess()); - } - - //单个组件指定异常重试,抛出的是指定异常或者 - @Test - public void testRetry4() { - LiteflowResponse response = flowExecutor.execute2Resp("chain4", "arg"); - Assert.assertFalse(response.isSuccess()); - Assert.assertEquals("e==>e==>e==>e==>e==>e", response.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/ACmp.java deleted file mode 100644 index 2bd626295..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/ACmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.cmpRetry.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; - -@LiteflowComponent("a") -@LiteflowCmpDefine -public class ACmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/BCmp.java deleted file mode 100644 index 9107e2381..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/BCmp.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.cmpRetry.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; - -@LiteflowComponent("b") -@LiteflowCmpDefine -public class BCmp { - - private int flag = 0; - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("BCmp executed!"); - if (flag < 2){ - flag++; - throw new RuntimeException("demo exception"); - } - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/CCmp.java deleted file mode 100644 index 05ea10fd8..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/CCmp.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.cmpRetry.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.annotation.LiteflowRetry; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; - -@LiteflowComponent("c") -@LiteflowRetry(5) -@LiteflowCmpDefine -public class CCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("CCmp executed!"); - throw new RuntimeException("demo exception"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/DCmp.java deleted file mode 100644 index c3d21e729..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/DCmp.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.cmpRetry.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.annotation.LiteflowRetry; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; - -@LiteflowComponent("d") -@LiteflowRetry(retry = 5, forExceptions = {NullPointerException.class}) -@LiteflowCmpDefine -public class DCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("DCmp executed!"); - throw new RuntimeException("demo exception"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/ECmp.java deleted file mode 100644 index f33b4ca64..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/ECmp.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.cmpRetry.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.annotation.LiteflowRetry; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; - -@LiteflowComponent("e") -@LiteflowRetry(retry = 5, forExceptions = {NullPointerException.class}) -@LiteflowCmpDefine -public class ECmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("ECmp executed!"); - throw new NullPointerException("demo null exception"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/CmpStepSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/CmpStepSpringbootTest.java deleted file mode 100644 index b96d94d55..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/CmpStepSpringbootTest.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.yomahub.liteflow.test.cmpStep; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * springboot环境最普通的例子测试 - * @author Bryan.Zhang - * @since 2.6.4 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/cmpStep/application.properties") -@SpringBootTest(classes = CmpStepSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.cmpStep.cmp"}) -public class CmpStepSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testStep() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertFalse(response.isSuccess()); - Assert.assertTrue(response.getExecuteSteps().get("a").isSuccess()); - Assert.assertTrue(response.getExecuteSteps().get("b").isSuccess()); - Assert.assertFalse(response.getExecuteSteps().get("c").isSuccess()); - Assert.assertFalse(response.getExecuteSteps().get("d").isSuccess()); - Assert.assertTrue(response.getExecuteSteps().get("c").getTimeSpent() >= 2000); - Assert.assertEquals(RuntimeException.class, response.getExecuteSteps().get("c").getException().getClass()); - Assert.assertEquals(RuntimeException.class, response.getExecuteSteps().get("d").getException().getClass()); - } - - @Test - public void testStep2() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain2", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a==>b", response.getExecuteStepStrWithoutTime()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/ACmp.java deleted file mode 100644 index 0a1a806f6..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/ACmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.cmpStep.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("a") -@LiteflowCmpDefine -public class ACmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) throws Exception{ - Thread.sleep(5000L); - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/BCmp.java deleted file mode 100644 index 53999eaec..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/BCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.cmpStep.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("b") -@LiteflowCmpDefine -public class BCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/CCmp.java deleted file mode 100644 index 242a52331..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/CCmp.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.cmpStep.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("c") -@LiteflowCmpDefine -public class CCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) throws Exception{ - System.out.println("CCmp executed!"); - Thread.sleep(2000); - throw new RuntimeException("test error c"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/DCmp.java deleted file mode 100644 index b6b15845a..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/DCmp.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.cmpStep.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("d") -@LiteflowCmpDefine -public class DCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("CCmp executed!"); - throw new RuntimeException("test error d"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/ECmp.java deleted file mode 100644 index 8dde6a3b9..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/ECmp.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.cmpStep.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("e") -@LiteflowCmpDefine -public class ECmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("ECmp executed!"); - } - - @LiteflowMethod(LiteFlowMethodEnum.IS_ACCESS) - public boolean isAccess(NodeComponent bindCmp) { - return false; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/FlowExecutorSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/FlowExecutorSpringbootTest.java deleted file mode 100644 index 5bc400e2b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/FlowExecutorSpringbootTest.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.yomahub.liteflow.test.component; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.util.ReflectionUtils; - -import javax.annotation.Resource; - -/** - * 组件功能点测试 - * 单元测试 - * - * @author donguo.tao - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/component/application.properties") -@SpringBootTest(classes = FlowExecutorSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.component.cmp1","com.yomahub.liteflow.test.component.cmp2"}) -public class FlowExecutorSpringbootTest extends BaseTest { - private static final Logger LOG = LoggerFactory.getLogger(FlowExecutorSpringbootTest.class); - - @Resource - private FlowExecutor flowExecutor; - - //isAccess方法的功能测试 - @Test - public void testIsAccess() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", 101); - Assert.assertTrue(response.isSuccess()); - Assert.assertNotNull(response.getSlot().getResponseData()); - } - - //组件抛错的功能点测试 - @Test(expected = ArithmeticException.class) - public void testComponentException() throws Exception { - LiteflowResponse response = flowExecutor.execute2Resp("chain2", 0); - Assert.assertFalse(response.isSuccess()); - Assert.assertEquals("/ by zero", response.getMessage()); - ReflectionUtils.rethrowException(response.getCause()); - } - - //isContinueOnError方法的功能点测试 - @Test - public void testIsContinueOnError() throws Exception { - LiteflowResponse response = flowExecutor.execute2Resp("chain3", 0); - Assert.assertTrue(response.isSuccess()); - Assert.assertNull(response.getCause()); - } - - //isEnd方法的功能点测试 - @Test - public void testIsEnd() throws Exception { - LiteflowResponse response = flowExecutor.execute2Resp("chain4", 10); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("d",response.getExecuteStepStr()); - } - - //setIsEnd方法的功能点测试 - @Test - public void testSetIsEnd1() throws Exception { - LiteflowResponse response = flowExecutor.execute2Resp("chain5", 10); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("e",response.getExecuteStepStr()); - } - - //条件组件的功能点测试 - @Test - public void testNodeCondComponent() { - LiteflowResponse response = flowExecutor.execute2Resp("chain6", 0); - Assert.assertTrue(response.isSuccess()); - } - - //测试setIsEnd如果为true,continueError也为true,那不应该continue了 - @Test - public void testSetIsEnd2() throws Exception { - LiteflowResponse response = flowExecutor.execute2Resp("chain7", 10); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("g",response.getExecuteStepStr()); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/ACmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/ACmp.java deleted file mode 100644 index b91e674d7..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/ACmp.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.yomahub.liteflow.test.component.cmp1; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -import java.util.Objects; - - -@Component("a") -@LiteflowCmpDefine -public class ACmp{ - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("AComp executed!"); - bindCmp.getSlot().setResponseData("AComp executed!"); - } - - @LiteflowMethod(LiteFlowMethodEnum.IS_ACCESS) - public boolean isAccess(NodeComponent bindCmp) { - Integer requestData = bindCmp.getRequestData(); - if (Objects.nonNull(requestData) && requestData > 100){ - return true; - } - System.out.println("AComp isAccess false."); - return false; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/BCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/BCmp.java deleted file mode 100644 index 2ec25535a..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/BCmp.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.yomahub.liteflow.test.component.cmp1; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -import java.util.Objects; - - -@Component("b") -@LiteflowCmpDefine -public class BCmp{ - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("BComp executed!"); - Integer requestData = bindCmp.getRequestData(); - Integer divisor = 130; - Integer result = divisor / requestData; - bindCmp.getSlot().setResponseData(result); - } - - @LiteflowMethod(LiteFlowMethodEnum.IS_ACCESS) - public boolean isAccess(NodeComponent bindCmp) { - Integer requestData = bindCmp.getRequestData(); - if (Objects.nonNull(requestData)){ - return true; - } - return false; - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/CCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/CCmp.java deleted file mode 100644 index e4ad96ec4..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/CCmp.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.yomahub.liteflow.test.component.cmp1; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -import java.util.Objects; - - -@Component("c") -@LiteflowCmpDefine -public class CCmp{ - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("CComp executed!"); - Integer requestData = bindCmp.getRequestData(); - Integer divisor = 130; - Integer result = divisor / requestData; - bindCmp.getSlot().setResponseData(result); - System.out.println("responseData="+Integer.parseInt(bindCmp.getSlot().getResponseData())); - } - - @LiteflowMethod(LiteFlowMethodEnum.IS_CONTINUE_ON_ERROR) - public boolean isContinueOnError(NodeComponent bindCmp) { - Integer requestData = bindCmp.getRequestData(); - if (Objects.nonNull(requestData)){ - return true; - } - return false; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/DCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/DCmp.java deleted file mode 100644 index 96253f090..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/DCmp.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.yomahub.liteflow.test.component.cmp1; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -import java.util.Objects; - - -@Component("d") -@LiteflowCmpDefine -public class DCmp{ - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) throws Exception { - System.out.println("DComp executed!"); - } - - @LiteflowMethod(LiteFlowMethodEnum.IS_END) - public boolean isEnd(NodeComponent bindCmp) { - //组件的process执行完之后才会执行isEnd - Object requestData = bindCmp.getSlot().getResponseData(); - if (Objects.isNull(requestData)){ - System.out.println("DComp flow isEnd, because of responseData is null."); - return true; - } - return false; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/ECmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/ECmp.java deleted file mode 100644 index 397096535..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/ECmp.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.yomahub.liteflow.test.component.cmp1; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import com.yomahub.liteflow.util.JsonUtil; -import org.springframework.stereotype.Component; - -import java.util.Objects; - - -@Component("e") -@LiteflowCmpDefine -public class ECmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) throws Exception { - System.out.println("EComp executed!"); - Object responseData = bindCmp.getSlot().getResponseData(); - if (Objects.isNull(responseData)){ - System.out.println("EComp responseData flow must be set end ."); - //执行到某个条件时,手动结束流程。 - bindCmp.setIsEnd(true); - } - System.out.println("EComp responseData responseData=" + JsonUtil.toJsonString(responseData)); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/GCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/GCmp.java deleted file mode 100644 index ebfd97d28..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/GCmp.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.component.cmp1; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("g") -@LiteflowCmpDefine -public class GCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("GCmp executed!"); - bindCmp.setIsEnd(true); - } - - @LiteflowMethod(LiteFlowMethodEnum.IS_CONTINUE_ON_ERROR) - public boolean isContinueOnError(NodeComponent bindCmp) { - return true; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/HCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/HCmp.java deleted file mode 100644 index c2a30d0a5..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/HCmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.component.cmp1; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("h") -@LiteflowCmpDefine -public class HCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("HCmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp2/FCondCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp2/FCondCmp.java deleted file mode 100644 index 456c80743..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp2/FCondCmp.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.yomahub.liteflow.test.component.cmp2; - -import com.yomahub.liteflow.annotation.LiteflowSwitchCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -import java.util.Objects; - - -@Component("f") -@LiteflowSwitchCmpDefine -public class FCondCmp{ - @LiteflowMethod(LiteFlowMethodEnum.PROCESS_SWITCH) - public String processSwitch(NodeComponent bindCmp) { - Integer requestData = bindCmp.getRequestData(); - if (Objects.isNull(requestData)){ - return "d"; - } else if(requestData == 0){ - return "c"; - } else { - return "b"; - } - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customMethodName/CustomMethodNameSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customMethodName/CustomMethodNameSpringbootTest.java deleted file mode 100644 index 3f1d970ff..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customMethodName/CustomMethodNameSpringbootTest.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.yomahub.liteflow.test.customMethodName; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * 声明式组件自定义方法的测试用例 - * @author Bryan.Zhang - * @since 2.7.2 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/customMethodName/application.properties") -@SpringBootTest(classes = CustomMethodNameSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.customMethodName.cmp"}) -public class CustomMethodNameSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testCustomMethodName() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customMethodName/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customMethodName/cmp/ACmp.java deleted file mode 100644 index 890d0b5b5..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customMethodName/cmp/ACmp.java +++ /dev/null @@ -1,57 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.customMethodName.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; -import org.springframework.stereotype.Component; - -@Component("a") -@LiteflowCmpDefine -public class ACmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void processAcmp(NodeComponent bindCmp) { - System.out.println("ACmp executed!"); - } - - @LiteflowMethod(LiteFlowMethodEnum.IS_ACCESS) - public boolean isAcmpAccess(NodeComponent bindCmp){ - return true; - } - - @LiteflowMethod(LiteFlowMethodEnum.BEFORE_PROCESS) - public void beforeAcmp(String nodeId, Slot slot){ - System.out.println("before A"); - } - - @LiteflowMethod(LiteFlowMethodEnum.AFTER_PROCESS) - public void afterAcmp(String nodeId, Slot slot){ - System.out.println("after A"); - } - - @LiteflowMethod(LiteFlowMethodEnum.ON_SUCCESS) - public void onAcmpSuccess(NodeComponent bindCmp){ - System.out.println("Acmp success"); - } - - @LiteflowMethod(LiteFlowMethodEnum.ON_ERROR) - public void onAcmpError(NodeComponent bindCmp){ - System.out.println("Acmp error"); - } - - @LiteflowMethod(LiteFlowMethodEnum.IS_END) - public boolean isAcmpEnd(NodeComponent bindCmp) { - System.out.println("Acmp end config"); - return false; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customMethodName/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customMethodName/cmp/BCmp.java deleted file mode 100644 index ba4c72df3..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customMethodName/cmp/BCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.customMethodName.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("b") -@LiteflowCmpDefine -public class BCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void processBcmp(NodeComponent bindCmp) { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/CustomNodesSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/CustomNodesSpringbootTest.java deleted file mode 100644 index 6437c5640..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/CustomNodesSpringbootTest.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.yomahub.liteflow.test.customNodes; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * springboot环境下自定义声明节点的测试 - * 不通过spring扫描的方式,通过在配置文件里定义nodes的方式 - * @author Bryan.Zhang - * @since 2.6.4 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/customNodes/application.properties") -@SpringBootTest(classes = CustomNodesSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.customNodes.domain"}) -public class CustomNodesSpringbootTest extends BaseTest { - - private final Logger log = LoggerFactory.getLogger(this.getClass()); - - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testCustomNodes() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - response = flowExecutor.execute2Resp("chain2", "arg"); - Assert.assertTrue(response.isSuccess()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/ACmp.java deleted file mode 100644 index fb8982c22..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/ACmp.java +++ /dev/null @@ -1,22 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.customNodes.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; - -@LiteflowCmpDefine -public class ACmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/BCmp.java deleted file mode 100644 index 67ed16bcf..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/BCmp.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.customNodes.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import com.yomahub.liteflow.test.customNodes.domain.DemoDomain; - -import javax.annotation.Resource; - -@LiteflowCmpDefine -public class BCmp{ - - @Resource - private DemoDomain demoDomain; - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - demoDomain.sayHi(); - System.out.println("BCmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/CCmp.java deleted file mode 100644 index d4ee3cf17..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/CCmp.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.customNodes.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; - -@LiteflowCmpDefine -public class CCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/DCmp.java deleted file mode 100644 index 619905b1e..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/DCmp.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.customNodes.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; - -@LiteflowCmpDefine -public class DCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("DCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/ECmp.java deleted file mode 100644 index 27b3243ce..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/ECmp.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.customNodes.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import com.yomahub.liteflow.test.customNodes.domain.DemoDomain; - -import javax.annotation.Resource; - -@LiteflowCmpDefine -public class ECmp{ - - @Resource - private DemoDomain demoDomain; - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - demoDomain.sayHi(); - System.out.println("ECmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/FCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/FCmp.java deleted file mode 100644 index a7f22de97..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/FCmp.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.customNodes.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; - -@LiteflowCmpDefine -public class FCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("FCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/domain/DemoDomain.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/domain/DemoDomain.java deleted file mode 100644 index d0b10dc0b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/domain/DemoDomain.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.yomahub.liteflow.test.customNodes.domain; - -import org.springframework.stereotype.Component; - -@Component -public class DemoDomain { - - public void sayHi(){ - System.out.println("hi"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor1.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor1.java deleted file mode 100644 index 6f88c4cdd..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor1.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.yomahub.liteflow.test.customWhenThreadPool; - -import cn.hutool.core.util.ObjectUtil; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.property.LiteflowConfigGetter; -import com.yomahub.liteflow.thread.ExecutorBuilder; - -import java.util.concurrent.ExecutorService; - -public class CustomThreadExecutor1 implements ExecutorBuilder { - - @Override - public ExecutorService buildExecutor() { - LiteflowConfig liteflowConfig = LiteflowConfigGetter.get(); - //只有在非spring的场景下liteflowConfig才会为null - if (ObjectUtil.isNull(liteflowConfig)) { - liteflowConfig = new LiteflowConfig(); - } - return buildDefaultExecutor( - liteflowConfig.getWhenMaxWorkers(), - liteflowConfig.getWhenMaxWorkers(), - liteflowConfig.getWhenQueueLimit(), - "customer-when-1-thead-"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor2.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor2.java deleted file mode 100644 index 7d45e4ad5..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor2.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.yomahub.liteflow.test.customWhenThreadPool; - -import cn.hutool.core.util.ObjectUtil; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.property.LiteflowConfigGetter; -import com.yomahub.liteflow.thread.ExecutorBuilder; - -import java.util.concurrent.ExecutorService; - -public class CustomThreadExecutor2 implements ExecutorBuilder { - @Override - public ExecutorService buildExecutor() { - LiteflowConfig liteflowConfig = LiteflowConfigGetter.get(); - //只有在非spring的场景下liteflowConfig才会为null - if (ObjectUtil.isNull(liteflowConfig)) { - liteflowConfig = new LiteflowConfig(); - } - return buildDefaultExecutor( - liteflowConfig.getWhenMaxWorkers(), - liteflowConfig.getWhenMaxWorkers(), - liteflowConfig.getWhenQueueLimit(), - "customer-when-2-thead-"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor3.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor3.java deleted file mode 100644 index 875dc3d1d..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor3.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.yomahub.liteflow.test.customWhenThreadPool; - -import cn.hutool.core.util.ObjectUtil; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.property.LiteflowConfigGetter; -import com.yomahub.liteflow.thread.ExecutorBuilder; - -import java.util.concurrent.ExecutorService; - -public class CustomThreadExecutor3 implements ExecutorBuilder { - @Override - public ExecutorService buildExecutor() { - LiteflowConfig liteflowConfig = LiteflowConfigGetter.get(); - //只有在非spring的场景下liteflowConfig才会为null - if (ObjectUtil.isNull(liteflowConfig)) { - liteflowConfig = new LiteflowConfig(); - } - return buildDefaultExecutor( - liteflowConfig.getWhenMaxWorkers(), - liteflowConfig.getWhenMaxWorkers(), - liteflowConfig.getWhenQueueLimit(), - "customer-when-3-thead-"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomWhenThreadPoolSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomWhenThreadPoolSpringbootTest.java deleted file mode 100644 index 766ed3165..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomWhenThreadPoolSpringbootTest.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.yomahub.liteflow.test.customWhenThreadPool; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * springboot环境下异步线程超时日志打印测试 - * - * @author Bryan.Zhang - * @since 2.6.4 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/customWhenThreadPool/application.properties") -@SpringBootTest(classes = CustomWhenThreadPoolSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.customWhenThreadPool.cmp"}) -public class CustomWhenThreadPoolSpringbootTest extends BaseTest { - - private final Logger log = LoggerFactory.getLogger(this.getClass()); - - @Resource - private FlowExecutor flowExecutor; - - /** - * 测试全局线程池配置 - */ - @Test - public void testGlobalThreadPool() { - LiteflowResponse response = flowExecutor.execute2Resp("chain", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - Assert.assertTrue(context.getData("threadName").toString().startsWith("lf-when-thead")); - } - - /** - * 测试全局和when上自定义线程池-优先以when上为准 - */ - @Test - public void testGlobalAndCustomWhenThreadPool() { - LiteflowResponse response1 = flowExecutor.execute2Resp("chain1", "arg"); - DefaultContext context = response1.getFirstContextBean(); - Assert.assertTrue(response1.isSuccess()); - Assert.assertTrue(context.getData("threadName").toString().startsWith("customer-when-1-thead")); - } - - - /** - * when配置的线程池可以共用 - */ - @Test - public void testCustomWhenThreadPool() { - // 使用when - thread1 - testGlobalAndCustomWhenThreadPool(); - // chain配置同一个thead1 - LiteflowResponse response2 = flowExecutor.execute2Resp("chain2", "arg"); - DefaultContext context = response2.getFirstContextBean(); - Assert.assertTrue(response2.isSuccess()); - Assert.assertTrue(context.getData("threadName").toString().startsWith("customer-when-1-thead")); - - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/ACmp.java deleted file mode 100644 index ebe0cbf58..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/ACmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.customWhenThreadPool.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("a") -@LiteflowCmpDefine -public class ACmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/BCmp.java deleted file mode 100644 index 7f506aa29..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/BCmp.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.customWhenThreadPool.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import com.yomahub.liteflow.slot.DefaultContext; -import org.springframework.stereotype.Component; - -@Component("b") -@LiteflowCmpDefine -public class BCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - DefaultContext context = bindCmp.getFirstContextBean(); - context.setData("threadName", Thread.currentThread().getName()); - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/CCmp.java deleted file mode 100644 index 39a1213fb..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/CCmp.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.customWhenThreadPool.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import com.yomahub.liteflow.slot.DefaultContext; -import org.springframework.stereotype.Component; - -@Component("c") -@LiteflowCmpDefine -public class CCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - DefaultContext context = bindCmp.getFirstContextBean(); - context.setData("threadName", Thread.currentThread().getName()); - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/DCmp.java deleted file mode 100644 index e06ad1efa..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/DCmp.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.customWhenThreadPool.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import com.yomahub.liteflow.slot.DefaultContext; -import org.springframework.stereotype.Component; - -@Component("d") -@LiteflowCmpDefine -public class DCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - DefaultContext context = bindCmp.getFirstContextBean(); - context.setData("threadName", Thread.currentThread().getName()); - System.out.println("DCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/ECmp.java deleted file mode 100644 index 983cfbf8d..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/ECmp.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.customWhenThreadPool.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import com.yomahub.liteflow.slot.DefaultContext; -import org.springframework.stereotype.Component; - -@Component("e") -@LiteflowCmpDefine -public class ECmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - DefaultContext context = bindCmp.getFirstContextBean(); - context.setData("threadName", Thread.currentThread().getName()); - System.out.println("ECmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/FCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/FCmp.java deleted file mode 100644 index ddb239028..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/FCmp.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.customWhenThreadPool.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import com.yomahub.liteflow.slot.DefaultContext; -import org.springframework.stereotype.Component; - -@Component("f") -@LiteflowCmpDefine -public class FCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - DefaultContext context = bindCmp.getFirstContextBean(); - context.setData("threadName", Thread.currentThread().getName()); - System.out.println("FCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/event/EventSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/event/EventSpringbootTest.java deleted file mode 100644 index 0bcf48b1f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/event/EventSpringbootTest.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.yomahub.liteflow.test.event; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * springboot环境最普通的例子测试 - * @author Bryan.Zhang - * @since 2.6.4 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/event/application.properties") -@SpringBootTest(classes = EventSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.event.cmp"}) -public class EventSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //测试组件成功事件 - @Test - public void testEvent1() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("abc", context.getData("test")); - } - - //测试组件失败事件 - @Test - public void testEvent2() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain2", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertFalse(response.isSuccess()); - Assert.assertEquals(NullPointerException.class, response.getCause().getClass()); - Assert.assertEquals("ab", context.getData("test")); - Assert.assertEquals("error:d", context.getData("error")); - } - - //测试组件失败事件本身抛出异常 - @Test - public void testEvent3() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain3", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertFalse(response.isSuccess()); - Assert.assertEquals(NullPointerException.class, response.getCause().getClass()); - Assert.assertEquals("a", context.getData("test")); - Assert.assertEquals("error:e", context.getData("error")); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/event/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/event/cmp/ACmp.java deleted file mode 100644 index a21f927d6..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/event/cmp/ACmp.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.event.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import com.yomahub.liteflow.slot.DefaultContext; -import org.springframework.stereotype.Component; - -@Component("a") -@LiteflowCmpDefine -public class ACmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - DefaultContext context = bindCmp.getFirstContextBean(); - context.setData("test",""); - System.out.println("ACmp executed!"); - } - - @LiteflowMethod(LiteFlowMethodEnum.ON_SUCCESS) - public void onSuccess(NodeComponent bindCmp) throws Exception { - DefaultContext context = bindCmp.getFirstContextBean(); - String str = context.getData("test"); - str += bindCmp.getNodeId(); - context.setData("test", str); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/event/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/event/cmp/BCmp.java deleted file mode 100644 index 07985de02..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/event/cmp/BCmp.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.event.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import com.yomahub.liteflow.slot.DefaultContext; -import org.springframework.stereotype.Component; - -@Component("b") -@LiteflowCmpDefine -public class BCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("BCmp executed!"); - } - - @LiteflowMethod(LiteFlowMethodEnum.ON_SUCCESS) - public void onSuccess(NodeComponent bindCmp) throws Exception { - DefaultContext context = bindCmp.getFirstContextBean(); - String str = context.getData("test"); - str += bindCmp.getNodeId(); - context.setData("test", str); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/event/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/event/cmp/CCmp.java deleted file mode 100644 index 4b1328852..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/event/cmp/CCmp.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.event.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import com.yomahub.liteflow.slot.DefaultContext; -import org.springframework.stereotype.Component; - -@Component("c") -@LiteflowCmpDefine -public class CCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("CCmp executed!"); - } - - @LiteflowMethod(LiteFlowMethodEnum.ON_SUCCESS) - public void onSuccess(NodeComponent bindCmp) throws Exception { - DefaultContext context = bindCmp.getFirstContextBean(); - String str = context.getData("test"); - str += bindCmp.getNodeId(); - context.setData("test", str); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/event/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/event/cmp/DCmp.java deleted file mode 100644 index 282f18539..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/event/cmp/DCmp.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.event.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import com.yomahub.liteflow.slot.DefaultContext; -import org.springframework.stereotype.Component; - -@Component("d") -@LiteflowCmpDefine -public class DCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) throws Exception{ - System.out.println("CCmp executed!"); - throw new NullPointerException(); - } - - @LiteflowMethod(LiteFlowMethodEnum.ON_ERROR) - public void onError(NodeComponent bindCmp) throws Exception { - DefaultContext context = bindCmp.getFirstContextBean(); - context.setData("error","error:"+bindCmp.getNodeId()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/event/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/event/cmp/ECmp.java deleted file mode 100644 index 01ae0c0c9..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/event/cmp/ECmp.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.event.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import com.yomahub.liteflow.slot.DefaultContext; -import org.springframework.stereotype.Component; - -@Component("e") -@LiteflowCmpDefine -public class ECmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) throws Exception{ - System.out.println("CCmp executed!"); - throw new NullPointerException(); - } - - @LiteflowMethod(LiteFlowMethodEnum.ON_ERROR) - public void onError(NodeComponent bindCmp) throws Exception { - DefaultContext context = bindCmp.getFirstContextBean(); - context.setData("error","error:"+bindCmp.getNodeId()); - throw new IllegalAccessException("错误事件回调本身抛出异常"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/exception/CustomStatefulException.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/exception/CustomStatefulException.java deleted file mode 100644 index 11441ab58..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/exception/CustomStatefulException.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.yomahub.liteflow.test.exception; - -import com.yomahub.liteflow.exception.LiteFlowException; - -/** - * 用户自定义带状态码的异常 - */ -public class CustomStatefulException extends LiteFlowException { - public CustomStatefulException(String code, String message) { - super(code, message); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/exception/Exception1SpringBootTest.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/exception/Exception1SpringBootTest.java deleted file mode 100644 index dfe350393..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/exception/Exception1SpringBootTest.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.yomahub.liteflow.test.exception; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.exception.ChainDuplicateException; -import com.yomahub.liteflow.exception.ConfigErrorException; -import com.yomahub.liteflow.exception.FlowExecutorNotInitException; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.property.LiteflowConfigGetter; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * 流程执行异常 - * 单元测试 - * - * @author zendwang - */ -@RunWith(SpringRunner.class) -@SpringBootTest(classes = Exception1SpringBootTest.class) -@EnableAutoConfiguration -public class Exception1SpringBootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - /** - * 验证 chain 节点重复的异常 - */ - @Test(expected = ChainDuplicateException.class) - public void testChainDuplicateException() { - LiteflowConfig config = LiteflowConfigGetter.get(); - config.setRuleSource("exception/flow-exception.xml"); - flowExecutor.init(); - } - - @Test(expected = ConfigErrorException.class) - public void testConfigErrorException() { - flowExecutor.setLiteflowConfig(null); - flowExecutor.init(); - } - - @Test(expected = FlowExecutorNotInitException.class) - public void testFlowExecutorNotInitException() { - LiteflowConfig config = LiteflowConfigGetter.get(); - config.setRuleSource("error/flow.txt"); - flowExecutor.init(); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/exception/Exception2SpringBootTest.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/exception/Exception2SpringBootTest.java deleted file mode 100644 index 50730f2c5..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/exception/Exception2SpringBootTest.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.yomahub.liteflow.test.exception; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.exception.*; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.ApplicationContext; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.util.ReflectionUtils; - -import javax.annotation.Resource; - -/** - * 流程执行异常 - * 单元测试 - * - * @author zendwang - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/exception/application.properties") -@SpringBootTest(classes = Exception2SpringBootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.exception.cmp"}) -public class Exception2SpringBootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - @Test(expected = ChainNotFoundException.class) - public void testChainNotFoundException() throws Exception { - flowExecutor.execute("chain0", "it's a request"); - } - - @Test(expected = RuntimeException.class) - public void testComponentCustomException() throws Exception { - flowExecutor.execute("chain1", "exception"); - } - - @Test(expected = FlowSystemException.class) - public void testNoConditionInChainException() throws Exception { - LiteflowResponse response = flowExecutor.execute2Resp("chain2", "test"); - Assert.assertFalse(response.isSuccess()); - Assert.assertEquals("no conditionList in this chain[chain2]", response.getMessage()); - ReflectionUtils.rethrowException(response.getCause()); - } - - @Test - public void testGetSlotFromResponseWhenException() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain4", "test"); - Assert.assertFalse(response.isSuccess()); - Assert.assertNotNull(response.getCause()); - Assert.assertNotNull(response.getSlot()); - } - - @Test(expected = NoSwitchTargetNodeException.class) - public void testNoTargetFindException() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain5", "test"); - Assert.assertFalse(response.isSuccess()); - throw response.getCause(); - } - - @Test - public void testInvokeCustomStatefulException() { - LiteflowResponse response = flowExecutor.execute2Resp("chain6", "custom-stateful-exception"); - Assert.assertFalse(response.isSuccess()); - Assert.assertEquals("300", response.getCode()); - Assert.assertNotNull(response.getCause()); - Assert.assertTrue(response.getCause() instanceof LiteFlowException); - Assert.assertNotNull(response.getSlot()); - } - - @Test - public void testNotInvokeCustomStatefulException() { - LiteflowResponse response = flowExecutor.execute2Resp("chain6", "test"); - Assert.assertTrue(response.isSuccess()); - Assert.assertNull(response.getCode()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/ACmp.java deleted file mode 100644 index b76dabf10..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/ACmp.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.exception.cmp; - -import cn.hutool.core.util.StrUtil; -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; - -@Component("a") -@LiteflowCmpDefine -public class ACmp{ - - private static final Logger LOG = LoggerFactory.getLogger(ACmp.class); - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - String str = bindCmp.getRequestData(); - if(StrUtil.isNotBlank(str) && str.equals("exception")) { - throw new RuntimeException("chain execute execption"); - } - LOG.info("Acomp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/BCmp.java deleted file mode 100644 index e55d03fde..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/BCmp.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.exception.cmp; - -import cn.hutool.core.util.StrUtil; -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; - -@Component("b") -@LiteflowCmpDefine -public class BCmp{ - - private static final Logger LOG = LoggerFactory.getLogger(BCmp.class); - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) throws InterruptedException { - String str = bindCmp.getRequestData(); - if(StrUtil.isNotBlank(str) && str.equals("when")) { - try { - LOG.info("Bcomp sleep begin"); - Thread.sleep(3000); - LOG.info("Bcomp sleep end"); - } catch (InterruptedException e) { - throw e; - } - } - LOG.info("Bcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/CCmp.java deleted file mode 100644 index 4e4b4e25c..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/CCmp.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.exception.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; - -@Component("c") -@LiteflowCmpDefine -public class CCmp{ - - private static final Logger LOG = LoggerFactory.getLogger(CCmp.class); - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - LOG.info("Ccomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/DCmp.java deleted file mode 100644 index 6da4fe9a1..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/DCmp.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.exception.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; - -@Component("d") -@LiteflowCmpDefine -public class DCmp{ - - private static final Logger LOG = LoggerFactory.getLogger(DCmp.class); - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - if(1==1){ - int a = 1/0; - } - LOG.info("Dcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/ECmp.java deleted file mode 100644 index db2706e6a..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/ECmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.exception.cmp; - -import com.yomahub.liteflow.annotation.LiteflowSwitchCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("e") -@LiteflowSwitchCmpDefine -public class ECmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS_SWITCH) - public String processSwitch(NodeComponent bindCmp) throws Exception { - return "a"; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/FCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/FCmp.java deleted file mode 100644 index f0b3ccbf5..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/FCmp.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.exception.cmp; - -import cn.hutool.core.util.StrUtil; -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import com.yomahub.liteflow.test.exception.CustomStatefulException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; - -@Component("f") -@LiteflowCmpDefine -public class FCmp { - - private static final Logger LOG = LoggerFactory.getLogger(FCmp.class); - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - String str = bindCmp.getRequestData(); - if(StrUtil.isNotBlank(str) && str.equals("custom-stateful-exception")) { - throw new CustomStatefulException("300", "chain execute custom stateful execption"); - } - LOG.info("Fcomp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/GCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/GCmp.java deleted file mode 100644 index 109285814..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/GCmp.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.exception.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; - -@Component("g") -@LiteflowCmpDefine -public class GCmp { - - private static final Logger LOG = LoggerFactory.getLogger(GCmp.class); - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - LOG.info("Gcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/execute2Future/Executor2FutureSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/execute2Future/Executor2FutureSpringbootTest.java deleted file mode 100644 index 7327cc568..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/execute2Future/Executor2FutureSpringbootTest.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.yomahub.liteflow.test.execute2Future; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; -import java.util.concurrent.Future; - -/** - * springboot环境执行返回future的例子 - * @author Bryan.Zhang - * @since 2.6.13 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/execute2Future/application.properties") -@SpringBootTest(classes = Executor2FutureSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.execute2Future.cmp"}) -public class Executor2FutureSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testFuture() throws Exception{ - Future future = flowExecutor.execute2Future("chain1", "arg", DefaultContext.class); - LiteflowResponse response = future.get(); - Assert.assertTrue(response.isSuccess()); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/execute2Future/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/execute2Future/cmp/ACmp.java deleted file mode 100644 index a46e144e0..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/execute2Future/cmp/ACmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.execute2Future.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("a") -@LiteflowCmpDefine -public class ACmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/execute2Future/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/execute2Future/cmp/BCmp.java deleted file mode 100644 index 2678f2557..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/execute2Future/cmp/BCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.execute2Future.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("b") -@LiteflowCmpDefine -public class BCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/execute2Future/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/execute2Future/cmp/CCmp.java deleted file mode 100644 index a3ca40a89..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/execute2Future/cmp/CCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.execute2Future.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("c") -@LiteflowCmpDefine -public class CCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/execute2Future/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/execute2Future/cmp/DCmp.java deleted file mode 100644 index 121619827..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/execute2Future/cmp/DCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.execute2Future.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("d") -@LiteflowCmpDefine -public class DCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/extend/CmpExtendSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/extend/CmpExtendSpringbootTest.java deleted file mode 100644 index 5363b5c9a..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/extend/CmpExtendSpringbootTest.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.yomahub.liteflow.test.extend; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * springboot环境测试声明式组件继承其他类的场景 - * @author Bryan.Zhang - * @since 2.7.1 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/extend/application.properties") -@SpringBootTest(classes = CmpExtendSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.extend.cmp"}) -public class CmpExtendSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testExtend() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/extend/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/extend/cmp/ACmp.java deleted file mode 100644 index 58ee70a52..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/extend/cmp/ACmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.extend.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("a") -@LiteflowCmpDefine -public class ACmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/extend/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/extend/cmp/BCmp.java deleted file mode 100644 index a2bcb708b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/extend/cmp/BCmp.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.extend.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("b") -@LiteflowCmpDefine -public class BCmp extends ParentCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("BCmp executed!"); - System.out.println(this.sayHi("jack")); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/extend/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/extend/cmp/CCmp.java deleted file mode 100644 index c95125f64..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/extend/cmp/CCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.extend.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("c") -@LiteflowCmpDefine -public class CCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/extend/cmp/ParentCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/extend/cmp/ParentCmp.java deleted file mode 100644 index a739a2620..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/extend/cmp/ParentCmp.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.yomahub.liteflow.test.extend.cmp; - -import cn.hutool.core.util.StrUtil; - -public class ParentCmp { - - protected String sayHi(String name){ - return StrUtil.format("hi,{}",name); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/flowmeta/FlowMetaSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/flowmeta/FlowMetaSpringbootTest.java deleted file mode 100644 index 06e826e75..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/flowmeta/FlowMetaSpringbootTest.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.yomahub.liteflow.test.flowmeta; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.flow.FlowBus; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import com.yomahub.liteflow.test.flowmeta.cmp2.DCmp; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/flowmeta/application.properties") -@SpringBootTest(classes = FlowMetaSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.flowmeta.cmp1"}) -public class FlowMetaSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //测试动态添加元信息节点 - @Test - public void testFlowMeta() { - FlowBus.addCommonNode("d", "d组件", DCmp.class.getName()); - LiteflowResponse response= flowExecutor.execute2Resp("chain1", "it's a request"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a==>b==>c==>d[d组件]", response.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/flowmeta/cmp1/ACmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/flowmeta/cmp1/ACmp.java deleted file mode 100644 index 4c315157b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/flowmeta/cmp1/ACmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.flowmeta.cmp1; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("a") -@LiteflowCmpDefine -public class ACmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/flowmeta/cmp1/BCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/flowmeta/cmp1/BCmp.java deleted file mode 100644 index 134185aef..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/flowmeta/cmp1/BCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.flowmeta.cmp1; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("b") -@LiteflowCmpDefine -public class BCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/flowmeta/cmp1/CCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/flowmeta/cmp1/CCmp.java deleted file mode 100644 index 30c3f8bfb..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/flowmeta/cmp1/CCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.flowmeta.cmp1; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("c") -@LiteflowCmpDefine -public class CCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/flowmeta/cmp2/DCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/flowmeta/cmp2/DCmp.java deleted file mode 100644 index 260ad8091..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/flowmeta/cmp2/DCmp.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.flowmeta.cmp2; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; - -@LiteflowCmpDefine -public class DCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("Dcomp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/lazy/LazySpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/lazy/LazySpringbootTest.java deleted file mode 100644 index e656a9029..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/lazy/LazySpringbootTest.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.yomahub.liteflow.test.lazy; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/lazy/application.properties") -@SpringBootTest(classes = LazySpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.lazy.cmp"}) -public class LazySpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testLazy() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/lazy/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/lazy/cmp/ACmp.java deleted file mode 100644 index 01a43e2a2..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/lazy/cmp/ACmp.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.lazy.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.context.annotation.Lazy; -import org.springframework.stereotype.Component; - -@Lazy -@Component("a") -@LiteflowCmpDefine -public class ACmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/lazy/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/lazy/cmp/BCmp.java deleted file mode 100644 index 628760c66..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/lazy/cmp/BCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.lazy.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("b") -@LiteflowCmpDefine -public class BCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/lazy/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/lazy/cmp/CCmp.java deleted file mode 100644 index 781d1a209..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/lazy/cmp/CCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.lazy.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("c") -@LiteflowCmpDefine -public class CCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/lfCmpAnno/LiteflowComponentSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/lfCmpAnno/LiteflowComponentSpringbootTest.java deleted file mode 100644 index c47a29a2b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/lfCmpAnno/LiteflowComponentSpringbootTest.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.yomahub.liteflow.test.lfCmpAnno; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - - -/** - * 测试@LiteflowComponent标注 - * @author Bryan.Zhang - * @since 2.5.10 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/lfCmpAnno/application.properties") -@SpringBootTest(classes = LiteflowComponentSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.lfCmpAnno.cmp"}) -public class LiteflowComponentSpringbootTest extends BaseTest { - - @Autowired - private FlowExecutor flowExecutor; - - @Test - public void testConfig() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a[A组件]==>b[B组件]==>c[C组件]==>b[B组件]==>a[A组件]==>d", response.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/lfCmpAnno/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/lfCmpAnno/cmp/ACmp.java deleted file mode 100644 index 8081c7084..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/lfCmpAnno/cmp/ACmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.lfCmpAnno.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; - -@LiteflowComponent(id = "a", name = "A组件") -@LiteflowCmpDefine -public class ACmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/lfCmpAnno/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/lfCmpAnno/cmp/BCmp.java deleted file mode 100644 index 30a7e689e..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/lfCmpAnno/cmp/BCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.lfCmpAnno.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; - -@LiteflowComponent(id = "b", name = "B组件") -@LiteflowCmpDefine -public class BCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/lfCmpAnno/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/lfCmpAnno/cmp/CCmp.java deleted file mode 100644 index 6090b44fc..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/lfCmpAnno/cmp/CCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.lfCmpAnno.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; - -@LiteflowComponent(id = "c", name = "C组件") -@LiteflowCmpDefine -public class CCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/lfCmpAnno/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/lfCmpAnno/cmp/DCmp.java deleted file mode 100644 index 967f00f33..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/lfCmpAnno/cmp/DCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.lfCmpAnno.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; - -@LiteflowComponent("d") -@LiteflowCmpDefine -public class DCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("DCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/monitor/MonitorSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/monitor/MonitorSpringbootTest.java deleted file mode 100644 index c151cbaa3..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/monitor/MonitorSpringbootTest.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.yomahub.liteflow.test.monitor; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.monitor.MonitorBus; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.spi.holder.ContextAwareHolder; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * springboot环境最普通的例子测试 - * @author Bryan.Zhang - * @since 2.6.4 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/monitor/application.properties") -@SpringBootTest(classes = MonitorSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.monitor.cmp"}) -public class MonitorSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testMonitor() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - - Thread.sleep(10000); - } - - @AfterClass - public static void clean(){ - MonitorBus monitorBus = ContextAwareHolder.loadContextAware().getBean(MonitorBus.class); - monitorBus.closeScheduler(); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/monitor/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/monitor/cmp/ACmp.java deleted file mode 100644 index 314ca078f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/monitor/cmp/ACmp.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.monitor.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -import java.util.Random; - -@Component("a") -@LiteflowCmpDefine -public class ACmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - try { - Thread.sleep(new Random().nextInt(2000)); - }catch (Exception e){ - e.printStackTrace(); - } - - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/monitor/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/monitor/cmp/BCmp.java deleted file mode 100644 index 51d239b72..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/monitor/cmp/BCmp.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.monitor.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -import java.util.Random; - -@Component("b") -@LiteflowCmpDefine -public class BCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - try { - Thread.sleep(new Random().nextInt(2000)); - }catch (Exception e){ - e.printStackTrace(); - } - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/monitor/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/monitor/cmp/CCmp.java deleted file mode 100644 index 3d802e5ea..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/monitor/cmp/CCmp.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.monitor.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -import java.util.Random; - -@Component("c") -@LiteflowCmpDefine -public class CCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - try { - Thread.sleep(new Random().nextInt(2000)); - }catch (Exception e){ - e.printStackTrace(); - } - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/multipleType/LiteflowMultipleTypeSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/multipleType/LiteflowMultipleTypeSpringbootTest.java deleted file mode 100644 index 74659c688..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/multipleType/LiteflowMultipleTypeSpringbootTest.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.yomahub.liteflow.test.multipleType; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - - -/** - * 测试springboot下混合格式规则的场景 - * @author Bryan.Zhang - * @since 2.5.10 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/multipleType/application.properties") -@SpringBootTest(classes = LiteflowMultipleTypeSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.multipleType.cmp"}) -public class LiteflowMultipleTypeSpringbootTest extends BaseTest { - - @Autowired - private FlowExecutor flowExecutor; - - @Test - public void testMultipleType() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a==>b==>c==>b==>a", response.getExecuteStepStr()); - response = flowExecutor.execute2Resp("chain3", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a==>b==>c", response.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/multipleType/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/multipleType/cmp/ACmp.java deleted file mode 100644 index 31fb6b256..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/multipleType/cmp/ACmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.multipleType.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("a") -@LiteflowCmpDefine -public class ACmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/multipleType/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/multipleType/cmp/BCmp.java deleted file mode 100644 index 4f6b64dfc..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/multipleType/cmp/BCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.multipleType.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("b") -@LiteflowCmpDefine -public class BCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/multipleType/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/multipleType/cmp/CCmp.java deleted file mode 100644 index 66dadb7ea..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/multipleType/cmp/CCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.multipleType.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("c") -@LiteflowCmpDefine -public class CCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/nodeExecutor/CustomerDefaultNodeExecutor.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/nodeExecutor/CustomerDefaultNodeExecutor.java deleted file mode 100644 index 0ced9da9f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/nodeExecutor/CustomerDefaultNodeExecutor.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.yomahub.liteflow.test.nodeExecutor; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DataBus; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; -import com.yomahub.liteflow.flow.executor.NodeExecutor; - -/** - * 自定义默认的节点执行器 - */ -public class CustomerDefaultNodeExecutor extends NodeExecutor { - @Override - public void execute(NodeComponent instance) throws Exception { - DefaultContext context = instance.getFirstContextBean(); - LOG.info("使用customerDefaultNodeExecutor进行执行"); - context.setData("customerDefaultNodeExecutor", this.getClass()); - super.execute(instance); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/nodeExecutor/CustomerNodeExecutor.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/nodeExecutor/CustomerNodeExecutor.java deleted file mode 100644 index 5a9f2e58d..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/nodeExecutor/CustomerNodeExecutor.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.yomahub.liteflow.test.nodeExecutor; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DataBus; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; -import com.yomahub.liteflow.flow.executor.NodeExecutor; - -/** - * 自定义节点执行器 - */ -public class CustomerNodeExecutor extends NodeExecutor { - @Override - public void execute(NodeComponent instance) throws Exception { - DefaultContext context = instance.getFirstContextBean(); - LOG.info("使用customerNodeExecutor进行执行"); - context.setData("customerNodeExecutor", this.getClass()); - super.execute(instance); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/nodeExecutor/CustomerNodeExecutorAndCustomRetry.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/nodeExecutor/CustomerNodeExecutorAndCustomRetry.java deleted file mode 100644 index 003d33319..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/nodeExecutor/CustomerNodeExecutorAndCustomRetry.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.yomahub.liteflow.test.nodeExecutor; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DataBus; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; -import com.yomahub.liteflow.flow.executor.NodeExecutor; - -import java.util.concurrent.TimeUnit; - -/** - * 自定义节点执行器 - */ -public class CustomerNodeExecutorAndCustomRetry extends NodeExecutor { - @Override - public void execute(NodeComponent instance) throws Exception { - DefaultContext context = instance.getFirstContextBean(); - LOG.info("使用customerNodeExecutorAndCustomRetry进行执行"); - context.setData("customerNodeExecutorAndCustomRetry", this.getClass()); - super.execute(instance); - } - - @Override - protected void retry(NodeComponent instance, int currentRetryCount) throws Exception { - TimeUnit.MICROSECONDS.sleep(20L); - DefaultContext context = instance.getFirstContextBean(); - context.setData("retryLogic", this.getClass()); - super.retry(instance, currentRetryCount); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/nodeExecutor/LiteflowNodeExecutorSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/nodeExecutor/LiteflowNodeExecutorSpringbootTest.java deleted file mode 100644 index 45baf6bae..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/nodeExecutor/LiteflowNodeExecutorSpringbootTest.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.yomahub.liteflow.test.nodeExecutor; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - - -/** - * 测试springboot下的组件重试 - * - * @author Bryan.Zhang - * @since 2.5.10 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/nodeExecutor/application.properties") -@SpringBootTest(classes = LiteflowNodeExecutorSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.nodeExecutor.cmp"}) -public class LiteflowNodeExecutorSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - // 默认执行器测试 - @Test - public void testCustomerDefaultNodeExecutor() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals(CustomerDefaultNodeExecutor.class, context.getData("customerDefaultNodeExecutor")); - Assert.assertEquals("a", response.getExecuteStepStr()); - } - - //默认执行器测试+全局重试配置测试 - @Test - public void testDefaultExecutorForRetry() { - LiteflowResponse response = flowExecutor.execute2Resp("chain2", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals(CustomerDefaultNodeExecutor.class, context.getData("customerDefaultNodeExecutor")); - Assert.assertEquals("b==>b==>b", response.getExecuteStepStr()); - } - - //自定义执行器测试 - @Test - public void testCustomerExecutor() { - LiteflowResponse response = flowExecutor.execute2Resp("chain3", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("c", response.getExecuteStepStr()); - } - - //自定义执行器测试+全局重试配置测试 - @Test - public void testCustomExecutorForRetry() { - LiteflowResponse response = flowExecutor.execute2Resp("chain4", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertFalse(response.isSuccess()); - Assert.assertEquals(CustomerNodeExecutorAndCustomRetry.class, context.getData("retryLogic")); - Assert.assertEquals("d==>d==>d==>d==>d==>d", response.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/nodeExecutor/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/nodeExecutor/cmp/ACmp.java deleted file mode 100644 index e576f564b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/nodeExecutor/cmp/ACmp.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * - * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.nodeExecutor.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; - -@LiteflowComponent("a") -@LiteflowCmpDefine -public class ACmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("ACmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/nodeExecutor/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/nodeExecutor/cmp/BCmp.java deleted file mode 100644 index 9581a0655..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/nodeExecutor/cmp/BCmp.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.nodeExecutor.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; - -@LiteflowComponent("b") -@LiteflowCmpDefine -public class BCmp{ - - private int flag = 0; - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("BCmp executed!"); - if (flag < 2){ - flag++; - throw new RuntimeException("demo exception"); - } - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/nodeExecutor/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/nodeExecutor/cmp/CCmp.java deleted file mode 100644 index fa03b5cd5..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/nodeExecutor/cmp/CCmp.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.nodeExecutor.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.annotation.LiteflowRetry; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.flow.executor.NodeExecutor; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import com.yomahub.liteflow.test.nodeExecutor.CustomerNodeExecutor; - -@LiteflowComponent("c") -@LiteflowRetry(5) -@LiteflowCmpDefine -public class CCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("CCmp executed!"); - } - - @LiteflowMethod(LiteFlowMethodEnum.GET_NODE_EXECUTOR_CLASS) - public Class getNodeExecutorClass(NodeComponent bindCmp) { - return CustomerNodeExecutor.class; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/nodeExecutor/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/nodeExecutor/cmp/DCmp.java deleted file mode 100644 index 9192a9a77..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/nodeExecutor/cmp/DCmp.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * - * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.nodeExecutor.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.annotation.LiteflowRetry; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.flow.executor.NodeExecutor; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import com.yomahub.liteflow.test.nodeExecutor.CustomerNodeExecutorAndCustomRetry; - -@LiteflowComponent("d") -@LiteflowRetry(retry = 5, forExceptions = {NullPointerException.class}) -@LiteflowCmpDefine -public class DCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("DCmp executed!"); - throw new NullPointerException("demo exception"); - } - - @LiteflowMethod(LiteFlowMethodEnum.GET_NODE_EXECUTOR_CLASS) - public Class getNodeExecutorClass(NodeComponent bindCmp) { - return CustomerNodeExecutorAndCustomRetry.class; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomParserJsonSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomParserJsonSpringbootTest.java deleted file mode 100644 index dd2b055e3..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomParserJsonSpringbootTest.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.yomahub.liteflow.test.parsecustom; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * springboot环境的自定义json parser单元测试 - * @author dongguo.tao - * @since 2.5.0 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/parsecustom/application-custom-json.properties") -@SpringBootTest(classes = CustomParserJsonSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.parsecustom.cmp"}) -public class CustomParserJsonSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //测试springboot场景的自定义json parser - @Test - public void testJsonCustomParser() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "args"); - Assert.assertTrue(response.isSuccess()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomParserXmlSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomParserXmlSpringbootTest.java deleted file mode 100644 index 47e80dee4..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomParserXmlSpringbootTest.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.yomahub.liteflow.test.parsecustom; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * springboot环境的自定义xml parser单元测试 - * 主要测试自定义配置源类是否能引入springboot中的其他依赖 - * @author bryan.zhang - * @since 2.5.7 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/parsecustom/application-custom-xml.properties") -@SpringBootTest(classes = CustomParserXmlSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.parsecustom.cmp","com.yomahub.liteflow.test.parsecustom.bean"}) -public class CustomParserXmlSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //测试springboot场景的自定义json parser - @Test - public void testXmlCustomParser() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "args"); - Assert.assertTrue(response.isSuccess()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/bean/TestBean.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/bean/TestBean.java deleted file mode 100644 index 3d4eece3b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/bean/TestBean.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.yomahub.liteflow.test.parsecustom.bean; - -import org.springframework.stereotype.Component; - -@Component -public class TestBean { - - public String returnXmlContent(){ - return ""; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/ACmp.java deleted file mode 100644 index de78a93e4..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/ACmp.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.parsecustom.cmp; - -import cn.hutool.core.util.StrUtil; -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import com.yomahub.liteflow.exception.FlowSystemException; -import org.springframework.stereotype.Component; - -@Component("a") -@LiteflowCmpDefine -public class ACmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - String str = bindCmp.getRequestData(); - if(StrUtil.isNotBlank(str) && str.equals("exception")) { - throw new FlowSystemException("chain execute execption"); - } - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/BCmp.java deleted file mode 100644 index 440ea579a..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/BCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.parsecustom.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("b") -@LiteflowCmpDefine -public class BCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/CCmp.java deleted file mode 100644 index 75ca94417..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/CCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.parsecustom.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("c") -@LiteflowCmpDefine -public class CCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/DCmp.java deleted file mode 100644 index 12789ff2e..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/DCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.parsecustom.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("d") -@LiteflowCmpDefine -public class DCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("DCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/ECmp.java deleted file mode 100644 index 987613cc7..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/ECmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.parsecustom.cmp; - -import com.yomahub.liteflow.annotation.LiteflowSwitchCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("e") -@LiteflowSwitchCmpDefine -public class ECmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS_SWITCH) - public String processSwitch(NodeComponent bindCmp) throws Exception { - return "g"; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/FCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/FCmp.java deleted file mode 100644 index 4bb6d0311..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/FCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.parsecustom.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("f") -@LiteflowCmpDefine -public class FCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("FCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/GCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/GCmp.java deleted file mode 100644 index 62242e698..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/GCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.parsecustom.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("g") -@LiteflowCmpDefine -public class GCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("GCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/parser/CustomJsonFlowParser.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/parser/CustomJsonFlowParser.java deleted file mode 100644 index dd3a41929..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/parser/CustomJsonFlowParser.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.yomahub.liteflow.test.parsecustom.parser; - -import com.yomahub.liteflow.parser.ClassJsonFlowParser; - -/** - * 模拟用户自定义源解析 - * @author dongguo.tao - * @since 2.5.0 - */ -public class CustomJsonFlowParser extends ClassJsonFlowParser { - @Override - public String parseCustom() { - //模拟自定义解析结果 - String content = "{\"flow\":{\"nodes\":{\"node\":[{\"id\":\"a\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.ACmp\"},{\"id\":\"b\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.BCmp\"},{\"id\":\"c\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.CCmp\"},{\"id\":\"d\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.DCmp\"},{\"id\":\"e\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.ECmp\"},{\"id\":\"f\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.FCmp\"},{\"id\":\"g\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.GCmp\"}]},\"chain\":[{\"name\":\"chain2\",\"condition\":[{\"type\":\"then\",\"value\":\"c,g,f\"}]},{\"name\":\"chain1\",\"condition\":[{\"type\":\"then\",\"value\":\"a,c\"},{\"type\":\"when\",\"value\":\"b,d,e(f|g)\"},{\"type\":\"then\",\"value\":\"chain2\"}]}]}}"; - return content; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/parser/CustomXmlFlowParser.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/parser/CustomXmlFlowParser.java deleted file mode 100644 index 064323b89..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/parser/CustomXmlFlowParser.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.yomahub.liteflow.test.parsecustom.parser; - -import com.yomahub.liteflow.parser.ClassXmlFlowParser; -import com.yomahub.liteflow.test.parsecustom.bean.TestBean; - -import javax.annotation.Resource; - -/** - * springboot环境的自定义xml parser单元测试 - * 主要测试自定义配置源类是否能引入springboot中的其他依赖 - * @author bryan.zhang - * @since 2.5.7 - */ -public class CustomXmlFlowParser extends ClassXmlFlowParser { - - @Resource - private TestBean testBean; - - @Override - public String parseCustom() { - return testBean.returnXmlContent(); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parser/JsonParserSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parser/JsonParserSpringbootTest.java deleted file mode 100644 index 04707d903..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parser/JsonParserSpringbootTest.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.yomahub.liteflow.test.parser; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * spring环境的json parser单元测试 - * @author Bryan.Zhang - * @since 2.5.0 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/parser/application-json.properties") -@SpringBootTest(classes = JsonParserSpringbootTest.class) -@EnableAutoConfiguration -public class JsonParserSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //测试spring场景的json parser - @Test - public void testJsonParser() { - LiteflowResponse response = flowExecutor.execute2Resp("chain2", "arg"); - Assert.assertTrue(response.isSuccess()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parser/SpringELSupportSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parser/SpringELSupportSpringbootTest.java deleted file mode 100644 index 5234ab72d..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parser/SpringELSupportSpringbootTest.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.yomahub.liteflow.test.parser; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/parser/application-springEL.properties") -@SpringBootTest(classes = SpringELSupportSpringbootTest.class) -@EnableAutoConfiguration -public class SpringELSupportSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //测试springEL的解析情况 - @Test - public void testSpringELParser() { - LiteflowResponse response = flowExecutor.execute2Resp("chain11", "arg"); - Assert.assertTrue(response.isSuccess()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parser/XmlParserSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parser/XmlParserSpringbootTest.java deleted file mode 100644 index 2e52acc18..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parser/XmlParserSpringbootTest.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.yomahub.liteflow.test.parser; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * springboot环境的xml parser单元测试 - * @author Bryan.Zhang - * @since 2.5.0 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/parser/application-xml.properties") -@SpringBootTest(classes = XmlParserSpringbootTest.class) -@EnableAutoConfiguration -public class XmlParserSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //测试无springboot场景的xml parser - @Test - public void testXmlParser() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parser/YmlParserSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parser/YmlParserSpringbootTest.java deleted file mode 100644 index d64698267..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parser/YmlParserSpringbootTest.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.yomahub.liteflow.test.parser; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * springboot下的yml parser测试用例 - * @author Bryan.Zhang - * @since 2.5.0 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/parser/application-yml.properties") -@SpringBootTest(classes = YmlParserSpringbootTest.class) -@EnableAutoConfiguration -public class YmlParserSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //测试无springboot场景的yml parser - @Test - public void testYmlParser() { - LiteflowResponse response = flowExecutor.execute2Resp("chain2", "arg"); - Assert.assertTrue(response.isSuccess()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parser/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parser/cmp/ACmp.java deleted file mode 100644 index 33d611a3f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parser/cmp/ACmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.parser.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("a") -@LiteflowCmpDefine -public class ACmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parser/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parser/cmp/BCmp.java deleted file mode 100644 index d40b13d2f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parser/cmp/BCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.parser.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("b") -@LiteflowCmpDefine -public class BCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parser/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parser/cmp/CCmp.java deleted file mode 100644 index e9d3dceb8..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parser/cmp/CCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.parser.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("c") -@LiteflowCmpDefine -public class CCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parser/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parser/cmp/DCmp.java deleted file mode 100644 index 9f86ac0f7..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parser/cmp/DCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.parser.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("d") -@LiteflowCmpDefine -public class DCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("DCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parser/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parser/cmp/ECmp.java deleted file mode 100644 index 1f0188896..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parser/cmp/ECmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.parser.cmp; - -import com.yomahub.liteflow.annotation.LiteflowSwitchCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("e") -@LiteflowSwitchCmpDefine -public class ECmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS_SWITCH) - public String processSwitch(NodeComponent bindCmp) throws Exception { - return "g"; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parser/cmp/FCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parser/cmp/FCmp.java deleted file mode 100644 index 84e178b5b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parser/cmp/FCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.parser.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("f") -@LiteflowCmpDefine -public class FCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("FCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parser/cmp/GCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parser/cmp/GCmp.java deleted file mode 100644 index 8b50f2452..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/parser/cmp/GCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.parser.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("g") -@LiteflowCmpDefine -public class GCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("GCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/PreAndFinallySpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/PreAndFinallySpringbootTest.java deleted file mode 100644 index 17c499c98..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/PreAndFinallySpringbootTest.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.yomahub.liteflow.test.preAndFinally; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * springboot环境下pre节点和finally节点的测试 - * @author Bryan.Zhang - * @since 2.6.4 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/preAndFinally/application.properties") -@SpringBootTest(classes = PreAndFinallySpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.preAndFinally.cmp"}) -public class PreAndFinallySpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //测试普通的pre和finally节点 - @Test - public void testPreAndFinally1() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("p1==>p2==>a==>b==>c==>f1==>f2",response.getExecuteStepStr()); - } - - //测试pre和finally节点不放在开头和结尾的情况 - @Test - public void testPreAndFinally2() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain2", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("p1==>p2==>a==>b==>c==>f1==>f2",response.getExecuteStepStr()); - } - - //测试有节点报错是否还执行finally节点的情况,其中d节点会报错,但依旧执行f1,f2节点 - @Test - public void testPreAndFinally3() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain3", "arg"); - Assert.assertFalse(response.isSuccess()); - Assert.assertEquals("p1==>p2==>a==>d==>f1==>f2", response.getExecuteStepStr()); - } - - //测试在finally节点里是否能获取exception - @Test - public void testPreAndFinally4() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain4", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertFalse(response.isSuccess()); - Assert.assertTrue(context.getData("hasEx")); - } - - @Test - public void testPreAndFinally5() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain5", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("p1==>p2==>p1==>p2==>a==>b==>c==>f1==>f2==>f1", response.getExecuteStepStrWithoutTime()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/ACmp.java deleted file mode 100644 index c5b4afe65..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/ACmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.preAndFinally.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("a") -@LiteflowCmpDefine -public class ACmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/BCmp.java deleted file mode 100644 index 92644fcab..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/BCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.preAndFinally.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("b") -@LiteflowCmpDefine -public class BCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/CCmp.java deleted file mode 100644 index 23813b76a..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/CCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.preAndFinally.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("c") -@LiteflowCmpDefine -public class CCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/DCmp.java deleted file mode 100644 index f6f948273..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/DCmp.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.preAndFinally.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("d") -@LiteflowCmpDefine -public class DCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("CCmp executed!"); - int i = 1/0; - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Finally1Cmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Finally1Cmp.java deleted file mode 100644 index fd5fed96c..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Finally1Cmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.preAndFinally.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("f1") -@LiteflowCmpDefine -public class Finally1Cmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("Finally1Cmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Finally2Cmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Finally2Cmp.java deleted file mode 100644 index e1c809727..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Finally2Cmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.preAndFinally.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("f2") -@LiteflowCmpDefine -public class Finally2Cmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("Finally2Cmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Finally3Cmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Finally3Cmp.java deleted file mode 100644 index ca929402c..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Finally3Cmp.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.preAndFinally.cmp; - -import cn.hutool.core.util.ObjectUtil; -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("f3") -@LiteflowCmpDefine -public class Finally3Cmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) throws Exception{ - Slot slot = bindCmp.getSlot(); - DefaultContext context = slot.getFirstContextBean(); - if (ObjectUtil.isNull(slot.getException())){ - context.setData("hasEx", false); - }else{ - context.setData("hasEx", true); - } - System.out.println("Finally3Cmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Pre1Cmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Pre1Cmp.java deleted file mode 100644 index ffe0556c3..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Pre1Cmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.preAndFinally.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("p1") -@LiteflowCmpDefine -public class Pre1Cmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("Pre1Cmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Pre2Cmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Pre2Cmp.java deleted file mode 100644 index f00a75263..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Pre2Cmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.preAndFinally.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("p2") -@LiteflowCmpDefine -public class Pre2Cmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("Pre2Cmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/privateDelivery/PrivateDeliverySpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/privateDelivery/PrivateDeliverySpringbootTest.java deleted file mode 100644 index 67c630f1f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/privateDelivery/PrivateDeliverySpringbootTest.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.yomahub.liteflow.test.privateDelivery; - -import cn.hutool.core.collection.ConcurrentHashSet; -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; -import java.util.Set; - -/** - * springboot环境下隐私投递的测试 - * @author Bryan.Zhang - * @since 2.5.0 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/privateDelivery/application.properties") -@SpringBootTest(classes = PrivateDeliverySpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.privateDelivery.cmp"}) -public class PrivateDeliverySpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testPrivateDelivery() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - DefaultContext context = response.getFirstContextBean(); - ConcurrentHashSet set = context.getData("testSet"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals(100, set.size()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/privateDelivery/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/privateDelivery/cmp/ACmp.java deleted file mode 100644 index 5d0f91861..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/privateDelivery/cmp/ACmp.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.privateDelivery.cmp; - -import cn.hutool.core.collection.ConcurrentHashSet; -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; - -import java.util.HashSet; - -@LiteflowComponent("a") -@LiteflowCmpDefine -public class ACmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("ACmp executed!"); - DefaultContext context = bindCmp.getFirstContextBean(); - context.setData("testSet", new ConcurrentHashSet<>()); - - for (int i = 0; i < 100; i++) { - bindCmp.sendPrivateDeliveryData("b",i+1); - } - } -} - diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/privateDelivery/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/privateDelivery/cmp/BCmp.java deleted file mode 100644 index 5186d922a..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/privateDelivery/cmp/BCmp.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.privateDelivery.cmp; - -import cn.hutool.core.collection.ConcurrentHashSet; -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import com.yomahub.liteflow.slot.DefaultContext; - -import java.util.Set; - -@LiteflowComponent("b") -@LiteflowCmpDefine -public class BCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("BCmp executed!"); - Integer value = bindCmp.getPrivateDeliveryData(); - DefaultContext context = bindCmp.getFirstContextBean(); - ConcurrentHashSet testSet = context.getData("testSet"); - testSet.add(value); - } -} - diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/privateDelivery/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/privateDelivery/cmp/CCmp.java deleted file mode 100644 index c73d66402..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/privateDelivery/cmp/CCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.privateDelivery.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; - -@LiteflowComponent("c") -@LiteflowCmpDefine -public class CCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/privateDelivery/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/privateDelivery/cmp/DCmp.java deleted file mode 100644 index 354abbb9e..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/privateDelivery/cmp/DCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.privateDelivery.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; - -@LiteflowComponent("d") -@LiteflowCmpDefine -public class DCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/refreshRule/RefreshRuleSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/refreshRule/RefreshRuleSpringbootTest.java deleted file mode 100644 index f631f2c67..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/refreshRule/RefreshRuleSpringbootTest.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.yomahub.liteflow.test.refreshRule; - -import cn.hutool.core.io.resource.ResourceUtil; -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.enums.FlowParserTypeEnum; -import com.yomahub.liteflow.flow.FlowBus; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * springboot环境下重新加载规则测试 - * @author Bryan.Zhang - * @since 2.6.4 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/refreshRule/application.properties") -@SpringBootTest(classes = RefreshRuleSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.refreshRule.cmp"}) -public class RefreshRuleSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //测试普通刷新流程的场景 - @Test - public void testRefresh1() throws Exception{ - String content = ResourceUtil.readUtf8Str("classpath: /refreshRule/flow_update.xml"); - FlowBus.refreshFlowMetaData(FlowParserTypeEnum.TYPE_XML, content); - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - } - - //测试优雅刷新的场景 - @Test - public void testRefresh2() throws Exception{ - new Thread(() -> { - try { - Thread.sleep(3000L); - String content = ResourceUtil.readUtf8Str("classpath: /refreshRule/flow_update.xml"); - FlowBus.refreshFlowMetaData(FlowParserTypeEnum.TYPE_XML, content); - } catch (Exception e) { - e.printStackTrace(); - } - - }).start(); - - for (int i = 0; i < 500; i++) { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - try { - Thread.sleep(10L); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/refreshRule/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/refreshRule/cmp/ACmp.java deleted file mode 100644 index 6912aaf8a..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/refreshRule/cmp/ACmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.refreshRule.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("a") -@LiteflowCmpDefine -public class ACmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/refreshRule/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/refreshRule/cmp/BCmp.java deleted file mode 100644 index aaef859a6..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/refreshRule/cmp/BCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.refreshRule.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("b") -@LiteflowCmpDefine -public class BCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/refreshRule/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/refreshRule/cmp/CCmp.java deleted file mode 100644 index 7e935c272..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/refreshRule/cmp/CCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.refreshRule.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("c") -@LiteflowCmpDefine -public class CCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/reload/ReloadSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/reload/ReloadSpringbootTest.java deleted file mode 100644 index f18a20c2b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/reload/ReloadSpringbootTest.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.yomahub.liteflow.test.reload; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * springboot环境下重新加载规则测试 - * @author Bryan.Zhang - * @since 2.5.0 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/reload/application.properties") -@SpringBootTest(classes = ReloadSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.reload.cmp"}) -public class ReloadSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //用reloadRule去重新加载,这里如果配置是放在本地。如果想修改,则要去修改target下面的flow.xml - //这里的测试,手动打断点然后去修改,是ok的。但是整个测试,暂且只是为了测试这个功能是否能正常运行 - @Test - public void testReload() throws Exception{ - flowExecutor.reloadRule(); - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/reload/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/reload/cmp/ACmp.java deleted file mode 100644 index 57cc3a6df..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/reload/cmp/ACmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.reload.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("a") -@LiteflowCmpDefine -public class ACmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/reload/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/reload/cmp/BCmp.java deleted file mode 100644 index 5ca7ff6d1..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/reload/cmp/BCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.reload.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("b") -@LiteflowCmpDefine -public class BCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/reload/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/reload/cmp/CCmp.java deleted file mode 100644 index af6e8b52c..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/reload/cmp/CCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.reload.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("c") -@LiteflowCmpDefine -public class CCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/requestId/LiteflowRequestIdSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/requestId/LiteflowRequestIdSpringbootTest.java deleted file mode 100644 index c38dc82ef..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/requestId/LiteflowRequestIdSpringbootTest.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.yomahub.liteflow.test.requestId; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * @author tangkc - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/requestId/application.properties") -@SpringBootTest(classes = LiteflowRequestIdSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.requestId.cmp"}) -public class LiteflowRequestIdSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testRequestId() throws Exception { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("1", response.getSlot().getRequestId()); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/requestId/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/requestId/cmp/ACmp.java deleted file mode 100644 index 9cbef6dc0..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/requestId/cmp/ACmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * - * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.requestId.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("a") -@LiteflowCmpDefine -public class ACmp { - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/requestId/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/requestId/cmp/BCmp.java deleted file mode 100644 index 01495457b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/requestId/cmp/BCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.requestId.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("b") -@LiteflowCmpDefine -public class BCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/requestId/config/CustomRequestIdGenerator.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/requestId/config/CustomRequestIdGenerator.java deleted file mode 100644 index 004459325..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/requestId/config/CustomRequestIdGenerator.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.yomahub.liteflow.test.requestId.config; - -import com.yomahub.liteflow.flow.id.RequestIdGenerator; - -import java.util.concurrent.atomic.AtomicInteger; - -/** - * @author tangkc - */ -public class CustomRequestIdGenerator implements RequestIdGenerator { - - private final AtomicInteger atomicInteger = new AtomicInteger(0); - - @Override - public String generate() { - return atomicInteger.incrementAndGet() + ""; - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/resizeSlot/ResizeSlotSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/resizeSlot/ResizeSlotSpringbootTest.java deleted file mode 100644 index ba04dcde8..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/resizeSlot/ResizeSlotSpringbootTest.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.yomahub.liteflow.test.resizeSlot; - -import cn.hutool.core.util.ReflectUtil; -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.slot.DataBus; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; -import java.lang.reflect.Field; -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.ConcurrentLinkedQueue; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.Future; - -/** - * springboot环境下slot扩容测试 - * @author Bryan.Zhang - * @since 2.5.0 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/resizeSlot/application.properties") -@SpringBootTest(classes = ResizeSlotSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.resizeSlot.cmp"}) -public class ResizeSlotSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testResize() throws Exception{ - ExecutorService pool = Executors.newCachedThreadPool(); - - List> futureList = new ArrayList<>(); - for (int i = 0; i < 100; i++) { - Future future = pool.submit(() -> flowExecutor.execute2Resp("chain1", "arg")); - futureList.add(future); - } - - for(Future future : futureList){ - Assert.assertTrue(future.get().isSuccess()); - } - - //取到static的对象QUEUE - Field field = ReflectUtil.getField(DataBus.class, "QUEUE"); - ConcurrentLinkedQueue queue = (ConcurrentLinkedQueue) ReflectUtil.getStaticFieldValue(field); - - //因为初始slotSize是4,按照0.75的扩容比,要满足100个线程,应该扩容5~6次,5次=65,6次=114 - //为什么不是直接114呢? - //因为在单测中根据机器的性能,在多线程情况下,有些机器跑的慢一点,也就是说65个就足够了。有些机器跑的快一点,是能真正扩容到114个的 - Assert.assertTrue(queue.size() > 4); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/resizeSlot/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/resizeSlot/cmp/ACmp.java deleted file mode 100644 index c05adbf38..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/resizeSlot/cmp/ACmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.resizeSlot.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("a") -@LiteflowCmpDefine -public class ACmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/resizeSlot/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/resizeSlot/cmp/BCmp.java deleted file mode 100644 index 4a5e5ea8d..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/resizeSlot/cmp/BCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.resizeSlot.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("b") -@LiteflowCmpDefine -public class BCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/resizeSlot/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/resizeSlot/cmp/CCmp.java deleted file mode 100644 index a0156105c..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/resizeSlot/cmp/CCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.resizeSlot.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("c") -@LiteflowCmpDefine -public class CCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/subflow/ImplicitSubFlowSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/subflow/ImplicitSubFlowSpringbootTest.java deleted file mode 100644 index 15591e164..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/subflow/ImplicitSubFlowSpringbootTest.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.yomahub.liteflow.test.subflow; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; -import java.util.HashSet; -import java.util.Set; - -/** - * 测试隐式调用子流程 - * 单元测试 - * - * @author justin.xu - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/subflow/application-implicit.properties") -@SpringBootTest(classes = ImplicitSubFlowSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.subflow.cmp2"}) -public class ImplicitSubFlowSpringbootTest extends BaseTest { - @Resource - private FlowExecutor flowExecutor; - - public static final Set RUN_TIME_SLOT = new HashSet<>(); - - //这里GCmp中隐式的调用chain4,从而执行了h,m - @Test - public void testImplicitSubFlow() { - LiteflowResponse response = flowExecutor.execute2Resp("chain3", "it's a request"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("f==>g==>h==>m", response.getExecuteStepStr()); - - // 传递了slotIndex,则set的size==1 - Assert.assertEquals(1, RUN_TIME_SLOT.size()); - // set中第一次设置的requestId和response中的requestId一致 - Assert.assertTrue(RUN_TIME_SLOT.contains(response.getSlot().getRequestId())); - //requestData的取值正确 - Assert.assertEquals("it's implicit subflow.", context.getData("innerRequest")); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/subflow/SubflowInDifferentConfigSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/subflow/SubflowInDifferentConfigSpringbootTest.java deleted file mode 100644 index 3eb708eda..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/subflow/SubflowInDifferentConfigSpringbootTest.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.yomahub.liteflow.test.subflow; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.exception.MultipleParsersException; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.ApplicationContext; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * 测试主流程与子流程在不同的配置文件的场景 - * - * @author Bryan.Zhang - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/subflow/application-subInDifferentConfig1.properties") -@SpringBootTest(classes = SubflowInDifferentConfigSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.subflow.cmp1","com.yomahub.liteflow.test.subflow.cmp2"}) -public class SubflowInDifferentConfigSpringbootTest extends BaseTest { - @Resource - private FlowExecutor flowExecutor; - - //是否按照流程定义配置执行 - @Test - public void testExplicitSubFlow1() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "it's a request"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a==>b==>b==>a==>e==>d", response.getExecuteStepStr()); - } - - @Autowired - private ApplicationContext context; - - //主要测试有不同的配置类型后会不会报出既定的错误 - @Test(expected = MultipleParsersException.class) - public void testExplicitSubFlow2() { - LiteflowConfig config = context.getBean(LiteflowConfig.class); - config.setRuleSource("subflow/flow-main.xml,subflow/flow-sub1.xml,subflow/flow-sub2.yml"); - flowExecutor.init(); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/subflow/SubflowJsonSpringBootTest.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/subflow/SubflowJsonSpringBootTest.java deleted file mode 100644 index 80b24197f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/subflow/SubflowJsonSpringBootTest.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.yomahub.liteflow.test.subflow; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * 测试显示调用子流程(json) - * 单元测试 - * - * @author justin.xu - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/subflow/application-json.properties") -@SpringBootTest(classes = SubflowJsonSpringBootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.subflow.cmp1"}) -public class SubflowJsonSpringBootTest extends BaseTest { - @Resource - private FlowExecutor flowExecutor; - - //是否按照流程定义配置执行 - @Test - public void testExplicitSubFlow() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "it's a request"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a==>b==>c==>b==>a==>e==>d", response.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/subflow/SubflowXMLSpringBootTest.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/subflow/SubflowXMLSpringBootTest.java deleted file mode 100644 index 700d05a5e..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/subflow/SubflowXMLSpringBootTest.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.yomahub.liteflow.test.subflow; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * 测试显示调用子流程(xml) - * 单元测试 - * - * @author justin.xu - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/subflow/application-xml.properties") -@SpringBootTest(classes = SubflowXMLSpringBootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.subflow.cmp1"}) -public class SubflowXMLSpringBootTest extends BaseTest { - @Resource - private FlowExecutor flowExecutor; - - //是否按照流程定义配置执行 - @Test - public void testExplicitSubFlow() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "it's a request"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a==>b==>c==>b==>a==>e==>d", response.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/subflow/SubflowYmlSpringBootTest.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/subflow/SubflowYmlSpringBootTest.java deleted file mode 100644 index 283c0d7cd..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/subflow/SubflowYmlSpringBootTest.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.yomahub.liteflow.test.subflow; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * 测试显示调用子流程(yml) - * 单元测试 - * - * @author justin.xu - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/subflow/application-yml.properties") -@SpringBootTest(classes = SubflowYmlSpringBootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.subflow.cmp1"}) -public class SubflowYmlSpringBootTest extends BaseTest { - @Resource - private FlowExecutor flowExecutor; - - //是否按照流程定义配置执行 - @Test - public void testExplicitSubFlowYml() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "it's a request"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a==>b==>c==>b==>a==>e==>d", response.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/ACmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/ACmp.java deleted file mode 100644 index f20ef02ae..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/ACmp.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.yomahub.liteflow.test.subflow.cmp1; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - - -@Component("a") -@LiteflowCmpDefine -public class ACmp{ - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("Acomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/BCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/BCmp.java deleted file mode 100644 index 4801ac868..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/BCmp.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.yomahub.liteflow.test.subflow.cmp1; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - - -@Component("b") -@LiteflowCmpDefine -public class BCmp{ - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("Bcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/CCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/CCmp.java deleted file mode 100644 index 2ae551ea7..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/CCmp.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.yomahub.liteflow.test.subflow.cmp1; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - - -@Component("c") -@LiteflowCmpDefine -public class CCmp{ - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) throws Exception { - System.out.println("Ccomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/DCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/DCmp.java deleted file mode 100644 index e734549c8..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/DCmp.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.yomahub.liteflow.test.subflow.cmp1; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - - -@Component("d") -@LiteflowCmpDefine -public class DCmp{ - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) throws Exception { - System.out.println("Dcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/ECmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/ECmp.java deleted file mode 100644 index d8ae800cc..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/ECmp.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.yomahub.liteflow.test.subflow.cmp1; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - - -@Component("e") -@LiteflowCmpDefine -public class ECmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) throws Exception { - System.out.println("Ecomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/FCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/FCmp.java deleted file mode 100644 index f260b44a0..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/FCmp.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.yomahub.liteflow.test.subflow.cmp2; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -import static com.yomahub.liteflow.test.subflow.ImplicitSubFlowSpringbootTest.RUN_TIME_SLOT; - - -@Component("f") -@LiteflowCmpDefine -public class FCmp{ - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) throws Exception { - - RUN_TIME_SLOT.add(bindCmp.getSlot().getRequestId()); - - System.out.println("Fcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/GCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/GCmp.java deleted file mode 100644 index 9cbb6f943..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/GCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.yomahub.liteflow.test.subflow.cmp2; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -import static com.yomahub.liteflow.test.subflow.ImplicitSubFlowSpringbootTest.RUN_TIME_SLOT; - - -@Component("g") -@LiteflowCmpDefine -public class GCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) throws Exception { - - RUN_TIME_SLOT.add(bindCmp.getSlot().getRequestId()); - - System.out.println("Gcmp executed!"); - - bindCmp.invoke("chain4", "it's implicit subflow."); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/HCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/HCmp.java deleted file mode 100644 index 03c9b0d8f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/HCmp.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.yomahub.liteflow.test.subflow.cmp2; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import com.yomahub.liteflow.slot.DefaultContext; -import org.springframework.stereotype.Component; - -import static com.yomahub.liteflow.test.subflow.ImplicitSubFlowSpringbootTest.RUN_TIME_SLOT; - - -@Component("h") -@LiteflowCmpDefine -public class HCmp{ - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) throws Exception { - String requestData = bindCmp.getSubChainReqData(); - DefaultContext context = bindCmp.getFirstContextBean(); - context.setData("innerRequest", requestData); - - RUN_TIME_SLOT.add(bindCmp.getSlot().getRequestId()); - - System.out.println("Hcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/MCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/MCmp.java deleted file mode 100644 index 199abff79..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/MCmp.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.yomahub.liteflow.test.subflow.cmp2; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -import static com.yomahub.liteflow.test.subflow.ImplicitSubFlowSpringbootTest.RUN_TIME_SLOT; - - -@Component("m") -@LiteflowCmpDefine -public class MCmp{ - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) throws Exception { - - RUN_TIME_SLOT.add(bindCmp.getSlot().getRequestId()); - - System.out.println("Mcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/tag/NodeTagSpringbootJsonTest.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/tag/NodeTagSpringbootJsonTest.java deleted file mode 100644 index 31fb76114..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/tag/NodeTagSpringbootJsonTest.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.yomahub.liteflow.test.tag; - -import cn.hutool.core.collection.ConcurrentHashSet; -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * springboot环境下隐私投递的测试 - * @author Bryan.Zhang - * @since 2.5.0 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/tag/application-json.properties") -@SpringBootTest(classes = NodeTagSpringbootJsonTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.tag.cmp"}) -public class NodeTagSpringbootJsonTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testTag1() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("123",context.getData("test")); - } - - @Test - public void testTag2() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain2", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a==>a==>a==>c==>e", response.getExecuteStepStr()); - } - - //测试多线程when情况下的tag取值是否正确 - //这里循环多次的原因是,因为when多线程,有时候因为凑巧,可能正确。所以多次情况下在2.6.4版本肯定出错 - @Test - public void testTag3() throws Exception{ - for (int i = 0; i < 50; i++) { - LiteflowResponse response = flowExecutor.execute2Resp("chain3", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - ConcurrentHashSet testSet = context.getData("test"); - Assert.assertEquals(3, testSet.size()); - } - } - - //测试tag是否能在isAccess中起效 - @Test - public void testTag4() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain4", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("g", response.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/tag/NodeTagSpringbootXmlTest.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/tag/NodeTagSpringbootXmlTest.java deleted file mode 100644 index e7e0b58fd..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/tag/NodeTagSpringbootXmlTest.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.yomahub.liteflow.test.tag; - -import cn.hutool.core.collection.ConcurrentHashSet; -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * springboot环境下隐私投递的测试 - * @author Bryan.Zhang - * @since 2.5.0 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/tag/application-xml.properties") -@SpringBootTest(classes = NodeTagSpringbootXmlTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.tag.cmp"}) -public class NodeTagSpringbootXmlTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testTag1() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("123",context.getData("test")); - } - - @Test - public void testTag2() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain2", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a==>a==>a==>c==>e", response.getExecuteStepStr()); - } - - //测试多线程when情况下的tag取值是否正确 - //这里循环多次的原因是,因为when多线程,有时候因为凑巧,可能正确。所以多次情况下在2.6.4版本肯定出错 - @Test - public void testTag3() throws Exception{ - for (int i = 0; i < 50; i++) { - LiteflowResponse response = flowExecutor.execute2Resp("chain3", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - ConcurrentHashSet testSet = context.getData("test"); - Assert.assertEquals(3, testSet.size()); - } - } - - //测试tag是否能在isAccess中起效 - @Test - public void testTag4() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain4", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("g", response.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/tag/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/tag/cmp/ACmp.java deleted file mode 100644 index 926ee6459..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/tag/cmp/ACmp.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.tag.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; - -@LiteflowComponent("a") -@LiteflowCmpDefine -public class ACmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - String testKey = "test"; - - DefaultContext context = bindCmp.getFirstContextBean(); - if (context.getData(testKey) == null){ - context.setData(testKey,bindCmp.getTag()); - }else{ - String s = context.getData(testKey); - s += bindCmp.getTag(); - context.setData(testKey, s); - } - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/tag/cmp/B1Cmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/tag/cmp/B1Cmp.java deleted file mode 100644 index edbe8d3d3..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/tag/cmp/B1Cmp.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.tag.cmp; - -import cn.hutool.core.collection.ConcurrentHashSet; -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; - -@LiteflowComponent("b1") -@LiteflowCmpDefine -public class B1Cmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - DefaultContext context = bindCmp.getFirstContextBean(); - context.setData("test",new ConcurrentHashSet()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/tag/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/tag/cmp/BCmp.java deleted file mode 100644 index 48284946f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/tag/cmp/BCmp.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.tag.cmp; - -import cn.hutool.core.collection.ConcurrentHashSet; -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; - -@LiteflowComponent("b") -@LiteflowCmpDefine -public class BCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - DefaultContext context = bindCmp.getFirstContextBean(); - ConcurrentHashSet testSet = context.getData("test"); - testSet.add(bindCmp.getTag()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/tag/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/tag/cmp/CCmp.java deleted file mode 100644 index 6081c09c0..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/tag/cmp/CCmp.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.tag.cmp; - -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.annotation.LiteflowSwitchCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; - -@LiteflowComponent("c") -@LiteflowSwitchCmpDefine -public class CCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS_SWITCH) - public String processSwitch(NodeComponent bindCmp) throws Exception { - if(bindCmp.getTag().equals("2")){ - return "e"; - }else{ - return "d"; - } - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/tag/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/tag/cmp/DCmp.java deleted file mode 100644 index 8ee32b746..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/tag/cmp/DCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.tag.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; - -@LiteflowComponent("d") -@LiteflowCmpDefine -public class DCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println(bindCmp.getTag()); - System.out.println("DCmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/tag/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/tag/cmp/ECmp.java deleted file mode 100644 index 84423ee71..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/tag/cmp/ECmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.tag.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; - -@LiteflowComponent("e") -@LiteflowCmpDefine -public class ECmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println(bindCmp.getTag()); - System.out.println("ECmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/tag/cmp/FCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/tag/cmp/FCmp.java deleted file mode 100644 index e3ea2023d..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/tag/cmp/FCmp.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.tag.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; - -@LiteflowComponent("f") -@LiteflowCmpDefine -public class FCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process() { - System.out.println("FCmp executed!"); - } - - @LiteflowMethod(LiteFlowMethodEnum.IS_ACCESS) - public boolean isAccess(NodeComponent bindCmp) { - return Boolean.parseBoolean(bindCmp.getTag()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/tag/cmp/GCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/tag/cmp/GCmp.java deleted file mode 100644 index f8aae453c..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/tag/cmp/GCmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.tag.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; - -@LiteflowComponent("g") -@LiteflowCmpDefine -public class GCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("GCmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/TestTL.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/TestTL.java deleted file mode 100644 index fee0055e5..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/TestTL.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.yomahub.liteflow.test.useTTLInWhen; - -import com.alibaba.ttl.TransmittableThreadLocal; - -public class TestTL { - - public static ThreadLocal tl = new TransmittableThreadLocal<>(); - - public static String get(){ - return tl.get(); - } - - public static void set(String value){ - tl.set(value); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/UseTTLInWhenSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/UseTTLInWhenSpringbootTest.java deleted file mode 100644 index dbfecb808..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/UseTTLInWhenSpringbootTest.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.yomahub.liteflow.test.useTTLInWhen; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * 在when异步节点的情况下去拿ThreadLocal里的测试场景 - * @author Bryan.Zhang - * @since 2.6.3 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/useTTLInWhen/application.properties") -@SpringBootTest(classes = UseTTLInWhenSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.useTTLInWhen.cmp"}) -public class UseTTLInWhenSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testUseTTLInWhen() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertEquals("hello,b", context.getData("b")); - Assert.assertEquals("hello,c", context.getData("c")); - Assert.assertEquals("hello,d", context.getData("d")); - Assert.assertEquals("hello,e", context.getData("e")); - Assert.assertEquals("hello,f", context.getData("f")); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/ACmp.java deleted file mode 100644 index 18687b6ea..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/ACmp.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.useTTLInWhen.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import com.yomahub.liteflow.test.useTTLInWhen.TestTL; -import org.springframework.stereotype.Component; - -@Component("a") -@LiteflowCmpDefine -public class ACmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - TestTL.set("hello"); - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/BCmp.java deleted file mode 100644 index 5bcddcd45..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/BCmp.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.useTTLInWhen.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.useTTLInWhen.TestTL; -import org.springframework.stereotype.Component; - -@Component("b") -@LiteflowCmpDefine -public class BCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - String value = TestTL.get(); - DefaultContext context = bindCmp.getFirstContextBean(); - context.setData(bindCmp.getNodeId(),value+",b"); - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/CCmp.java deleted file mode 100644 index 0a03ff778..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/CCmp.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.useTTLInWhen.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.useTTLInWhen.TestTL; -import org.springframework.stereotype.Component; - -@Component("c") -@LiteflowCmpDefine -public class CCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - String value = TestTL.get(); - DefaultContext context = bindCmp.getFirstContextBean(); - context.setData(bindCmp.getNodeId(),value+",c"); - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/DCmp.java deleted file mode 100644 index f4337516d..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/DCmp.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.useTTLInWhen.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.useTTLInWhen.TestTL; -import org.springframework.stereotype.Component; - -@Component("d") -@LiteflowCmpDefine -public class DCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - String value = TestTL.get(); - DefaultContext context = bindCmp.getFirstContextBean(); - context.setData(bindCmp.getNodeId(),value+",d"); - System.out.println("DCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/ECmp.java deleted file mode 100644 index cf2be2733..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/ECmp.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.useTTLInWhen.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.useTTLInWhen.TestTL; -import org.springframework.stereotype.Component; - -@Component("e") -@LiteflowCmpDefine -public class ECmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - String value = TestTL.get(); - DefaultContext context = bindCmp.getFirstContextBean(); - context.setData(bindCmp.getNodeId(),value+",e"); - System.out.println("ECmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/FCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/FCmp.java deleted file mode 100644 index c4c63861e..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/FCmp.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.useTTLInWhen.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.useTTLInWhen.TestTL; -import org.springframework.stereotype.Component; - -@Component("f") -@LiteflowCmpDefine -public class FCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - String value = TestTL.get(); - DefaultContext context = bindCmp.getFirstContextBean(); - context.setData(bindCmp.getNodeId(),value+",f"); - System.out.println("FCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/whenTimeOut/WhenTimeOutSpringbootTest1.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/whenTimeOut/WhenTimeOutSpringbootTest1.java deleted file mode 100644 index c85ea7521..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/whenTimeOut/WhenTimeOutSpringbootTest1.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.yomahub.liteflow.test.whenTimeOut; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.exception.WhenTimeoutException; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * springboot环境下异步线程超时日志打印测试 - * @author Bryan.Zhang - * @since 2.6.4 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/whenTimeOut/application1.properties") -@SpringBootTest(classes = WhenTimeOutSpringbootTest1.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.whenTimeOut.cmp"}) -public class WhenTimeOutSpringbootTest1 extends BaseTest { - - private final Logger log = LoggerFactory.getLogger(this.getClass()); - - @Resource - private FlowExecutor flowExecutor; - - //其中b和c在when情况下超时,所以抛出了WhenTimeoutException这个错 - @Test - public void testWhenTimeOut() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertFalse(response.isSuccess()); - Assert.assertEquals(WhenTimeoutException.class, response.getCause().getClass()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/whenTimeOut/WhenTimeOutSpringbootTest2.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/whenTimeOut/WhenTimeOutSpringbootTest2.java deleted file mode 100644 index e3377ef0a..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/whenTimeOut/WhenTimeOutSpringbootTest2.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.yomahub.liteflow.test.whenTimeOut; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * springboot环境下异步线程超时日志打印测试 - * @author Bryan.Zhang - * @since 2.6.4 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/whenTimeOut/application2.properties") -@SpringBootTest(classes = WhenTimeOutSpringbootTest2.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.whenTimeOut.cmp"}) -public class WhenTimeOutSpringbootTest2 extends BaseTest { - - private final Logger log = LoggerFactory.getLogger(this.getClass()); - - @Resource - private FlowExecutor flowExecutor; - - //其中d,e,f都sleep 4秒,其中def是不同的组,超时设置5秒 - @Test - public void testWhenTimeOut() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/ACmp.java deleted file mode 100644 index 236b7093f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/ACmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.whenTimeOut.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("a") -@LiteflowCmpDefine -public class ACmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/BCmp.java deleted file mode 100644 index 6628e838e..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/BCmp.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.whenTimeOut.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("b") -@LiteflowCmpDefine -public class BCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - try { - Thread.sleep(4000); - }catch (Exception ignored){ - - } - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/CCmp.java deleted file mode 100644 index e26c064f6..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/CCmp.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.whenTimeOut.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("c") -@LiteflowCmpDefine -public class CCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - try { - Thread.sleep(3500); - }catch (Exception ignored){ - - } - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/DCmp.java deleted file mode 100644 index 720a4a8b8..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/DCmp.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.whenTimeOut.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("d") -@LiteflowCmpDefine -public class DCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - try { - Thread.sleep(4000); - }catch (Exception ignored){ - - } - System.out.println("DCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/ECmp.java deleted file mode 100644 index 6485ae74b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/ECmp.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.whenTimeOut.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("e") -@LiteflowCmpDefine -public class ECmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - try { - Thread.sleep(4000); - }catch (Exception ignored){ - - } - System.out.println("ECmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/FCmp.java b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/FCmp.java deleted file mode 100644 index f16bda6ad..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/FCmp.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.whenTimeOut.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("f") -@LiteflowCmpDefine -public class FCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - try { - Thread.sleep(4000); - }catch (Exception ignored){ - - } - System.out.println("FCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/absoluteConfigPath/application.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/absoluteConfigPath/application.properties deleted file mode 100644 index 55fe91fd8..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/absoluteConfigPath/application.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=/usr/local/flow.xml \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/absoluteConfigPath/flow.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/absoluteConfigPath/flow.xml deleted file mode 100644 index a6fda5aa0..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/absoluteConfigPath/flow.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/aop/application.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/aop/application.properties deleted file mode 100644 index f9075d1c6..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/aop/application.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=aop/flow.xml \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/aop/flow.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/aop/flow.xml deleted file mode 100644 index 84e8d4588..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/aop/flow.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/asyncNode/application.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/asyncNode/application.properties deleted file mode 100644 index db0c76e72..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/asyncNode/application.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=asyncNode/flow.xml \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/asyncNode/flow.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/asyncNode/flow.xml deleted file mode 100644 index e81546bb6..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/asyncNode/flow.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/base/application.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/base/application.properties deleted file mode 100644 index cf3ccb24b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/base/application.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=base/flow.xml \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/base/flow.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/base/flow.xml deleted file mode 100644 index 7068d6cee..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/base/flow.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/cmpRetry/application.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/cmpRetry/application.properties deleted file mode 100644 index bd5d04cdb..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/cmpRetry/application.properties +++ /dev/null @@ -1,3 +0,0 @@ -liteflow.rule-source=cmpRetry/flow.xml -liteflow.retry-count=3 -liteflow.slot-size=512 \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/cmpRetry/flow.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/cmpRetry/flow.xml deleted file mode 100644 index d44e3ee05..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/cmpRetry/flow.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/cmpStep/application.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/cmpStep/application.properties deleted file mode 100644 index e305266de..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/cmpStep/application.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=cmpStep/flow.xml \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/cmpStep/flow.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/cmpStep/flow.xml deleted file mode 100644 index cd127f1ab..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/cmpStep/flow.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/component/application.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/component/application.properties deleted file mode 100644 index d5b0e66d5..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/component/application.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=component/flow.xml \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/component/flow.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/component/flow.xml deleted file mode 100644 index 2a504fd01..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/component/flow.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/config/aaa/bbb/flow1.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/config/aaa/bbb/flow1.xml deleted file mode 100644 index ced398c9b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/config/aaa/bbb/flow1.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/config/aaa/flow0.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/config/aaa/flow0.xml deleted file mode 100644 index 22870d94f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/config/aaa/flow0.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/config/application1.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/config/application1.properties deleted file mode 100644 index 4ac6c4d63..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/config/application1.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=config/flow.yml \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/config/application2.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/config/application2.properties deleted file mode 100644 index 5079ac3d2..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/config/application2.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=config/**/flow*.xml \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/config/flow.yml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/config/flow.yml deleted file mode 100644 index 3cdaced3e..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/config/flow.yml +++ /dev/null @@ -1,6 +0,0 @@ -flow: - chain: - - name: chain1 - condition: - - type: then - value: 'a,b,c' diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/customMethodName/application.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/customMethodName/application.properties deleted file mode 100644 index 78d5f5900..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/customMethodName/application.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=customMethodName/flow.xml \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/customMethodName/flow.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/customMethodName/flow.xml deleted file mode 100644 index cd988fe71..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/customMethodName/flow.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/customNodes/application.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/customNodes/application.properties deleted file mode 100644 index ab7716a61..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/customNodes/application.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=customNodes/flow.xml \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/customNodes/flow.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/customNodes/flow.xml deleted file mode 100644 index ecc1abcd6..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/customNodes/flow.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/customWhenThreadPool/application.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/customWhenThreadPool/application.properties deleted file mode 100644 index 3447aaa3f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/customWhenThreadPool/application.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=customWhenThreadPool/flow.xml \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/customWhenThreadPool/flow.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/customWhenThreadPool/flow.xml deleted file mode 100644 index c6f199ddb..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/customWhenThreadPool/flow.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/deadLoopChain/application.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/deadLoopChain/application.properties deleted file mode 100644 index 8e35187c2..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/deadLoopChain/application.properties +++ /dev/null @@ -1,2 +0,0 @@ -liteflow.rule-source=deadLoopChain/flow.xml -liteflow.parse-on-start=false \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/deadLoopChain/flow.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/deadLoopChain/flow.xml deleted file mode 100644 index ca6e1c3f7..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/deadLoopChain/flow.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/emptyFlow/application.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/emptyFlow/application.properties deleted file mode 100644 index 953c02066..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/emptyFlow/application.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=emptyFlow/flow.xml \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/emptyFlow/flow.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/emptyFlow/flow.xml deleted file mode 100644 index e69de29bb..000000000 diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/enable/application.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/enable/application.properties deleted file mode 100644 index 64bcf0011..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/enable/application.properties +++ /dev/null @@ -1,2 +0,0 @@ -liteflow.enable=false -liteflow.rule-source=enable/flow.xml diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/enable/flow.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/enable/flow.xml deleted file mode 100644 index 22870d94f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/enable/flow.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/event/application.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/event/application.properties deleted file mode 100644 index 332edb934..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/event/application.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=event/flow.xml \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/event/flow.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/event/flow.xml deleted file mode 100644 index a1f50587a..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/event/flow.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/exception/application.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/exception/application.properties deleted file mode 100644 index 79b39156f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/exception/application.properties +++ /dev/null @@ -1,2 +0,0 @@ -liteflow.rule-source=exception/flow.xml -liteflow.when-max-wait-seconds=1 \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/exception/flow-exception.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/exception/flow-exception.xml deleted file mode 100644 index 662226def..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/exception/flow-exception.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/exception/flow.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/exception/flow.xml deleted file mode 100644 index 328a6cb14..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/exception/flow.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/execute2Future/application.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/execute2Future/application.properties deleted file mode 100644 index 1545d0a13..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/execute2Future/application.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=execute2Future/flow.xml \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/execute2Future/flow.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/execute2Future/flow.xml deleted file mode 100644 index a7517a2cf..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/execute2Future/flow.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/extend/application.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/extend/application.properties deleted file mode 100644 index 7904a5796..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/extend/application.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=extend/flow.xml \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/extend/flow.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/extend/flow.xml deleted file mode 100644 index 22870d94f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/extend/flow.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/flowmeta/application.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/flowmeta/application.properties deleted file mode 100644 index 83834c85b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/flowmeta/application.properties +++ /dev/null @@ -1,2 +0,0 @@ -liteflow.rule-source=flowmeta/flow.xml -liteflow.parse-on-start=false \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/flowmeta/flow.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/flowmeta/flow.xml deleted file mode 100644 index 7153add87..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/flowmeta/flow.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/lazy/application.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/lazy/application.properties deleted file mode 100644 index 372a320c8..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/lazy/application.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=lazy/flow.xml \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/lazy/flow.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/lazy/flow.xml deleted file mode 100644 index 22870d94f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/lazy/flow.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/lfCmpAnno/application.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/lfCmpAnno/application.properties deleted file mode 100644 index 1085d3200..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/lfCmpAnno/application.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=lfCmpAnno/flow.xml \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/lfCmpAnno/flow.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/lfCmpAnno/flow.xml deleted file mode 100644 index 62def0c37..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/lfCmpAnno/flow.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/monitor/application.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/monitor/application.properties deleted file mode 100644 index ee78cdf43..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/monitor/application.properties +++ /dev/null @@ -1,5 +0,0 @@ -liteflow.rule-source=monitor/flow.xml -liteflow.monitor.enable-log=true -liteflow.monitor.queue-limit=200 -liteflow.monitor.delay=5000 -liteflow.monitor.period=5000 \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/monitor/flow.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/monitor/flow.xml deleted file mode 100644 index e8ea83f95..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/monitor/flow.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/multipleType/application.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/multipleType/application.properties deleted file mode 100644 index a6da8abe5..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/multipleType/application.properties +++ /dev/null @@ -1,2 +0,0 @@ -liteflow.support-multiple-type=true -liteflow.rule-source=multipleType/flow.xml,multipleType/flow.yml \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/multipleType/flow.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/multipleType/flow.xml deleted file mode 100644 index 38b703214..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/multipleType/flow.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/multipleType/flow.yml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/multipleType/flow.yml deleted file mode 100644 index 4c1d8375a..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/multipleType/flow.yml +++ /dev/null @@ -1,6 +0,0 @@ -flow: - chain: - - name: chain3 - condition: - - type: then - value: 'a,b,c' diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/nodeExecutor/application.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/nodeExecutor/application.properties deleted file mode 100644 index b2ca1d088..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/nodeExecutor/application.properties +++ /dev/null @@ -1,4 +0,0 @@ -liteflow.rule-source=nodeExecutor/flow.xml -liteflow.retry-count=3 -liteflow.slot-size=512 -liteflow.node-executor-class=com.yomahub.liteflow.test.nodeExecutor.CustomerDefaultNodeExecutor \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/nodeExecutor/flow.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/nodeExecutor/flow.xml deleted file mode 100644 index 6b867c5bc..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/nodeExecutor/flow.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/nullParam/application.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/nullParam/application.properties deleted file mode 100644 index 7f320b595..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/nullParam/application.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=nullParam/flow.xml diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/nullParam/flow.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/nullParam/flow.xml deleted file mode 100644 index eb30c8e40..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/nullParam/flow.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/parsecustom/application-custom-json.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/parsecustom/application-custom-json.properties deleted file mode 100644 index 989a199c9..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/parsecustom/application-custom-json.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=com.yomahub.liteflow.test.parsecustom.parser.CustomJsonFlowParser \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/parsecustom/application-custom-xml.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/parsecustom/application-custom-xml.properties deleted file mode 100644 index c1763fe16..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/parsecustom/application-custom-xml.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=com.yomahub.liteflow.test.parsecustom.parser.CustomXmlFlowParser \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/parser/application-json.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/parser/application-json.properties deleted file mode 100644 index e8b247226..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/parser/application-json.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=parser/flow.json \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/parser/application-springEL.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/parser/application-springEL.properties deleted file mode 100644 index 7db93206b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/parser/application-springEL.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=parser/**/*.xml \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/parser/application-xml.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/parser/application-xml.properties deleted file mode 100644 index d8aacc36c..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/parser/application-xml.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=parser/flow.xml \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/parser/application-yml.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/parser/application-yml.properties deleted file mode 100644 index e0680a12c..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/parser/application-yml.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=parser/flow.yml \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/parser/flow.json b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/parser/flow.json deleted file mode 100644 index 52d0d05c0..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/parser/flow.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "flow": { - "nodes": { - "node": [ - { - "id": "a", - "class": "com.yomahub.liteflow.test.parser.cmp.ACmp" - }, - { - "id": "b", - "class": "com.yomahub.liteflow.test.parser.cmp.BCmp" - }, - { - "id": "c", - "class": "com.yomahub.liteflow.test.parser.cmp.CCmp" - }, - { - "id": "d", - "class": "com.yomahub.liteflow.test.parser.cmp.DCmp" - }, - { - "id": "e", - "class": "com.yomahub.liteflow.test.parser.cmp.ECmp" - }, - { - "id": "f", - "class": "com.yomahub.liteflow.test.parser.cmp.FCmp" - }, - { - "id": "g", - "class": "com.yomahub.liteflow.test.parser.cmp.GCmp" - } - ] - }, - "chain": [ - { - "name": "chain2", - "condition": [ - {"type": "then", "value": "c,g,f"} - ] - }, - { - "name": "chain1", - "condition": [ - {"type": "then", "value": "a,c"}, - {"type": "when", "value": "b,d,e(f|g)"}, - {"type": "then", "value": "chain2"} - ] - } - ] - } -} \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/parser/flow.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/parser/flow.xml deleted file mode 100644 index 0775c5ec1..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/parser/flow.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/parser/flow.yml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/parser/flow.yml deleted file mode 100644 index 814f59d54..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/parser/flow.yml +++ /dev/null @@ -1,30 +0,0 @@ -flow: - nodes: - node: - - id: a - class: com.yomahub.liteflow.test.parser.cmp.ACmp - - id: b - class: com.yomahub.liteflow.test.parser.cmp.BCmp - - id: c - class: com.yomahub.liteflow.test.parser.cmp.CCmp - - id: d - class: com.yomahub.liteflow.test.parser.cmp.DCmp - - id: e - class: com.yomahub.liteflow.test.parser.cmp.ECmp - - id: f - class: com.yomahub.liteflow.test.parser.cmp.FCmp - - id: g - class: com.yomahub.liteflow.test.parser.cmp.GCmp - chain: - - name: chain1 - condition: - - type: then - value: 'a,c' - - type: when - value: 'b,d,e(f|g)' - - type: then - value: 'chain2' - - name: chain2 - condition: - - type: then - value: 'c,g,f' diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/parser/subFoder1/subFoder2/flow1.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/parser/subFoder1/subFoder2/flow1.xml deleted file mode 100644 index de73569cd..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/parser/subFoder1/subFoder2/flow1.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/parser/subFoder1/subFoder2/flow2.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/parser/subFoder1/subFoder2/flow2.xml deleted file mode 100644 index c77305d52..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/parser/subFoder1/subFoder2/flow2.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/parser/subFoder1/subFoder2/flow3.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/parser/subFoder1/subFoder2/flow3.xml deleted file mode 100644 index 8eedecef6..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/parser/subFoder1/subFoder2/flow3.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/preAndFinally/application.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/preAndFinally/application.properties deleted file mode 100644 index 9ea8432e6..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/preAndFinally/application.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=preAndFinally/flow.xml \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/preAndFinally/flow.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/preAndFinally/flow.xml deleted file mode 100644 index 78e263d19..000000000 --- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/preAndFinally/flow.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - -
-        
-        
-    
-
-    
-        
-        
-        
-        
-    
-
-    
-        
-        
-        
-    
-
-    
-        
-        
-    
-
-    
-        
-        
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/privateDelivery/application.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/privateDelivery/application.properties
deleted file mode 100644
index c515ad389..000000000
--- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/privateDelivery/application.properties
+++ /dev/null
@@ -1 +0,0 @@
-liteflow.rule-source=privateDelivery/flow.xml
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/privateDelivery/flow.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/privateDelivery/flow.xml
deleted file mode 100644
index bf7146217..000000000
--- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/privateDelivery/flow.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-    
-        
-        
-        
-        
-        
-        
-        
-        
-        
-        
-        
-        
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/refreshRule/application.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/refreshRule/application.properties
deleted file mode 100644
index 174501a6c..000000000
--- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/refreshRule/application.properties
+++ /dev/null
@@ -1 +0,0 @@
-liteflow.rule-source=refreshRule/flow.xml
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/refreshRule/flow.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/refreshRule/flow.xml
deleted file mode 100644
index 22870d94f..000000000
--- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/refreshRule/flow.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/refreshRule/flow_update.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/refreshRule/flow_update.xml
deleted file mode 100644
index 29090f04a..000000000
--- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/refreshRule/flow_update.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/reload/application.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/reload/application.properties
deleted file mode 100644
index 5150bc23e..000000000
--- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/reload/application.properties
+++ /dev/null
@@ -1 +0,0 @@
-liteflow.rule-source=reload/flow.xml
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/reload/flow.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/reload/flow.xml
deleted file mode 100644
index 22870d94f..000000000
--- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/reload/flow.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/removeChain/application.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/removeChain/application.properties
deleted file mode 100644
index 729879505..000000000
--- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/removeChain/application.properties
+++ /dev/null
@@ -1 +0,0 @@
-liteflow.rule-source=removeChain/flow.xml
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/removeChain/flow.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/removeChain/flow.xml
deleted file mode 100644
index c89c44473..000000000
--- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/removeChain/flow.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-    
-        
-        
-    
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/requestId/application.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/requestId/application.properties
deleted file mode 100644
index feaedeff1..000000000
--- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/requestId/application.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-liteflow.rule-source=requestId/flow.xml
-liteflow.request-id-generator-class=com.yomahub.liteflow.test.requestId.config.CustomRequestIdGenerator
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/requestId/flow.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/requestId/flow.xml
deleted file mode 100644
index cd988fe71..000000000
--- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/requestId/flow.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/resizeSlot/application.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/resizeSlot/application.properties
deleted file mode 100644
index 6bea4bd1c..000000000
--- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/resizeSlot/application.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-liteflow.rule-source=resizeSlot/flow.xml
-liteflow.slot-size=4
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/resizeSlot/flow.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/resizeSlot/flow.xml
deleted file mode 100644
index 22870d94f..000000000
--- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/resizeSlot/flow.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/subflow/application-implicit.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/subflow/application-implicit.properties
deleted file mode 100644
index 3fc4f024e..000000000
--- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/subflow/application-implicit.properties
+++ /dev/null
@@ -1 +0,0 @@
-liteflow.rule-source=subflow/flow-implicit.xml
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/subflow/application-json.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/subflow/application-json.properties
deleted file mode 100644
index 7ca7b7bec..000000000
--- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/subflow/application-json.properties
+++ /dev/null
@@ -1 +0,0 @@
-liteflow.rule-source=subflow/flow.json
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/subflow/application-subInDifferentConfig1.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/subflow/application-subInDifferentConfig1.properties
deleted file mode 100644
index 8c77ba82c..000000000
--- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/subflow/application-subInDifferentConfig1.properties
+++ /dev/null
@@ -1 +0,0 @@
-liteflow.rule-source=subflow/flow-main.xml,subflow/flow-sub1.xml,subflow/flow-sub2.xml
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/subflow/application-subInDifferentConfig2.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/subflow/application-subInDifferentConfig2.properties
deleted file mode 100644
index e02c3b6a9..000000000
--- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/subflow/application-subInDifferentConfig2.properties
+++ /dev/null
@@ -1 +0,0 @@
-liteflow.rule-source=subflow/flow-main.xml,subflow/flow-sub1.xml,subflow/flow-sub2.yml
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/subflow/application-xml.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/subflow/application-xml.properties
deleted file mode 100644
index 1abd50496..000000000
--- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/subflow/application-xml.properties
+++ /dev/null
@@ -1 +0,0 @@
-liteflow.rule-source=subflow/flow.xml
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/subflow/application-yml.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/subflow/application-yml.properties
deleted file mode 100644
index 72074ec82..000000000
--- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/subflow/application-yml.properties
+++ /dev/null
@@ -1 +0,0 @@
-liteflow.rule-source=subflow/flow.yml
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/subflow/flow-implicit.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/subflow/flow-implicit.xml
deleted file mode 100644
index 5baca7072..000000000
--- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/subflow/flow-implicit.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-    
-         
-    
-
-    
-        
-    
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/subflow/flow-main.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/subflow/flow-main.xml
deleted file mode 100644
index 0adf54fc4..000000000
--- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/subflow/flow-main.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-    
-        
-         
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/subflow/flow-sub1.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/subflow/flow-sub1.xml
deleted file mode 100644
index 471dee3fe..000000000
--- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/subflow/flow-sub1.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-    
-        
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/subflow/flow-sub2.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/subflow/flow-sub2.xml
deleted file mode 100644
index 63dd964bf..000000000
--- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/subflow/flow-sub2.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/subflow/flow-sub2.yml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/subflow/flow-sub2.yml
deleted file mode 100644
index 8ba43c102..000000000
--- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/subflow/flow-sub2.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-flow:
-  chain:
-    - name: chain3
-      condition:
-        - type: then
-          value: 'e,d'
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/subflow/flow.json b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/subflow/flow.json
deleted file mode 100644
index 143589315..000000000
--- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/subflow/flow.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
-  "flow": {
-    "chain": [
-      {
-        "name": "chain3",
-        "condition": [
-          {"type": "then", "value": "e,d"}
-        ]
-      },
-      {
-        "name": "chain2",
-        "condition": [
-          {"type": "then", "value": "b,a"},
-          {"type": "then", "value": "chain3"}
-        ]
-      },
-      {
-        "name": "chain1",
-        "condition": [
-          {"type": "then", "value": "a,b"},
-          {"type": "then", "value": "c"},
-          {"type": "then", "value": "chain2"}
-        ]
-      },
-      {
-        "name": "c",
-        "condition": [
-          {"type": "then", "value": "d,e"}
-        ]
-      }
-    ]
-  }
-}
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/subflow/flow.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/subflow/flow.xml
deleted file mode 100644
index 03cf81299..000000000
--- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/subflow/flow.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-    
-        
-           
-         
-    
-
-    
-        
-    
-
-    
-        
-        
-    
-
-    
-        
-    
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/subflow/flow.yml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/subflow/flow.yml
deleted file mode 100644
index cdd8de74b..000000000
--- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/subflow/flow.yml
+++ /dev/null
@@ -1,24 +0,0 @@
-flow:
-  chain:
-    - name: chain3
-      condition:
-        - type: then
-          value: 'e,d'
-    - name: chain1
-      condition:
-        - type: then
-          value: 'a,b'
-        - type: then
-          value: 'c'
-        - type: then
-          value: 'chain2'
-    - name: c
-      condition:
-        - type: then
-          value: 'd,e'
-    - name: chain2
-      condition:
-        - type: then
-          value: 'b,a'
-        - type: then
-          value: 'chain3'
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/tag/application-json.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/tag/application-json.properties
deleted file mode 100644
index 2f9c09d4e..000000000
--- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/tag/application-json.properties
+++ /dev/null
@@ -1 +0,0 @@
-liteflow.rule-source=tag/flow.json
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/tag/application-xml.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/tag/application-xml.properties
deleted file mode 100644
index cc52d7cbc..000000000
--- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/tag/application-xml.properties
+++ /dev/null
@@ -1 +0,0 @@
-liteflow.rule-source=tag/flow.xml
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/tag/flow.json b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/tag/flow.json
deleted file mode 100644
index 49c902e4a..000000000
--- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/tag/flow.json
+++ /dev/null
@@ -1,31 +0,0 @@
-{
-  "flow": {
-    "chain": [
-      {
-        "name": "chain1",
-        "condition": [
-          {"type": "then", "value": "a[1],a[2],a[3]"}
-        ]
-      },
-      {
-        "name": "chain2",
-        "condition": [
-          {"type": "then", "value": "a[1],a[2],a[3],c[2](d[5]|e[6])"}
-        ]
-      },
-      {
-        "name": "chain3",
-        "condition": [
-          {"type": "then", "value": "b1"},
-          {"type": "when", "value": "b[1],b[2],b[3]"}
-        ]
-      },
-      {
-        "name": "chain4",
-        "condition": [
-          {"type": "then", "value": "f[false],g"}
-        ]
-      }
-    ]
-  }
-}
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/tag/flow.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/tag/flow.xml
deleted file mode 100644
index b7ceb903d..000000000
--- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/tag/flow.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-    
-        
-    
-
-    
-        
-    
-
-    
-        
-        
-    
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/useTTLInWhen/application.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/useTTLInWhen/application.properties
deleted file mode 100644
index 58d40f9ab..000000000
--- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/useTTLInWhen/application.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-liteflow.rule-source=useTTLInWhen/flow.xml
-liteflow.when-max-workers=2
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/useTTLInWhen/flow.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/useTTLInWhen/flow.xml
deleted file mode 100644
index af6d2ef54..000000000
--- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/useTTLInWhen/flow.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-    
-        
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/whenTimeOut/application1.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/whenTimeOut/application1.properties
deleted file mode 100644
index 05eb9ab0e..000000000
--- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/whenTimeOut/application1.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-liteflow.rule-source=whenTimeOut/flow1.xml
-liteflow.when-max-wait-seconds=3
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/whenTimeOut/application2.properties b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/whenTimeOut/application2.properties
deleted file mode 100644
index b90ff9c36..000000000
--- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/whenTimeOut/application2.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-liteflow.rule-source=whenTimeOut/flow2.xml
-liteflow.when-max-wait-seconds=5
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/whenTimeOut/flow1.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/whenTimeOut/flow1.xml
deleted file mode 100644
index 657f64cc3..000000000
--- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/whenTimeOut/flow1.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/whenTimeOut/flow2.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/whenTimeOut/flow2.xml
deleted file mode 100644
index 6586ab0b8..000000000
--- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/src/test/resources/whenTimeOut/flow2.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-    
-        
-        
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/pom.xml b/liteflow-testcase-old/liteflow-testcase-nospring/pom.xml
deleted file mode 100644
index 6216077a5..000000000
--- a/liteflow-testcase-old/liteflow-testcase-nospring/pom.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-    
-        liteflow-testcase-old
-        com.yomahub
-        ${revision}
-        ../pom.xml
-    
-    4.0.0
-
-    liteflow-testcase-nospring
-
-    
-        
-            com.yomahub
-            liteflow-core
-            ${revision}
-        
-        
-            ch.qos.logback
-            logback-classic
-            test
-        
-        
-            junit
-            junit
-            test
-        
-    
-
-    
-        
-            
-                org.apache.maven.plugins
-                maven-deploy-plugin
-                2.8.2
-                
-                    true
-                
-            
-        
-    
-
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/BaseTest.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/BaseTest.java
deleted file mode 100644
index 2dc0c9b8e..000000000
--- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/BaseTest.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package com.yomahub.liteflow.test;
-
-import com.yomahub.liteflow.core.FlowExecutorHolder;
-import com.yomahub.liteflow.flow.FlowBus;
-import com.yomahub.liteflow.property.LiteflowConfigGetter;
-import com.yomahub.liteflow.spi.holder.SpiFactoryCleaner;
-import com.yomahub.liteflow.thread.ExecutorHelper;
-import org.junit.AfterClass;
-
-public class BaseTest {
-
-    @AfterClass
-    public static void cleanScanCache(){
-        FlowBus.cleanCache();
-        ExecutorHelper.loadInstance().clearExecutorServiceMap();
-        SpiFactoryCleaner.clean();
-        LiteflowConfigGetter.clean();
-        FlowExecutorHolder.clean();
-    }
-}
diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/AbsoluteConfigPathTest.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/AbsoluteConfigPathTest.java
deleted file mode 100644
index ed4593916..000000000
--- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/AbsoluteConfigPathTest.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package com.yomahub.liteflow.test.absoluteConfigPath;
-
-import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.core.FlowExecutorHolder;
-import com.yomahub.liteflow.flow.LiteflowResponse;
-import com.yomahub.liteflow.property.LiteflowConfig;
-import com.yomahub.liteflow.slot.DefaultContext;
-import com.yomahub.liteflow.test.BaseTest;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * 非spring环境下异步线程超时日志打印测试
- * @author Bryan.Zhang
- * @since 2.6.11
- */
-public class AbsoluteConfigPathTest extends BaseTest {
-
-    private static FlowExecutor flowExecutor;
-
-    @BeforeClass
-    public static void init(){
-        LiteflowConfig config = new LiteflowConfig();
-        config.setRuleSource("/usr/local/flow2.xml");
-        flowExecutor = FlowExecutorHolder.loadInstance(config);
-    }
-
-    @Test
-    public void testAbsoluteConfig() throws Exception{
-        LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg");
-        Assert.assertTrue(response.isSuccess());
-    }
-}
diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/ACmp.java
deleted file mode 100644
index 65c4175bc..000000000
--- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/ACmp.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/**
- * 

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.absoluteConfigPath.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/CCmp.java deleted file mode 100644 index 2308d1bbe..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/CCmp.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.absoluteConfigPath.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/AsyncNodeTest.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/AsyncNodeTest.java deleted file mode 100644 index bd2354567..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/AsyncNodeTest.java +++ /dev/null @@ -1,136 +0,0 @@ -package com.yomahub.liteflow.test.asyncNode; - -import cn.hutool.core.collection.ListUtil; -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.core.FlowExecutorHolder; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import com.yomahub.liteflow.test.asyncNode.exception.TestException; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * 测试隐式调用子流程 - * 单元测试 - * - * @author ssss - */ -public class AsyncNodeTest extends BaseTest { - - private static FlowExecutor flowExecutor; - - @BeforeClass - public static void init(){ - LiteflowConfig config = new LiteflowConfig(); - config.setRuleSource("asyncNode/flow.xml"); - flowExecutor = FlowExecutorHolder.loadInstance(config); - } - - /***** - * 标准chain 嵌套选择 嵌套子chain进行执行 - * 验证了when情况下 多个node是并行执行 - * 验证了默认参数情况下 when可以加载执行 - * **/ - @Test - public void testAsyncFlow1() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "it's a base request"); - Assert.assertTrue(response.isSuccess()); - System.out.println(response.getExecuteStepStr()); - } - - //这个和test1有点类似,只不过进一步验证了步骤 - @Test - public void testAsyncFlow2() { - LiteflowResponse response = flowExecutor.execute2Resp("chain2", "it's a base request"); - Assert.assertTrue(ListUtil.toList("b==>j==>g==>f==>h","b==>j==>g==>h==>f", - "b==>j==>h==>g==>f","b==>j==>h==>f==>g", - "b==>j==>f==>h==>g","b==>j==>f==>g==>h" - ).contains(response.getExecuteStepStr())); - } - - //测试errorResume,默认的errorResume为false,这里测试默认的 - @Test - public void testAsyncFlow3_1() { - LiteflowResponse response = flowExecutor.execute2Resp("chain3-1", "it's a base request"); - Assert.assertFalse(response.isSuccess()); - Assert.assertEquals(response.getSlot().getException().getClass(), TestException.class); - } - - //测试errorResume,默认的errorResume为false,这里设置为true - @Test - public void testAsyncFlow3_2() { - LiteflowResponse response = flowExecutor.execute2Resp("chain3-2", "it's a base request"); - Assert.assertTrue(response.isSuccess()); - } - - //相同group的并行组,会合并,并且errorResume根据第一个when来,这里第一个when配置了不抛错 - @Test - public void testAsyncFlow4() { - LiteflowResponse response = flowExecutor.execute2Resp("chain4", "it's a base request"); - DefaultContext context = response.getFirstContextBean(); - //因为不记录错误,所以最终结果是true - Assert.assertTrue(response.isSuccess()); - //因为是并行组,所以即便抛错了,其他组件也会执行,i在流程里配置了2遍,i抛错,但是也执行了2遍,这里验证下 - Integer count = context.getData("count"); - Assert.assertEquals(new Integer(2), count); - //因为配置了不抛错,所以response里的cause应该为null - Assert.assertNull(response.getCause()); - } - - //相同group的并行组,会合并,并且errorResume根据第一个when来,这里第一个when配置了会抛错 - @Test - public void testAsyncFlow5() throws Exception { - LiteflowResponse response = flowExecutor.execute2Resp("chain5", "it's a base request"); - DefaultContext context = response.getFirstContextBean(); - //整个并行组是报错的,所以最终结果是false - Assert.assertFalse(response.isSuccess()); - //因为是并行组,所以即便抛错了,其他组件也会执行,i在流程里配置了2遍,i抛错,但是也执行了2遍,这里验证下 - Integer count = context.getData("count"); - Assert.assertEquals(new Integer(2), count); - //因为第一个when配置了会报错,所以response里的cause里应该会有TestException - Assert.assertEquals(TestException.class, response.getCause().getClass()); - } - - //不同group的并行组,不会合并,第一个when的errorResume是false,会抛错,那第二个when就不会执行 - @Test - public void testAsyncFlow6() throws Exception { - LiteflowResponse response = flowExecutor.execute2Resp("chain6", "it's a base request"); - DefaultContext context = response.getFirstContextBean(); - //第一个when会抛错,所以最终结果是false - Assert.assertFalse(response.isSuccess()); - //因为是不同组并行组,第一组的when里的i就抛错了,所以i就执行了1遍 - Integer count = context.getData("count"); - Assert.assertEquals(new Integer(1), count); - //第一个when会报错,所以最终response的cause里应该会有TestException - Assert.assertEquals(TestException.class, response.getCause().getClass()); - } - - //不同group的并行组,不会合并,第一个when的errorResume是true,不会报错,那第二个when还会继续执行,但是第二个when的errorResume是false,所以第二个when会报错 - @Test - public void testAsyncFlow7() throws Exception { - LiteflowResponse response = flowExecutor.execute2Resp("chain7", "it's a base request"); - DefaultContext context = response.getFirstContextBean(); - //第二个when会抛错,所以最终结果是false - Assert.assertFalse(response.isSuccess()); - // 传递了slotIndex,则set的size==2 - Integer count = context.getData("count"); - Assert.assertEquals(new Integer(2), count); - //第一个when会报错,所以最终response的cause里应该会有TestException - Assert.assertEquals(TestException.class, response.getCause().getClass()); - } - - //测试任意异步一个执行完即继续的场景 - //d g h并行,配置了any=true,其中d耗时1秒,g耗时0.5秒,其他都不设耗时 - //最终执行效果应该是h先返回,然后执行abc,最后gd - //这里要注意的是,由于step是先加入,所以step的打印顺序并不是这样的。但是实际执行是正确的 - @Test - public void testAsyncFlow8() throws Exception { - LiteflowResponse response = flowExecutor.execute2Resp("chain8", "it's a base request"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - Assert.assertTrue(context.getData("check").toString().startsWith("habc")); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ACmp.java deleted file mode 100644 index 67eb36cf2..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ACmp.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.yomahub.liteflow.test.asyncNode.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; - - -public class ACmp extends NodeComponent { - @Override - public void process() { - DefaultContext context = this.getFirstContextBean(); - synchronized (NodeComponent.class){ - if (context.hasData("check")){ - String str = context.getData("check"); - str += this.getNodeId(); - context.setData("check", str); - }else{ - context.setData("check", this.getNodeId()); - } - } - System.out.println("Acomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/BCmp.java deleted file mode 100644 index d369d1904..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/BCmp.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.yomahub.liteflow.test.asyncNode.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; - - -public class BCmp extends NodeComponent { - @Override - public void process() { - DefaultContext context = this.getFirstContextBean(); - synchronized (NodeComponent.class){ - if (context.hasData("check")){ - String str = context.getData("check"); - str += this.getNodeId(); - context.setData("check", str); - }else{ - context.setData("check", this.getNodeId()); - } - } - System.out.println("Bcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/CCmp.java deleted file mode 100644 index 01acb9075..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/CCmp.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.yomahub.liteflow.test.asyncNode.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; - - -public class CCmp extends NodeComponent { - @Override - public void process() throws Exception { - DefaultContext context = this.getFirstContextBean(); - synchronized (NodeComponent.class){ - if (context.hasData("check")){ - String str = context.getData("check"); - str += this.getNodeId(); - context.setData("check", str); - }else{ - context.setData("check", this.getNodeId()); - } - } - System.out.println("Ccomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/DCmp.java deleted file mode 100644 index 1b7534316..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/DCmp.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.yomahub.liteflow.test.asyncNode.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; - - -public class DCmp extends NodeComponent { - @Override - public void process() throws Exception { - Thread.sleep(1000); - DefaultContext context = this.getFirstContextBean(); - synchronized (NodeComponent.class){ - if (context.hasData("check")){ - String str = context.getData("check"); - str += this.getNodeId(); - context.setData("check", str); - }else{ - context.setData("check", this.getNodeId()); - } - } - System.out.println("Dcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ECmp.java deleted file mode 100644 index 656b81396..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ECmp.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.yomahub.liteflow.test.asyncNode.cmp; - -import com.yomahub.liteflow.core.NodeSwitchComponent; - - -public class ECmp extends NodeSwitchComponent { - - @Override - public String processSwitch() throws Exception { - System.out.println("Ecomp executed!"); - return "g"; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/FCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/FCmp.java deleted file mode 100644 index 90829331f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/FCmp.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.yomahub.liteflow.test.asyncNode.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - - -public class FCmp extends NodeComponent { - - @Override - public void process() throws Exception { - System.out.println("Fcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/GCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/GCmp.java deleted file mode 100644 index 8d2db9082..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/GCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.yomahub.liteflow.test.asyncNode.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; - - -public class GCmp extends NodeComponent { - - @Override - public void process() throws Exception { - Thread.sleep(500); - DefaultContext context = this.getFirstContextBean(); - synchronized (NodeComponent.class){ - if (context.hasData("check")){ - String str = context.getData("check"); - str += this.getNodeId(); - context.setData("check", str); - }else{ - context.setData("check", this.getNodeId()); - } - } - System.out.println("Gcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/HCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/HCmp.java deleted file mode 100644 index 1bdad12fa..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/HCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.yomahub.liteflow.test.asyncNode.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; - - -public class HCmp extends NodeComponent { - - @Override - public void process() throws Exception { - DefaultContext context = this.getFirstContextBean(); - synchronized (NodeComponent.class){ - if (context.hasData("check")){ - String str = context.getData("check"); - str += this.getNodeId(); - context.setData("check", str); - }else{ - context.setData("check", this.getNodeId()); - } - } - - System.out.println("Hcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ICmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ICmp.java deleted file mode 100644 index d2ff4d50d..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ICmp.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.yomahub.liteflow.test.asyncNode.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; -import com.yomahub.liteflow.test.asyncNode.exception.TestException; - - -public class ICmp extends NodeComponent { - - @Override - public void process() throws Exception { - DefaultContext context = this.getFirstContextBean(); - synchronized (ICmp.class){ - if (context.hasData("count")) { - Integer count = context.getData("count"); - context.setData("count", ++count); - } else { - context.setData("count", 1); - } - } - System.out.println("Icomp executed! throw Exception!"); - throw new TestException(); - } -} \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/JCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/JCmp.java deleted file mode 100644 index 0a954eb39..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/JCmp.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.yomahub.liteflow.test.asyncNode.cmp; - -import com.yomahub.liteflow.core.NodeSwitchComponent; - - -public class JCmp extends NodeSwitchComponent { - - @Override - public String processSwitch() throws Exception { - System.out.println("Jcomp executed!"); - return "chain3"; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/exception/TestException.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/exception/TestException.java deleted file mode 100644 index e786e9f86..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/asyncNode/exception/TestException.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.yomahub.liteflow.test.asyncNode.exception; - -public class TestException extends Exception{ -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/base/BaseCommonTest.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/base/BaseCommonTest.java deleted file mode 100644 index a88b8ce3b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/base/BaseCommonTest.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.yomahub.liteflow.test.base; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.core.FlowExecutorHolder; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - -public class BaseCommonTest extends BaseTest{ - - private static FlowExecutor flowExecutor; - - @BeforeClass - public static void init(){ - LiteflowConfig config = new LiteflowConfig(); - config.setRuleSource("base/flow.xml"); - flowExecutor = FlowExecutorHolder.loadInstance(config); - } - - @Test - public void testBase(){ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "test0"); - Assert.assertTrue(response.isSuccess()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/base/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/base/cmp/ACmp.java deleted file mode 100644 index e7d9de395..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/base/cmp/ACmp.java +++ /dev/null @@ -1,18 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.base.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/base/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/base/cmp/CCmp.java deleted file mode 100644 index 6194d81ab..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/base/cmp/CCmp.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.base.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class DCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("DCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/base/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/base/cmp/ECmp.java deleted file mode 100644 index df59cd643..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/base/cmp/ECmp.java +++ /dev/null @@ -1,18 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.base.cmp; - -import com.yomahub.liteflow.core.NodeSwitchComponent; - -public class ECmp extends NodeSwitchComponent { - - @Override - public String processSwitch() throws Exception { - return "g"; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/builder/BuilderTest.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/builder/BuilderTest.java deleted file mode 100644 index fe02596fb..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/builder/BuilderTest.java +++ /dev/null @@ -1,217 +0,0 @@ -package com.yomahub.liteflow.test.builder; - -import com.yomahub.liteflow.builder.LiteFlowChainBuilder; -import com.yomahub.liteflow.builder.LiteFlowConditionBuilder; -import com.yomahub.liteflow.builder.LiteFlowNodeBuilder; -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.core.FlowExecutorHolder; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.builder.entity.ExecutableEntity; -import com.yomahub.liteflow.enums.NodeTypeEnum; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import com.yomahub.liteflow.test.builder.cmp.ACmp; -import com.yomahub.liteflow.test.builder.cmp.BCmp; -import com.yomahub.liteflow.test.builder.cmp.CCmp; -import com.yomahub.liteflow.test.builder.cmp.DCmp; -import com.yomahub.liteflow.test.builder.cmp.ECmp; -import com.yomahub.liteflow.test.builder.cmp.FCmp; -import com.yomahub.liteflow.test.builder.cmp.GCmp; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - -public class BuilderTest extends BaseTest { - - private static FlowExecutor flowExecutor; - - @BeforeClass - public static void init(){ - LiteflowConfig config = new LiteflowConfig(); - flowExecutor = FlowExecutorHolder.loadInstance(config); - } - - //基于普通组件的builder模式测试 - @Test - public void testBuilder() throws Exception { - LiteFlowNodeBuilder.createNode().setId("a") - .setName("组件A") - .setType(NodeTypeEnum.COMMON) - .setClazz("com.yomahub.liteflow.test.builder.cmp.ACmp") - .build(); - LiteFlowNodeBuilder.createNode().setId("b") - .setName("组件B") - .setType(NodeTypeEnum.COMMON) - .setClazz("com.yomahub.liteflow.test.builder.cmp.BCmp") - .build(); - LiteFlowNodeBuilder.createNode().setId("c") - .setName("组件C") - .setType(NodeTypeEnum.COMMON) - .setClazz("com.yomahub.liteflow.test.builder.cmp.CCmp") - .build(); - LiteFlowNodeBuilder.createNode().setId("d") - .setName("组件D") - .setType(NodeTypeEnum.COMMON) - .setClazz("com.yomahub.liteflow.test.builder.cmp.DCmp") - .build(); - LiteFlowNodeBuilder.createNode().setId("e") - .setName("组件E") - .setType(NodeTypeEnum.SWITCH) - .setClazz("com.yomahub.liteflow.test.builder.cmp.ECmp") - .build(); - LiteFlowNodeBuilder.createNode().setId("f") - .setName("组件F") - .setType(NodeTypeEnum.COMMON) - .setClazz("com.yomahub.liteflow.test.builder.cmp.FCmp") - .build(); - LiteFlowNodeBuilder.createNode().setId("g") - .setName("组件G") - .setType(NodeTypeEnum.COMMON) - .setClazz("com.yomahub.liteflow.test.builder.cmp.GCmp") - .build(); - - - LiteFlowChainBuilder.createChain().setChainName("chain2").setCondition( - LiteFlowConditionBuilder.createThenCondition().setValue("c,d").build() - ).build(); - - LiteFlowChainBuilder.createChain().setChainName("chain1").setCondition( - LiteFlowConditionBuilder - .createThenCondition() - .setValue("a,b").build() - ).setCondition( - LiteFlowConditionBuilder.createWhenCondition() - .setValue("e(f|g|chain2)").build() - ).build(); - - LiteflowResponse response = flowExecutor.execute2Resp("chain1"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a[组件A]==>b[组件B]==>e[组件E]==>c[组件C]==>d[组件D]", response.getExecuteStepStr()); - } - - //基于普通组件的builder模式测试 - @Test - public void testBuilderForClassAndCode() throws Exception { - LiteFlowNodeBuilder.createNode().setId("a") - .setName("组件A") - .setType(NodeTypeEnum.COMMON) - .setClazz(ACmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("b") - .setName("组件B") - .setType(NodeTypeEnum.COMMON) - .setClazz(BCmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("c") - .setName("组件C") - .setType(NodeTypeEnum.COMMON) - .setClazz(CCmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("d") - .setName("组件D") - .setType(NodeTypeEnum.COMMON) - .setClazz(DCmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("e") - .setName("组件E") - .setType(NodeTypeEnum.SWITCH) - .setClazz(ECmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("f") - .setName("组件F") - .setType(NodeTypeEnum.COMMON) - .setClazz(FCmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("g") - .setName("组件G") - .setType(NodeTypeEnum.COMMON) - .setClazz(GCmp.class) - .build(); - - LiteFlowChainBuilder.createChain().setChainName("chain2").setCondition( - LiteFlowConditionBuilder.createThenCondition().setValue("c,d").build() - ).build(); - - LiteFlowChainBuilder.createChain().setChainName("chain1").setCondition( - LiteFlowConditionBuilder - .createThenCondition() - .setValue("a,b").build() - ).setCondition( - LiteFlowConditionBuilder.createWhenCondition() - .setValue("e(f|g|chain2)").build() - ).build(); - - LiteflowResponse response = flowExecutor.execute2Resp("chain1"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a[组件A]==>b[组件B]==>e[组件E]==>c[组件C]==>d[组件D]", response.getExecuteStepStr()); - } - - //基于普通组件的builder模式测试 - @Test - public void testBuilderForConditionNode() throws Exception { - LiteFlowNodeBuilder.createNode().setId("a") - .setName("组件A") - .setType(NodeTypeEnum.COMMON) - .setClazz(ACmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("b") - .setName("组件B") - .setType(NodeTypeEnum.COMMON) - .setClazz(BCmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("c") - .setName("组件C") - .setType(NodeTypeEnum.COMMON) - .setClazz(CCmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("d") - .setName("组件D") - .setType(NodeTypeEnum.COMMON) - .setClazz(DCmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("e") - .setName("组件E") - .setType(NodeTypeEnum.SWITCH) - .setClazz(ECmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("f") - .setName("组件F") - .setType(NodeTypeEnum.COMMON) - .setClazz(FCmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("g") - .setName("组件G") - .setType(NodeTypeEnum.COMMON) - .setClazz(GCmp.class) - .build(); - - - LiteFlowChainBuilder.createChain().setChainName("chain2").setCondition( - LiteFlowConditionBuilder.createThenCondition() - .setExecutable(new ExecutableEntity().setId("c")) - .setExecutable(new ExecutableEntity().setId("d")) - .build() - ).build(); - - LiteFlowChainBuilder.createChain().setChainName("chain1").setCondition( - LiteFlowConditionBuilder - .createThenCondition() - .setExecutable(new ExecutableEntity().setId("a").setTag("hello")) - .setExecutable(new ExecutableEntity().setId("b")) - .build() - ).setCondition( - LiteFlowConditionBuilder.createWhenCondition() - .setExecutable( - new ExecutableEntity().setId("e") - .addNodeCondComponent(new ExecutableEntity().setId("f").setTag("FHello")) - .addNodeCondComponent(new ExecutableEntity().setId("g")) - .addNodeCondComponent(new ExecutableEntity().setId("chain2") - )).build() - ).build(); - - LiteflowResponse response = flowExecutor.execute2Resp("chain1"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a[组件A]==>b[组件B]==>e[组件E]==>c[组件C]==>d[组件D]", response.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/builder/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/builder/cmp/ACmp.java deleted file mode 100644 index 79528ab3c..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/builder/cmp/ACmp.java +++ /dev/null @@ -1,18 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.builder.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/builder/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/builder/cmp/CCmp.java deleted file mode 100644 index 09bbb546d..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/builder/cmp/CCmp.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.builder.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class DCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("DCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/builder/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/builder/cmp/ECmp.java deleted file mode 100644 index 9fedf9f30..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/builder/cmp/ECmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.builder.cmp; - -import com.yomahub.liteflow.core.NodeSwitchComponent; - -public class ECmp extends NodeSwitchComponent { - - @Override - public String processSwitch() throws Exception { - System.out.println("ECmp executed!"); - return "chain2"; - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/builder/cmp/FCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/builder/cmp/FCmp.java deleted file mode 100644 index a26c3223e..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/builder/cmp/FCmp.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.builder.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class FCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("FCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/builder/cmp/GCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/builder/cmp/GCmp.java deleted file mode 100644 index 4fd5944bb..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/builder/cmp/GCmp.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.builder.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class GCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("GCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/cmpRetry/LiteflowRetryTest.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/cmpRetry/LiteflowRetryTest.java deleted file mode 100644 index 5e3f69c2e..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/cmpRetry/LiteflowRetryTest.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.yomahub.liteflow.test.cmpRetry; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.core.FlowExecutorHolder; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - - -/** - * 测试非spring下的节点执行器 - * @author Bryan.Zhang - * @since 2.5.10 - */ -public class LiteflowRetryTest extends BaseTest { - - private static FlowExecutor flowExecutor; - - @BeforeClass - public static void init(){ - LiteflowConfig config = new LiteflowConfig(); - config.setRuleSource("cmpRetry/flow.xml"); - config.setRetryCount(3); - config.setSlotSize(512); - flowExecutor = FlowExecutorHolder.loadInstance(config); - } - - //全局重试配置测试 - @Test - public void testRetry1() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a==>b==>b==>b", response.getExecuteStepStr()); - } - - //单个组件重试配置测试 - @Test - public void testRetry2() { - LiteflowResponse response = flowExecutor.execute2Resp("chain2", "arg"); - Assert.assertFalse(response.isSuccess()); - Assert.assertEquals("c==>c==>c==>c==>c==>c", response.getExecuteStepStr()); - } - - //单个组件指定异常,但抛出的并不是指定异常的场景测试 - @Test - public void testRetry3() { - LiteflowResponse response = flowExecutor.execute2Resp("chain3", "arg"); - Assert.assertFalse(response.isSuccess()); - } - - //单个组件指定异常重试,抛出的是指定异常或者 - @Test - public void testRetry4() { - LiteflowResponse response = flowExecutor.execute2Resp("chain4", "arg"); - Assert.assertFalse(response.isSuccess()); - Assert.assertEquals("e==>e==>e==>e==>e==>e", response.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/ACmp.java deleted file mode 100644 index 19337ec40..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/ACmp.java +++ /dev/null @@ -1,18 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.cmpRetry.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class BCmp extends NodeComponent { - - private int flag = 0; - - @Override - public void process() { - System.out.println("BCmp executed!"); - if (flag < 2){ - flag++; - throw new RuntimeException("demo exception"); - } - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/CCmp.java deleted file mode 100644 index 075601a53..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/CCmp.java +++ /dev/null @@ -1,22 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.cmpRetry.cmp; - -import com.yomahub.liteflow.annotation.LiteflowRetry; -import com.yomahub.liteflow.core.NodeComponent; - -@LiteflowRetry(5) -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - throw new RuntimeException("demo exception"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/DCmp.java deleted file mode 100644 index a1f51a9ec..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/DCmp.java +++ /dev/null @@ -1,22 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.cmpRetry.cmp; - -import com.yomahub.liteflow.annotation.LiteflowRetry; -import com.yomahub.liteflow.core.NodeComponent; - -@LiteflowRetry(retry = 5, forExceptions = {NullPointerException.class}) -public class DCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("DCmp executed!"); - throw new RuntimeException("demo exception"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/ECmp.java deleted file mode 100644 index bef09bb59..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/ECmp.java +++ /dev/null @@ -1,22 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.cmpRetry.cmp; - -import com.yomahub.liteflow.annotation.LiteflowRetry; -import com.yomahub.liteflow.core.NodeComponent; - -@LiteflowRetry(retry = 5, forExceptions = {NullPointerException.class}) -public class ECmp extends NodeComponent { - - @Override - public void process() { - System.out.println("ECmp executed!"); - throw new NullPointerException("demo null exception"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/cmpStep/CmpStepTest.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/cmpStep/CmpStepTest.java deleted file mode 100644 index cc23d43be..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/cmpStep/CmpStepTest.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.yomahub.liteflow.test.cmpStep; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.core.FlowExecutorHolder; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - -public class CmpStepTest extends BaseTest{ - - private static FlowExecutor flowExecutor; - - @BeforeClass - public static void init(){ - LiteflowConfig config = new LiteflowConfig(); - config.setRuleSource("cmpStep/flow.xml"); - flowExecutor = FlowExecutorHolder.loadInstance(config); - } - - @Test - public void testStep1(){ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertFalse(response.isSuccess()); - Assert.assertTrue(response.getExecuteSteps().get("a").isSuccess()); - Assert.assertTrue(response.getExecuteSteps().get("b").isSuccess()); - Assert.assertFalse(response.getExecuteSteps().get("c").isSuccess()); - Assert.assertFalse(response.getExecuteSteps().get("d").isSuccess()); - Assert.assertTrue(response.getExecuteSteps().get("c").getTimeSpent() >= 2000); - Assert.assertEquals(RuntimeException.class, response.getExecuteSteps().get("c").getException().getClass()); - Assert.assertEquals(RuntimeException.class, response.getExecuteSteps().get("d").getException().getClass()); - } - - @Test - public void testStep2() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain2", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a==>b", response.getExecuteStepStrWithoutTime()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/ACmp.java deleted file mode 100644 index 5f9cb70f7..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/ACmp.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.cmpStep.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class ACmp extends NodeComponent { - - @Override - public void process() throws Exception{ - Thread.sleep(5000L); - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/BCmp.java deleted file mode 100644 index 1318f6b3c..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/BCmp.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.cmpStep.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class CCmp extends NodeComponent { - - @Override - public void process() throws Exception{ - System.out.println("CCmp executed!"); - Thread.sleep(2000); - throw new RuntimeException("test error c"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/DCmp.java deleted file mode 100644 index dbb0348bd..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/DCmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.cmpStep.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class DCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - throw new RuntimeException("test error d"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/ECmp.java deleted file mode 100644 index 10d6b90e4..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/ECmp.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.cmpStep.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class ECmp extends NodeComponent { - - @Override - public void process() { - System.out.println("ECmp executed!"); - } - - @Override - public boolean isAccess() { - return false; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/component/FlowExecutorTest.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/component/FlowExecutorTest.java deleted file mode 100644 index 366fdd50e..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/component/FlowExecutorTest.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.yomahub.liteflow.test.component; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.core.FlowExecutorHolder; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * 组件功能点测试 - * 单元测试 - * - * @author donguo.tao - */ -public class FlowExecutorTest extends BaseTest { - - private static FlowExecutor flowExecutor; - - @BeforeClass - public static void init(){ - LiteflowConfig config = new LiteflowConfig(); - config.setRuleSource("component/flow.xml"); - flowExecutor = FlowExecutorHolder.loadInstance(config); - } - - //isAccess方法的功能测试 - @Test - public void testIsAccess() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", 101); - Assert.assertTrue(response.isSuccess()); - Assert.assertNotNull(response.getSlot().getResponseData()); - } - - //组件抛错的功能点测试 - @Test(expected = ArithmeticException.class) - public void testComponentException() throws Throwable { - LiteflowResponse response = flowExecutor.execute2Resp("chain2", 0); - Assert.assertFalse(response.isSuccess()); - Assert.assertEquals("/ by zero", response.getMessage()); - throw response.getCause(); - } - - //isContinueOnError方法的功能点测试 - @Test - public void testIsContinueOnError() throws Throwable { - LiteflowResponse response = flowExecutor.execute2Resp("chain3", 0); - Assert.assertTrue(response.isSuccess()); - Assert.assertNull(response.getCause()); - } - - //isEnd方法的功能点测试 - @Test - public void testIsEnd() throws Exception { - LiteflowResponse response = flowExecutor.execute2Resp("chain4", 10); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("d",response.getExecuteStepStr()); - } - - //setIsEnd方法的功能点测试 - @Test - public void testSetIsEnd1() throws Exception { - LiteflowResponse response = flowExecutor.execute2Resp("chain5", 10); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("e",response.getExecuteStepStr()); - } - - //条件组件的功能点测试 - @Test - public void testNodeCondComponent() { - LiteflowResponse response = flowExecutor.execute2Resp("chain6", 0); - Assert.assertTrue(response.isSuccess()); - } - - //测试setIsEnd如果为true,continueError也为true,那不应该continue了 - @Test - public void testSetIsEnd2() throws Exception { - LiteflowResponse response = flowExecutor.execute2Resp("chain7", 10); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("g",response.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/component/cmp1/ACmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/component/cmp1/ACmp.java deleted file mode 100644 index a124e69c6..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/component/cmp1/ACmp.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.yomahub.liteflow.test.component.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; - -import java.util.Objects; - - -public class ACmp extends NodeComponent { - @Override - public void process() { - System.out.println("AComp executed!"); - this.getSlot().setResponseData("AComp executed!"); - } - - @Override - public boolean isAccess() { - Integer requestData = this.getRequestData(); - if (Objects.nonNull(requestData) && requestData > 100){ - return true; - } - System.out.println("AComp isAccess false."); - return false; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/component/cmp1/BCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/component/cmp1/BCmp.java deleted file mode 100644 index 839751abf..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/component/cmp1/BCmp.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.yomahub.liteflow.test.component.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; - -import java.util.Objects; - - -public class BCmp extends NodeComponent { - @Override - public void process() { - System.out.println("BComp executed!"); - Integer requestData = this.getRequestData(); - Integer divisor = 130; - Integer result = divisor / requestData; - this.getSlot().setResponseData(result); - } - - @Override - public boolean isAccess() { - Integer requestData = this.getRequestData(); - if (Objects.nonNull(requestData)){ - return true; - } - return false; - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/component/cmp1/CCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/component/cmp1/CCmp.java deleted file mode 100644 index be659b127..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/component/cmp1/CCmp.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.yomahub.liteflow.test.component.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; - -import java.util.Objects; - - -public class CCmp extends NodeComponent { - @Override - public void process() { - System.out.println("CComp executed!"); - Integer requestData = this.getRequestData(); - Integer divisor = 130; - Integer result = divisor / requestData; - this.getSlot().setResponseData(result); - System.out.println("responseData="+Integer.parseInt(this.getSlot().getResponseData())); - } - - @Override - public boolean isContinueOnError() { - Integer requestData = this.getRequestData(); - if (Objects.nonNull(requestData)){ - return true; - } - return false; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/component/cmp1/DCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/component/cmp1/DCmp.java deleted file mode 100644 index b90d1f53c..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/component/cmp1/DCmp.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.yomahub.liteflow.test.component.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; - -import java.util.Objects; - - -public class DCmp extends NodeComponent { - @Override - public void process() throws Exception { - System.out.println("DComp executed!"); - } - - @Override - public boolean isEnd() { - //组件的process执行完之后才会执行isEnd - Object requestData = this.getSlot().getResponseData(); - if (Objects.isNull(requestData)){ - System.out.println("DComp flow isEnd, because of responseData is null."); - return true; - } - return false; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/component/cmp1/ECmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/component/cmp1/ECmp.java deleted file mode 100644 index a637f809d..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/component/cmp1/ECmp.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.yomahub.liteflow.test.component.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.util.JsonUtil; - -import java.util.Objects; - - -public class ECmp extends NodeComponent { - - @Override - public void process() throws Exception { - System.out.println("EComp executed!"); - Object responseData = this.getSlot().getResponseData(); - if (Objects.isNull(responseData)){ - System.out.println("EComp responseData flow must be set end ."); - //执行到某个条件时,手动结束流程。 - this.setIsEnd(true); - } - System.out.println("EComp responseData responseData=" + JsonUtil.toJsonString(responseData)); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/component/cmp1/GCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/component/cmp1/GCmp.java deleted file mode 100644 index 2f0d6c958..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/component/cmp1/GCmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.component.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; - -public class GCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("GCmp executed!"); - this.setIsEnd(true); - } - - @Override - public boolean isContinueOnError() { - return true; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/component/cmp1/HCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/component/cmp1/HCmp.java deleted file mode 100644 index 21c9bccb1..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/component/cmp1/HCmp.java +++ /dev/null @@ -1,18 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.component.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; - -public class HCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("HCmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/component/cmp2/FSwitchCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/component/cmp2/FSwitchCmp.java deleted file mode 100644 index 105340090..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/component/cmp2/FSwitchCmp.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.yomahub.liteflow.test.component.cmp2; - -import com.yomahub.liteflow.core.NodeSwitchComponent; -import java.util.Objects; - -public class FSwitchCmp extends NodeSwitchComponent { - @Override - public String processSwitch() { - Integer requestData = this.getRequestData(); - if (Objects.isNull(requestData)){ - return "d"; - } else if(requestData == 0){ - return "c"; - } else { - return "b"; - } - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/config/LiteflowConfigTest1.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/config/LiteflowConfigTest1.java deleted file mode 100644 index e367af9a4..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/config/LiteflowConfigTest1.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.yomahub.liteflow.test.config; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.core.FlowExecutorHolder; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.property.LiteflowConfigGetter; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * 非spring环境下参数单元测试 - * @author zendwang - * @since 2.5.0 - */ -public class LiteflowConfigTest1 extends BaseTest { - - private static FlowExecutor flowExecutor; - - @BeforeClass - public static void init(){ - LiteflowConfig config = new LiteflowConfig(); - config.setRuleSource("config/flow.xml"); - flowExecutor = FlowExecutorHolder.loadInstance(config); - } - - @Test - public void testConfig() { - LiteflowConfig config = LiteflowConfigGetter.get(); - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("config/flow.xml", config.getRuleSource()); - Assert.assertEquals(15, config.getWhenMaxWaitSeconds().intValue()); - Assert.assertEquals(200, config.getQueueLimit().intValue()); - Assert.assertEquals(300000L, config.getDelay().longValue()); - Assert.assertEquals(300000L, config.getPeriod().longValue()); - Assert.assertFalse(config.getEnableLog()); - Assert.assertEquals(16, config.getWhenMaxWorkers().longValue()); - Assert.assertEquals(512, config.getWhenQueueLimit().longValue()); - Assert.assertEquals(true, config.isParseOnStart()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/config/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/config/cmp/ACmp.java deleted file mode 100644 index cecd0c49b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/config/cmp/ACmp.java +++ /dev/null @@ -1,18 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.config.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor1.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor1.java deleted file mode 100644 index 6f88c4cdd..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor1.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.yomahub.liteflow.test.customWhenThreadPool; - -import cn.hutool.core.util.ObjectUtil; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.property.LiteflowConfigGetter; -import com.yomahub.liteflow.thread.ExecutorBuilder; - -import java.util.concurrent.ExecutorService; - -public class CustomThreadExecutor1 implements ExecutorBuilder { - - @Override - public ExecutorService buildExecutor() { - LiteflowConfig liteflowConfig = LiteflowConfigGetter.get(); - //只有在非spring的场景下liteflowConfig才会为null - if (ObjectUtil.isNull(liteflowConfig)) { - liteflowConfig = new LiteflowConfig(); - } - return buildDefaultExecutor( - liteflowConfig.getWhenMaxWorkers(), - liteflowConfig.getWhenMaxWorkers(), - liteflowConfig.getWhenQueueLimit(), - "customer-when-1-thead-"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor2.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor2.java deleted file mode 100644 index 7d45e4ad5..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor2.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.yomahub.liteflow.test.customWhenThreadPool; - -import cn.hutool.core.util.ObjectUtil; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.property.LiteflowConfigGetter; -import com.yomahub.liteflow.thread.ExecutorBuilder; - -import java.util.concurrent.ExecutorService; - -public class CustomThreadExecutor2 implements ExecutorBuilder { - @Override - public ExecutorService buildExecutor() { - LiteflowConfig liteflowConfig = LiteflowConfigGetter.get(); - //只有在非spring的场景下liteflowConfig才会为null - if (ObjectUtil.isNull(liteflowConfig)) { - liteflowConfig = new LiteflowConfig(); - } - return buildDefaultExecutor( - liteflowConfig.getWhenMaxWorkers(), - liteflowConfig.getWhenMaxWorkers(), - liteflowConfig.getWhenQueueLimit(), - "customer-when-2-thead-"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor3.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor3.java deleted file mode 100644 index 875dc3d1d..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor3.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.yomahub.liteflow.test.customWhenThreadPool; - -import cn.hutool.core.util.ObjectUtil; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.property.LiteflowConfigGetter; -import com.yomahub.liteflow.thread.ExecutorBuilder; - -import java.util.concurrent.ExecutorService; - -public class CustomThreadExecutor3 implements ExecutorBuilder { - @Override - public ExecutorService buildExecutor() { - LiteflowConfig liteflowConfig = LiteflowConfigGetter.get(); - //只有在非spring的场景下liteflowConfig才会为null - if (ObjectUtil.isNull(liteflowConfig)) { - liteflowConfig = new LiteflowConfig(); - } - return buildDefaultExecutor( - liteflowConfig.getWhenMaxWorkers(), - liteflowConfig.getWhenMaxWorkers(), - liteflowConfig.getWhenQueueLimit(), - "customer-when-3-thead-"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomWhenThreadPoolTest.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomWhenThreadPoolTest.java deleted file mode 100644 index 0d2574b1a..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomWhenThreadPoolTest.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.yomahub.liteflow.test.customWhenThreadPool; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.core.FlowExecutorHolder; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * nospring环境下异步线程超时日志打印测试 - * - * @author Bryan.Zhang - * @since 2.6.4 - */ -public class CustomWhenThreadPoolTest extends BaseTest { - - private static FlowExecutor flowExecutor; - - @BeforeClass - public static void init(){ - LiteflowConfig config = new LiteflowConfig(); - config.setRuleSource("customWhenThreadPool/flow.xml"); - flowExecutor = FlowExecutorHolder.loadInstance(config); - } - - /** - * 测试全局线程池配置 - */ - @Test - public void testGlobalThreadPool() { - LiteflowResponse response = flowExecutor.execute2Resp("chain", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - Assert.assertTrue(context.getData("threadName").toString().startsWith("lf-when-thead")); - } - - /** - * 测试全局和when上自定义线程池-优先以when上为准 - */ - @Test - public void testGlobalAndCustomWhenThreadPool() { - LiteflowResponse response1 = flowExecutor.execute2Resp("chain1", "arg"); - DefaultContext context = response1.getFirstContextBean(); - Assert.assertTrue(response1.isSuccess()); - Assert.assertTrue(context.getData("threadName").toString().startsWith("customer-when-1-thead")); - } - - - /** - * when配置的线程池可以共用 - */ - @Test - public void testCustomWhenThreadPool() { - // 使用when - thread1 - testGlobalAndCustomWhenThreadPool(); - // chain配置同一个thead1 - LiteflowResponse response2 = flowExecutor.execute2Resp("chain2", "arg"); - DefaultContext context = response2.getFirstContextBean(); - Assert.assertTrue(response2.isSuccess()); - Assert.assertTrue(context.getData("threadName").toString().startsWith("customer-when-1-thead")); - - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/ACmp.java deleted file mode 100644 index 904aa20d1..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/ACmp.java +++ /dev/null @@ -1,18 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.customWhenThreadPool.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; - -public class BCmp extends NodeComponent { - - @Override - public void process() { - DefaultContext context = this.getFirstContextBean(); - context.setData("threadName", Thread.currentThread().getName()); - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/CCmp.java deleted file mode 100644 index fe8f9d849..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/CCmp.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.customWhenThreadPool.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; - -public class CCmp extends NodeComponent { - - @Override - public void process() { - DefaultContext context = this.getFirstContextBean(); - context.setData("threadName", Thread.currentThread().getName()); - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/DCmp.java deleted file mode 100644 index 5d96e447d..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/DCmp.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.customWhenThreadPool.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; - -public class DCmp extends NodeComponent { - - @Override - public void process() { - DefaultContext context = this.getFirstContextBean(); - context.setData("threadName", Thread.currentThread().getName()); - System.out.println("DCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/ECmp.java deleted file mode 100644 index 3ce1d86cb..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/ECmp.java +++ /dev/null @@ -1,22 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.customWhenThreadPool.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; - -public class ECmp extends NodeComponent { - - @Override - public void process() { - DefaultContext context = this.getFirstContextBean(); - context.setData("threadName", Thread.currentThread().getName()); - System.out.println("ECmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/FCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/FCmp.java deleted file mode 100644 index d0bcd868f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/FCmp.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.customWhenThreadPool.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; - -public class FCmp extends NodeComponent { - - @Override - public void process() { - DefaultContext context = this.getFirstContextBean(); - context.setData("threadName", Thread.currentThread().getName()); - System.out.println("FCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/emptyflow/EmptyFlowTest.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/emptyflow/EmptyFlowTest.java deleted file mode 100644 index f857902b1..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/emptyflow/EmptyFlowTest.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.yomahub.liteflow.test.emptyflow; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.core.FlowExecutorHolder; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * 切面场景单元测试 - * @author Bryan.Zhang - */ -public class EmptyFlowTest extends BaseTest { - - private static FlowExecutor flowExecutor; - - @BeforeClass - public static void init(){ - LiteflowConfig config = new LiteflowConfig(); - config.setRuleSource("emptyFlow/flow.xml"); - flowExecutor = FlowExecutorHolder.loadInstance(config); - } - - //测试空flow的情况下,liteflow是否能正常启动 - @Test - public void testEmptyFlow() { - //不做任何事,为的是能正常启动 - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/event/EventTest.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/event/EventTest.java deleted file mode 100644 index b26f0f900..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/event/EventTest.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.yomahub.liteflow.test.event; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.core.FlowExecutorHolder; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - -public class EventTest extends BaseTest{ - - private static FlowExecutor flowExecutor; - - @BeforeClass - public static void init(){ - LiteflowConfig config = new LiteflowConfig(); - config.setRuleSource("event/flow.xml"); - flowExecutor = FlowExecutorHolder.loadInstance(config); - } - - //测试组件成功事件 - @Test - public void testEvent1() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("abc", context.getData("test")); - } - - //测试组件失败事件 - @Test - public void testEvent2() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain2", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertFalse(response.isSuccess()); - Assert.assertEquals(NullPointerException.class, response.getCause().getClass()); - Assert.assertEquals("ab", context.getData("test")); - Assert.assertEquals("error:d", context.getData("error")); - } - - //测试组件失败事件本身抛出异常 - @Test - public void testEvent3() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain3", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertFalse(response.isSuccess()); - Assert.assertEquals(NullPointerException.class, response.getCause().getClass()); - Assert.assertEquals("a", context.getData("test")); - Assert.assertEquals("error:e", context.getData("error")); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/event/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/event/cmp/ACmp.java deleted file mode 100644 index d4c72e051..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/event/cmp/ACmp.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.event.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; - -public class ACmp extends NodeComponent { - - @Override - public void process() { - DefaultContext context = this.getFirstContextBean(); - context.setData("test",""); - System.out.println("ACmp executed!"); - } - - @Override - public void onSuccess() throws Exception { - DefaultContext context = this.getFirstContextBean(); - String str = context.getData("test"); - str += this.getNodeId(); - context.setData("test", str); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/event/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/event/cmp/BCmp.java deleted file mode 100644 index b3328cd94..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/event/cmp/BCmp.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.event.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; - -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BCmp executed!"); - } - - @Override - public void onSuccess() throws Exception { - DefaultContext context = this.getFirstContextBean(); - String str = context.getData("test"); - str += this.getNodeId(); - context.setData("test", str); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/event/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/event/cmp/CCmp.java deleted file mode 100644 index 6815efbbb..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/event/cmp/CCmp.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.event.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; - -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - - @Override - public void onSuccess() throws Exception { - DefaultContext context = this.getFirstContextBean(); - String str = context.getData("test"); - str += this.getNodeId(); - context.setData("test", str); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/event/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/event/cmp/DCmp.java deleted file mode 100644 index 502b4e39d..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/event/cmp/DCmp.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.event.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; - -public class DCmp extends NodeComponent { - - @Override - public void process() throws Exception{ - System.out.println("CCmp executed!"); - throw new NullPointerException(); - } - - @Override - public void onError() throws Exception { - DefaultContext context = this.getFirstContextBean(); - context.setData("error","error:"+this.getNodeId()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/event/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/event/cmp/ECmp.java deleted file mode 100644 index 6bc89b13a..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/event/cmp/ECmp.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.event.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; - -public class ECmp extends NodeComponent { - - @Override - public void process() throws Exception{ - System.out.println("CCmp executed!"); - throw new NullPointerException(); - } - - @Override - public void onError() throws Exception { - DefaultContext context = this.getFirstContextBean(); - context.setData("error","error:"+this.getNodeId()); - throw new IllegalAccessException("错误事件回调本身抛出异常"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/exception/CustomStatefulException.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/exception/CustomStatefulException.java deleted file mode 100644 index 11441ab58..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/exception/CustomStatefulException.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.yomahub.liteflow.test.exception; - -import com.yomahub.liteflow.exception.LiteFlowException; - -/** - * 用户自定义带状态码的异常 - */ -public class CustomStatefulException extends LiteFlowException { - public CustomStatefulException(String code, String message) { - super(code, message); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/exception/Exception1Test.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/exception/Exception1Test.java deleted file mode 100644 index 5be900a90..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/exception/Exception1Test.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.yomahub.liteflow.test.exception; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.core.FlowExecutorHolder; -import com.yomahub.liteflow.exception.ChainDuplicateException; -import com.yomahub.liteflow.exception.ConfigErrorException; -import com.yomahub.liteflow.exception.FlowExecutorNotInitException; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.property.LiteflowConfigGetter; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * 流程执行异常 - * 单元测试 - * - * @author zendwang - */ -public class Exception1Test extends BaseTest { - - private static FlowExecutor flowExecutor; - - @BeforeClass - public static void init(){ - LiteflowConfig config = new LiteflowConfig(); - config.setRuleSource("exception/flow.xml"); - config.setWhenMaxWaitSeconds(1); - flowExecutor = FlowExecutorHolder.loadInstance(config); - } - - /** - * 验证 chain 节点重复的异常 - */ - @Test(expected = ChainDuplicateException.class) - public void testChainDuplicateException() { - LiteflowConfig config = LiteflowConfigGetter.get(); - config.setRuleSource("exception/flow-exception.xml"); - flowExecutor.init(); - } - - @Test(expected = ConfigErrorException.class) - public void testConfigErrorException() { - flowExecutor.setLiteflowConfig(null); - flowExecutor.init(); - } - - @Test(expected = FlowExecutorNotInitException.class) - public void testFlowExecutorNotInitException() { - LiteflowConfig config = LiteflowConfigGetter.get(); - config.setRuleSource("error/flow.txt"); - flowExecutor.init(); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/exception/Exception2Test.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/exception/Exception2Test.java deleted file mode 100644 index 4d3f9aa9a..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/exception/Exception2Test.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.yomahub.liteflow.test.exception; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.core.FlowExecutorHolder; -import com.yomahub.liteflow.exception.*; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.property.LiteflowConfigGetter; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * 流程执行异常 - * 单元测试 - * - * @author zendwang - */ -public class Exception2Test extends BaseTest { - - private static FlowExecutor flowExecutor; - - @BeforeClass - public static void init(){ - LiteflowConfig config = new LiteflowConfig(); - config.setRuleSource("exception/flow.xml"); - config.setWhenMaxWaitSeconds(1); - flowExecutor = FlowExecutorHolder.loadInstance(config); - } - @Test(expected = ChainNotFoundException.class) - public void testChainNotFoundException() throws Exception { - flowExecutor.execute("chain0", "it's a request"); - } - - @Test(expected = RuntimeException.class) - public void testComponentCustomException() throws Exception { - flowExecutor.execute("chain1", "exception"); - } - - @Test(expected = FlowSystemException.class) - public void testNoConditionInChainException() throws Throwable { - LiteflowResponse response = flowExecutor.execute2Resp("chain2", "test"); - Assert.assertFalse(response.isSuccess()); - Assert.assertEquals("no conditionList in this chain[chain2]", response.getMessage()); - throw response.getCause(); - } - - @Test - public void testGetSlotFromResponseWhenException() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain4", "test"); - Assert.assertFalse(response.isSuccess()); - Assert.assertNotNull(response.getCause()); - Assert.assertNotNull(response.getSlot()); - } - - @Test(expected = NoSwitchTargetNodeException.class) - public void testNoTargetFindException() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain5", "test"); - Assert.assertFalse(response.isSuccess()); - throw response.getCause(); - } - - @Test - public void testInvokeCustomStatefulException() { - LiteflowResponse response = flowExecutor.execute2Resp("chain6", "custom-stateful-exception"); - Assert.assertFalse(response.isSuccess()); - Assert.assertEquals("300", response.getCode()); - Assert.assertNotNull(response.getCause()); - Assert.assertTrue(response.getCause() instanceof LiteFlowException); - Assert.assertNotNull(response.getSlot()); - } - - @Test - public void testNotInvokeCustomStatefulException() { - LiteflowResponse response = flowExecutor.execute2Resp("chain6", "test"); - Assert.assertTrue(response.isSuccess()); - Assert.assertNull(response.getCode()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/exception/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/exception/cmp/ACmp.java deleted file mode 100644 index 5067260ac..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/exception/cmp/ACmp.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.exception.cmp; - -import cn.hutool.core.util.StrUtil; -import com.yomahub.liteflow.core.NodeComponent; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class ACmp extends NodeComponent { - - private static final Logger LOG = LoggerFactory.getLogger(ACmp.class); - - @Override - public void process() { - String str = this.getRequestData(); - if(StrUtil.isNotBlank(str) && str.equals("exception")) { - throw new RuntimeException("chain execute execption"); - } - LOG.info("Acomp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/exception/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/exception/cmp/BCmp.java deleted file mode 100644 index 2bcd41e9c..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/exception/cmp/BCmp.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.exception.cmp; - -import cn.hutool.core.util.StrUtil; -import com.yomahub.liteflow.core.NodeComponent; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class BCmp extends NodeComponent { - - private static final Logger LOG = LoggerFactory.getLogger(BCmp.class); - - @Override - public void process() throws InterruptedException { - String str = this.getRequestData(); - if(StrUtil.isNotBlank(str) && str.equals("when")) { - try { - LOG.info("Bcomp sleep begin"); - Thread.sleep(3000); - LOG.info("Bcomp sleep end"); - } catch (InterruptedException e) { - throw e; - } - } - LOG.info("Bcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/exception/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/exception/cmp/CCmp.java deleted file mode 100644 index 7adc24167..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/exception/cmp/CCmp.java +++ /dev/null @@ -1,22 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.exception.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class CCmp extends NodeComponent { - - private static final Logger LOG = LoggerFactory.getLogger(CCmp.class); - - @Override - public void process() { - LOG.info("Ccomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/exception/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/exception/cmp/DCmp.java deleted file mode 100644 index 171947632..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/exception/cmp/DCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.exception.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class DCmp extends NodeComponent { - - private static final Logger LOG = LoggerFactory.getLogger(DCmp.class); - - @Override - public void process() { - if(1==1){ - int a = 1/0; - } - LOG.info("Dcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/exception/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/exception/cmp/ECmp.java deleted file mode 100644 index 693148818..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/exception/cmp/ECmp.java +++ /dev/null @@ -1,18 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.exception.cmp; - -import com.yomahub.liteflow.core.NodeSwitchComponent; - -public class ECmp extends NodeSwitchComponent { - - @Override - public String processSwitch() throws Exception { - return "a"; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/exception/cmp/FCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/exception/cmp/FCmp.java deleted file mode 100644 index ea6977b0b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/exception/cmp/FCmp.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.exception.cmp; - -import cn.hutool.core.util.StrUtil; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.test.exception.CustomStatefulException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class FCmp extends NodeComponent { - - private static final Logger LOG = LoggerFactory.getLogger(FCmp.class); - - @Override - public void process() { - String str = this.getRequestData(); - if(StrUtil.isNotBlank(str) && str.equals("custom-stateful-exception")) { - throw new CustomStatefulException("300", "chain execute custom stateful execption"); - } - LOG.info("Fcomp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/exception/cmp/GCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/exception/cmp/GCmp.java deleted file mode 100644 index c82a95238..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/exception/cmp/GCmp.java +++ /dev/null @@ -1,22 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.exception.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class GCmp extends NodeComponent { - - private static final Logger LOG = LoggerFactory.getLogger(GCmp.class); - - @Override - public void process() { - LOG.info("Gcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/execute2Future/Executor2FutureTest.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/execute2Future/Executor2FutureTest.java deleted file mode 100644 index 941351aa5..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/execute2Future/Executor2FutureTest.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.yomahub.liteflow.test.execute2Future; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.core.FlowExecutorHolder; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; -import java.util.concurrent.Future; - -/** - * nospring环境执行返回future的例子 - * @author Bryan.Zhang - * @since 2.6.13 - */ -public class Executor2FutureTest extends BaseTest { - - private static FlowExecutor flowExecutor; - - @BeforeClass - public static void init(){ - LiteflowConfig config = new LiteflowConfig(); - config.setRuleSource("execute2Future/flow.xml"); - flowExecutor = FlowExecutorHolder.loadInstance(config); - } - - @Test - public void testFuture() throws Exception{ - Future future = flowExecutor.execute2Future("chain1", "arg", DefaultContext.class); - LiteflowResponse response = future.get(); - Assert.assertTrue(response.isSuccess()); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/execute2Future/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/execute2Future/cmp/ACmp.java deleted file mode 100644 index bd4d7493e..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/execute2Future/cmp/ACmp.java +++ /dev/null @@ -1,18 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.execute2Future.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/execute2Future/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/execute2Future/cmp/CCmp.java deleted file mode 100644 index 9c18d7e49..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/execute2Future/cmp/CCmp.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.execute2Future.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/execute2Future/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/execute2Future/cmp/DCmp.java deleted file mode 100644 index 11edc94f3..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/execute2Future/cmp/DCmp.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.execute2Future.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class DCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/flowmeta/FlowMetaTest.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/flowmeta/FlowMetaTest.java deleted file mode 100644 index 3a2550e77..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/flowmeta/FlowMetaTest.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.yomahub.liteflow.test.flowmeta; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.core.FlowExecutorHolder; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.flow.FlowBus; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import com.yomahub.liteflow.test.flowmeta.cmp2.DCmp; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - -public class FlowMetaTest extends BaseTest { - - private static FlowExecutor flowExecutor; - - @BeforeClass - public static void init(){ - LiteflowConfig config = new LiteflowConfig(); - config.setRuleSource("flowmeta/flow.xml"); - config.setParseOnStart(false); - flowExecutor = FlowExecutorHolder.loadInstance(config); - } - - //测试动态添加元信息节点 - @Test - public void testFlowMeta() { - FlowBus.addCommonNode("d", "d组件", DCmp.class); - LiteflowResponse response= flowExecutor.execute2Resp("chain1", "it's a request"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a==>b==>c==>d[d组件]", response.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/flowmeta/cmp1/ACmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/flowmeta/cmp1/ACmp.java deleted file mode 100644 index a7d1fbe5f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/flowmeta/cmp1/ACmp.java +++ /dev/null @@ -1,18 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.flowmeta.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; - -public class ACmp extends NodeComponent { - - @Override - public void process() { - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/flowmeta/cmp1/BCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/flowmeta/cmp1/BCmp.java deleted file mode 100644 index 801fe1b80..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/flowmeta/cmp1/BCmp.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.flowmeta.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; - -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/flowmeta/cmp1/CCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/flowmeta/cmp1/CCmp.java deleted file mode 100644 index 8b7627e45..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/flowmeta/cmp1/CCmp.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.flowmeta.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; - -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/flowmeta/cmp2/DCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/flowmeta/cmp2/DCmp.java deleted file mode 100644 index 9ed261058..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/flowmeta/cmp2/DCmp.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.flowmeta.cmp2; - -import com.yomahub.liteflow.core.NodeComponent; - -public class DCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("Dcomp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/multipleType/LiteflowMultipleTypeTest.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/multipleType/LiteflowMultipleTypeTest.java deleted file mode 100644 index df6b12ec3..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/multipleType/LiteflowMultipleTypeTest.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.yomahub.liteflow.test.multipleType; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.core.FlowExecutorHolder; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * 测试非spring下混合格式规则的场景 - * @author Bryan.Zhang - * @since 2.5.10 - */ -public class LiteflowMultipleTypeTest extends BaseTest { - - private static FlowExecutor flowExecutor; - - @BeforeClass - public static void init(){ - LiteflowConfig config = new LiteflowConfig(); - config.setRuleSource("multipleType/flow.xml,multipleType/flow.yml"); - config.setSupportMultipleType(true); - flowExecutor = FlowExecutorHolder.loadInstance(config); - } - - @Test - public void testMultipleType() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a==>b==>c==>b==>a", response.getExecuteStepStr()); - response = flowExecutor.execute2Resp("chain3", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a==>b==>c", response.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/multipleType/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/multipleType/cmp/ACmp.java deleted file mode 100644 index a2080ed39..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/multipleType/cmp/ACmp.java +++ /dev/null @@ -1,18 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.multipleType.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/multipleType/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/multipleType/cmp/CCmp.java deleted file mode 100644 index 92a895217..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/multipleType/cmp/CCmp.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.multipleType.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/nodeExecutor/CustomerDefaultNodeExecutor.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/nodeExecutor/CustomerDefaultNodeExecutor.java deleted file mode 100644 index 0ced9da9f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/nodeExecutor/CustomerDefaultNodeExecutor.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.yomahub.liteflow.test.nodeExecutor; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DataBus; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; -import com.yomahub.liteflow.flow.executor.NodeExecutor; - -/** - * 自定义默认的节点执行器 - */ -public class CustomerDefaultNodeExecutor extends NodeExecutor { - @Override - public void execute(NodeComponent instance) throws Exception { - DefaultContext context = instance.getFirstContextBean(); - LOG.info("使用customerDefaultNodeExecutor进行执行"); - context.setData("customerDefaultNodeExecutor", this.getClass()); - super.execute(instance); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/nodeExecutor/CustomerNodeExecutor.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/nodeExecutor/CustomerNodeExecutor.java deleted file mode 100644 index 5a9f2e58d..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/nodeExecutor/CustomerNodeExecutor.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.yomahub.liteflow.test.nodeExecutor; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DataBus; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; -import com.yomahub.liteflow.flow.executor.NodeExecutor; - -/** - * 自定义节点执行器 - */ -public class CustomerNodeExecutor extends NodeExecutor { - @Override - public void execute(NodeComponent instance) throws Exception { - DefaultContext context = instance.getFirstContextBean(); - LOG.info("使用customerNodeExecutor进行执行"); - context.setData("customerNodeExecutor", this.getClass()); - super.execute(instance); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/nodeExecutor/CustomerNodeExecutorAndCustomRetry.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/nodeExecutor/CustomerNodeExecutorAndCustomRetry.java deleted file mode 100644 index 003d33319..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/nodeExecutor/CustomerNodeExecutorAndCustomRetry.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.yomahub.liteflow.test.nodeExecutor; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DataBus; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; -import com.yomahub.liteflow.flow.executor.NodeExecutor; - -import java.util.concurrent.TimeUnit; - -/** - * 自定义节点执行器 - */ -public class CustomerNodeExecutorAndCustomRetry extends NodeExecutor { - @Override - public void execute(NodeComponent instance) throws Exception { - DefaultContext context = instance.getFirstContextBean(); - LOG.info("使用customerNodeExecutorAndCustomRetry进行执行"); - context.setData("customerNodeExecutorAndCustomRetry", this.getClass()); - super.execute(instance); - } - - @Override - protected void retry(NodeComponent instance, int currentRetryCount) throws Exception { - TimeUnit.MICROSECONDS.sleep(20L); - DefaultContext context = instance.getFirstContextBean(); - context.setData("retryLogic", this.getClass()); - super.retry(instance, currentRetryCount); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/nodeExecutor/LiteflowNodeExecutorTest.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/nodeExecutor/LiteflowNodeExecutorTest.java deleted file mode 100644 index eaf99576c..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/nodeExecutor/LiteflowNodeExecutorTest.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.yomahub.liteflow.test.nodeExecutor; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.core.FlowExecutorHolder; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - - -/** - * 测试非spring环境下的自定义组件执行器 - * @author Bryan.Zhang - * @since 2.5.10 - */ -public class LiteflowNodeExecutorTest extends BaseTest { - - private static FlowExecutor flowExecutor; - - @BeforeClass - public static void init(){ - LiteflowConfig config = new LiteflowConfig(); - config.setRuleSource("nodeExecutor/flow.xml"); - config.setRetryCount(3); - config.setSlotSize(512); - config.setNodeExecutorClass("com.yomahub.liteflow.test.nodeExecutor.CustomerDefaultNodeExecutor"); - flowExecutor = FlowExecutorHolder.loadInstance(config); - } - - // 默认执行器测试 - @Test - public void testCustomerDefaultNodeExecutor() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals(CustomerDefaultNodeExecutor.class, context.getData("customerDefaultNodeExecutor")); - Assert.assertEquals("a", response.getExecuteStepStr()); - } - - //默认执行器测试+全局重试配置测试 - @Test - public void testDefaultExecutorForRetry() { - LiteflowResponse response = flowExecutor.execute2Resp("chain2", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals(CustomerDefaultNodeExecutor.class, context.getData("customerDefaultNodeExecutor")); - Assert.assertEquals("b==>b==>b", response.getExecuteStepStr()); - } - - //自定义执行器测试 - @Test - public void testCustomerExecutor() { - LiteflowResponse response = flowExecutor.execute2Resp("chain3", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("c", response.getExecuteStepStr()); - } - - //自定义执行器测试+全局重试配置测试 - @Test - public void testCustomExecutorForRetry() { - LiteflowResponse response = flowExecutor.execute2Resp("chain4", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertFalse(response.isSuccess()); - Assert.assertEquals(CustomerNodeExecutorAndCustomRetry.class, context.getData("retryLogic")); - Assert.assertEquals("d==>d==>d==>d==>d==>d", response.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/nodeExecutor/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/nodeExecutor/cmp/ACmp.java deleted file mode 100644 index 1396310b8..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/nodeExecutor/cmp/ACmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.nodeExecutor.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class BCmp extends NodeComponent { - - private int flag = 0; - - @Override - public void process() { - System.out.println("BCmp executed!"); - if (flag < 2){ - flag++; - throw new RuntimeException("demo exception"); - } - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/nodeExecutor/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/nodeExecutor/cmp/CCmp.java deleted file mode 100644 index 688c54d10..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/nodeExecutor/cmp/CCmp.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.nodeExecutor.cmp; - -import com.yomahub.liteflow.annotation.LiteflowRetry; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.flow.executor.NodeExecutor; -import com.yomahub.liteflow.test.nodeExecutor.CustomerNodeExecutor; - -@LiteflowRetry(5) -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - - @Override - public Class getNodeExecutorClass() { - return CustomerNodeExecutor.class; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/nodeExecutor/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/nodeExecutor/cmp/DCmp.java deleted file mode 100644 index 00ca11e43..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/nodeExecutor/cmp/DCmp.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * - * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.nodeExecutor.cmp; - -import com.yomahub.liteflow.annotation.LiteflowRetry; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.flow.executor.NodeExecutor; -import com.yomahub.liteflow.test.nodeExecutor.CustomerNodeExecutorAndCustomRetry; - -@LiteflowRetry(retry = 5, forExceptions = {NullPointerException.class}) -public class DCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("DCmp executed!"); - throw new NullPointerException("demo exception"); - } - - @Override - public Class getNodeExecutorClass() { - return CustomerNodeExecutorAndCustomRetry.class; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/nullParam/NullParamTest.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/nullParam/NullParamTest.java deleted file mode 100644 index cf1f6c6f7..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/nullParam/NullParamTest.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.yomahub.liteflow.test.nullParam; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.core.FlowExecutorHolder; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.slot.DefaultContext; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * 单元测试:传递null param导致NPE的优化代码 - * - * @author LeoLee - * @since 2.6.6 - */ -public class NullParamTest { - - private static FlowExecutor flowExecutor; - - @BeforeClass - public static void init(){ - LiteflowConfig config = new LiteflowConfig(); - config.setRuleSource("nullParam/flow.xml"); - flowExecutor = FlowExecutorHolder.loadInstance(config); - } - - /** - * 支持无参的flow执行,以及param 为null时的异常抛出 - */ - @Test - public void testNullParam() throws Exception { - LiteflowResponse response = flowExecutor.execute2Resp("chain1"); - Assert.assertTrue(response.isSuccess()); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/nullParam/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/nullParam/cmp/ACmp.java deleted file mode 100644 index 4c29cc070..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/nullParam/cmp/ACmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.nullParam.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class ACmp extends NodeComponent { - - @Override - public void process() { - System.out.println("ACmp executed!"); - System.out.println("get request data:" + this.getRequestData()); - this.getSlot().setInput("BCmp", "param for BCmp"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/nullParam/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/nullParam/cmp/BCmp.java deleted file mode 100644 index 4f6010a9c..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/nullParam/cmp/BCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.nullParam.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BCmp executed!"); - System.out.println("BCmp param:" + this.getSlot().getInput("BCmp")); - this.getSlot().setOutput("CCmp", "param for CCmp"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/nullParam/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/nullParam/cmp/CCmp.java deleted file mode 100644 index 9c94b3b18..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/nullParam/cmp/CCmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.nullParam.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - System.out.println("CCmp param:" + this.getSlot().getOutput("CCmp")); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomParserJsonTest.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomParserJsonTest.java deleted file mode 100644 index 24b855433..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomParserJsonTest.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.yomahub.liteflow.test.parsecustom; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.core.FlowExecutorHolder; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * 非spring环境的自定义json parser单元测试 - * @author dongguo.tao - * @since 2.5.0 - */ -public class CustomParserJsonTest extends BaseTest { - - private static FlowExecutor flowExecutor; - - @BeforeClass - public static void init(){ - LiteflowConfig config = new LiteflowConfig(); - config.setRuleSource("com.yomahub.liteflow.test.parsecustom.parser.CustomJsonFlowParser"); - flowExecutor = FlowExecutorHolder.loadInstance(config); - } - - //测试非spring场景的自定义json parser - @Test - public void testJsonCustomParser() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "args"); - Assert.assertTrue(response.isSuccess()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomParserXmlTest.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomParserXmlTest.java deleted file mode 100644 index eb1c0ba09..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomParserXmlTest.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.yomahub.liteflow.test.parsecustom; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.core.FlowExecutorHolder; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * 非spring环境的自定义xml parser单元测试 - * @author bryan.zhang - * @since 2.5.7 - */ -public class CustomParserXmlTest extends BaseTest { - - private static FlowExecutor flowExecutor; - - @BeforeClass - public static void init(){ - LiteflowConfig config = new LiteflowConfig(); - config.setRuleSource("com.yomahub.liteflow.test.parsecustom.parser.CustomXmlFlowParser"); - flowExecutor = FlowExecutorHolder.loadInstance(config); - } - - //测试非spring场景的自定义json parser - @Test - public void testXmlCustomParser() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "args"); - Assert.assertTrue(response.isSuccess()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/ACmp.java deleted file mode 100644 index e3e6d44ac..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/ACmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.parsecustom.cmp; - -import cn.hutool.core.util.StrUtil; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.exception.FlowSystemException; - -public class ACmp extends NodeComponent { - - @Override - public void process() { - String str = this.getRequestData(); - if(StrUtil.isNotBlank(str) && str.equals("exception")) { - throw new FlowSystemException("chain execute execption"); - } - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/BCmp.java deleted file mode 100644 index e2174159d..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/BCmp.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.parsecustom.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/DCmp.java deleted file mode 100644 index 44f7a4251..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/DCmp.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.parsecustom.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class DCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("DCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/ECmp.java deleted file mode 100644 index 41b930228..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/ECmp.java +++ /dev/null @@ -1,18 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.parsecustom.cmp; - -import com.yomahub.liteflow.core.NodeSwitchComponent; - -public class ECmp extends NodeSwitchComponent { - - @Override - public String processSwitch() throws Exception { - return "g"; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/FCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/FCmp.java deleted file mode 100644 index 39c7035dc..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/FCmp.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.parsecustom.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class FCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("FCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/GCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/GCmp.java deleted file mode 100644 index 1251628ac..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/GCmp.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.parsecustom.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class GCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("GCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parsecustom/parser/CustomJsonFlowParser.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parsecustom/parser/CustomJsonFlowParser.java deleted file mode 100644 index d8308c32a..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parsecustom/parser/CustomJsonFlowParser.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.yomahub.liteflow.test.parsecustom.parser; - -import com.yomahub.liteflow.parser.ClassJsonFlowParser; - -/** - * 模拟用户自定义源解析 - * @author dongguo.tao - * @since 2.5.0 - */ -public class CustomJsonFlowParser extends ClassJsonFlowParser { - @Override - public String parseCustom() { - //模拟自定义解析结果 - return "{\"flow\":{\"nodes\":{\"node\":[{\"id\":\"a\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.ACmp\"},{\"id\":\"b\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.BCmp\"},{\"id\":\"c\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.CCmp\"},{\"id\":\"d\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.DCmp\"},{\"id\":\"e\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.ECmp\"},{\"id\":\"f\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.FCmp\"},{\"id\":\"g\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.GCmp\"}]},\"chain\":[{\"name\":\"chain2\",\"condition\":[{\"type\":\"then\",\"value\":\"c,g,f\"}]},{\"name\":\"chain1\",\"condition\":[{\"type\":\"then\",\"value\":\"a,c\"},{\"type\":\"when\",\"value\":\"b,d,e(f|g)\"},{\"type\":\"then\",\"value\":\"chain2\"}]}]}}"; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parsecustom/parser/CustomXmlFlowParser.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parsecustom/parser/CustomXmlFlowParser.java deleted file mode 100644 index 0c305e579..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parsecustom/parser/CustomXmlFlowParser.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.yomahub.liteflow.test.parsecustom.parser; - -import com.yomahub.liteflow.parser.ClassXmlFlowParser; - -/** - * 非spring环境的自定义xml parser单元测试 - * 主要测试自定义配置源类是否能引入非spring中的其他依赖 - * @author bryan.zhang - * @since 2.5.7 - */ -public class CustomXmlFlowParser extends ClassXmlFlowParser { - - @Override - public String parseCustom() { - return ""; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parser/JsonParserTest.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parser/JsonParserTest.java deleted file mode 100644 index f390e3b97..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parser/JsonParserTest.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.yomahub.liteflow.test.parser; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.core.FlowExecutorHolder; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * 非spring环境的json parser单元测试 - * @author Bryan.Zhang - * @since 2.5.0 - */ -public class JsonParserTest extends BaseTest { - - private static FlowExecutor flowExecutor; - - @BeforeClass - public static void init(){ - LiteflowConfig config = new LiteflowConfig(); - config.setRuleSource("parser/flow.json"); - flowExecutor = FlowExecutorHolder.loadInstance(config); - } - - //测试spring场景的json parser - @Test - public void testJsonParser() { - LiteflowResponse response = flowExecutor.execute2Resp("chain2", "arg"); - Assert.assertTrue(response.isSuccess()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parser/XmlParserTest.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parser/XmlParserTest.java deleted file mode 100644 index 07f13e50f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parser/XmlParserTest.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.yomahub.liteflow.test.parser; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.core.FlowExecutorHolder; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * 非spring环境的xml parser单元测试 - * @author Bryan.Zhang - * @since 2.5.0 - */ -public class XmlParserTest extends BaseTest { - - private static FlowExecutor flowExecutor; - - @BeforeClass - public static void init(){ - LiteflowConfig config = new LiteflowConfig(); - config.setRuleSource("parser/flow.xml"); - flowExecutor = FlowExecutorHolder.loadInstance(config); - } - - //测试无spring场景的xml parser - @Test - public void testXmlParser() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parser/YmlParserTest.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parser/YmlParserTest.java deleted file mode 100644 index cc744c045..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parser/YmlParserTest.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.yomahub.liteflow.test.parser; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.core.FlowExecutorHolder; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * 非spring下的yml parser测试用例 - * @author Bryan.Zhang - * @since 2.5.0 - */ -public class YmlParserTest extends BaseTest { - - private static FlowExecutor flowExecutor; - - @BeforeClass - public static void init(){ - LiteflowConfig config = new LiteflowConfig(); - config.setRuleSource("parser/flow.yml"); - flowExecutor = FlowExecutorHolder.loadInstance(config); - } - - //测试无spring场景的yml parser - @Test - public void testYmlParser() { - LiteflowResponse response = flowExecutor.execute2Resp("chain2", "arg"); - Assert.assertTrue(response.isSuccess()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parser/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parser/cmp/ACmp.java deleted file mode 100644 index 11b12cddf..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parser/cmp/ACmp.java +++ /dev/null @@ -1,18 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.parser.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parser/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parser/cmp/CCmp.java deleted file mode 100644 index 382d9d040..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parser/cmp/CCmp.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.parser.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parser/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parser/cmp/DCmp.java deleted file mode 100644 index 8842e67b5..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parser/cmp/DCmp.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.parser.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class DCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("DCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parser/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parser/cmp/ECmp.java deleted file mode 100644 index ca04a9bde..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parser/cmp/ECmp.java +++ /dev/null @@ -1,18 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.parser.cmp; - -import com.yomahub.liteflow.core.NodeSwitchComponent; - -public class ECmp extends NodeSwitchComponent { - - @Override - public String processSwitch() throws Exception { - return "g"; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parser/cmp/FCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parser/cmp/FCmp.java deleted file mode 100644 index 1eb8f59a8..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parser/cmp/FCmp.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.parser.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class FCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("FCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parser/cmp/GCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parser/cmp/GCmp.java deleted file mode 100644 index c607c5ada..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/parser/cmp/GCmp.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.parser.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class GCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("GCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/preAndFinally/PreAndFinallyTest.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/preAndFinally/PreAndFinallyTest.java deleted file mode 100644 index 95f3a71bf..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/preAndFinally/PreAndFinallyTest.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.yomahub.liteflow.test.preAndFinally; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.core.FlowExecutorHolder; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * 非spring环境下pre节点和finally节点的测试 - * @author Bryan.Zhang - * @since 2.6.4 - */ -public class PreAndFinallyTest extends BaseTest { - - private static FlowExecutor flowExecutor; - - @BeforeClass - public static void init(){ - LiteflowConfig config = new LiteflowConfig(); - config.setRuleSource("preAndFinally/flow.xml"); - flowExecutor = FlowExecutorHolder.loadInstance(config); - } - - //测试普通的pre和finally节点 - @Test - public void testPreAndFinally1() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("p1==>p2==>a==>b==>c==>f1==>f2",response.getExecuteStepStr()); - } - - //测试pre和finally节点不放在开头和结尾的情况 - @Test - public void testPreAndFinally2() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain2", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("p1==>p2==>a==>b==>c==>f1==>f2",response.getExecuteStepStr()); - } - - //测试有节点报错是否还执行finally节点的情况,其中d节点会报错,但依旧执行f1,f2节点 - @Test - public void testPreAndFinally3() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain3", "arg"); - Assert.assertFalse(response.isSuccess()); - Assert.assertEquals("p1==>p2==>a==>d==>f1==>f2", response.getExecuteStepStr()); - } - - //测试在finally节点里是否能获取exception - @Test - public void testPreAndFinally4() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain4", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertFalse(response.isSuccess()); - Assert.assertTrue(context.getData("hasEx")); - } - - @Test - public void testPreAndFinally5() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain5", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("p1==>p2==>p1==>p2==>a==>b==>c==>f1==>f2==>f1", response.getExecuteStepStrWithoutTime()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/ACmp.java deleted file mode 100644 index 704212d7e..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/ACmp.java +++ /dev/null @@ -1,18 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

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

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.preAndFinally.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class DCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - int i = 1/0; - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Finally1Cmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Finally1Cmp.java deleted file mode 100644 index 22b2322d4..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Finally1Cmp.java +++ /dev/null @@ -1,18 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.preAndFinally.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class Finally1Cmp extends NodeComponent { - - @Override - public void process() { - System.out.println("Finally1Cmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Finally2Cmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Finally2Cmp.java deleted file mode 100644 index e156a0752..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Finally2Cmp.java +++ /dev/null @@ -1,18 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.preAndFinally.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class Finally2Cmp extends NodeComponent { - - @Override - public void process() { - System.out.println("Finally2Cmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Finally3Cmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Finally3Cmp.java deleted file mode 100644 index 8777c80b7..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Finally3Cmp.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.preAndFinally.cmp; - -import cn.hutool.core.util.ObjectUtil; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; - -public class Finally3Cmp extends NodeComponent { - - @Override - public void process() throws Exception{ - Slot slot = this.getSlot(); - DefaultContext context = slot.getFirstContextBean(); - if (ObjectUtil.isNull(slot.getException())){ - context.setData("hasEx", false); - }else{ - context.setData("hasEx", true); - } - System.out.println("Finally3Cmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Pre1Cmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Pre1Cmp.java deleted file mode 100644 index 8b6b430d8..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Pre1Cmp.java +++ /dev/null @@ -1,18 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.preAndFinally.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class Pre1Cmp extends NodeComponent { - - @Override - public void process() { - System.out.println("Pre1Cmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Pre2Cmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Pre2Cmp.java deleted file mode 100644 index 263c15271..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Pre2Cmp.java +++ /dev/null @@ -1,18 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.preAndFinally.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class Pre2Cmp extends NodeComponent { - - @Override - public void process() { - System.out.println("Pre2Cmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/privateDelivery/PrivateDeliveryTest.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/privateDelivery/PrivateDeliveryTest.java deleted file mode 100644 index 671e0b333..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/privateDelivery/PrivateDeliveryTest.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.yomahub.liteflow.test.privateDelivery; - -import cn.hutool.core.collection.ConcurrentHashSet; -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.core.FlowExecutorHolder; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; -import java.util.Set; - -/** - * 非spring环境下隐私投递的测试 - * @author Bryan.Zhang - * @since 2.5.0 - */ -public class PrivateDeliveryTest extends BaseTest { - - private static FlowExecutor flowExecutor; - - @BeforeClass - public static void init(){ - LiteflowConfig config = new LiteflowConfig(); - config.setRuleSource("privateDelivery/flow.xml"); - flowExecutor = FlowExecutorHolder.loadInstance(config); - } - - @Test - public void testPrivateDelivery() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - DefaultContext context = response.getFirstContextBean(); - ConcurrentHashSet set = context.getData("testSet"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals(100, set.size()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/privateDelivery/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/privateDelivery/cmp/ACmp.java deleted file mode 100644 index 17227a258..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/privateDelivery/cmp/ACmp.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.privateDelivery.cmp; - -import cn.hutool.core.collection.ConcurrentHashSet; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; - -import java.util.HashSet; - -public class ACmp extends NodeComponent { - - @Override - public void process() { - System.out.println("ACmp executed!"); - DefaultContext context = this.getFirstContextBean(); - context.setData("testSet", new ConcurrentHashSet<>()); - - for (int i = 0; i < 100; i++) { - this.sendPrivateDeliveryData("b",i+1); - } - } -} - diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/privateDelivery/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/privateDelivery/cmp/BCmp.java deleted file mode 100644 index fe0edd88d..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/privateDelivery/cmp/BCmp.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.privateDelivery.cmp; - -import cn.hutool.core.collection.ConcurrentHashSet; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; - -import java.util.Set; - -public class BCmp extends NodeComponent { - - @Override - public void process() { - DefaultContext context = this.getFirstContextBean(); - System.out.println("BCmp executed!"); - Integer value = this.getPrivateDeliveryData(); - ConcurrentHashSet testSet = context.getData("testSet"); - testSet.add(value); - } -} - diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/privateDelivery/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/privateDelivery/cmp/CCmp.java deleted file mode 100644 index 20ab1cd87..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/privateDelivery/cmp/CCmp.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.privateDelivery.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class DCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/refreshRule/RefreshRuleTest.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/refreshRule/RefreshRuleTest.java deleted file mode 100644 index 3eacfe864..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/refreshRule/RefreshRuleTest.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.yomahub.liteflow.test.refreshRule; - -import cn.hutool.core.io.resource.ResourceUtil; -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.core.FlowExecutorHolder; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.enums.FlowParserTypeEnum; -import com.yomahub.liteflow.flow.FlowBus; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * 非spring环境下重新加载规则测试 - * @author Bryan.Zhang - * @since 2.6.4 - */ -public class RefreshRuleTest extends BaseTest { - - private static FlowExecutor flowExecutor; - - @BeforeClass - public static void init(){ - LiteflowConfig config = new LiteflowConfig(); - config.setRuleSource("refreshRule/flow.xml"); - flowExecutor = FlowExecutorHolder.loadInstance(config); - } - - //测试普通刷新流程的场景 - @Test - public void testRefresh1() throws Exception{ - String content = ResourceUtil.readUtf8Str("classpath: /refreshRule/flow_update.xml"); - FlowBus.refreshFlowMetaData(FlowParserTypeEnum.TYPE_XML, content); - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - } - - //测试优雅刷新的场景 - @Test - public void testRefresh2() throws Exception{ - new Thread(() -> { - try { - Thread.sleep(4000L); - String content = ResourceUtil.readUtf8Str("classpath: /refreshRule/flow_update.xml"); - FlowBus.refreshFlowMetaData(FlowParserTypeEnum.TYPE_XML, content); - } catch (Exception e) { - e.printStackTrace(); - } - - }).start(); - - for (int i = 0; i < 500; i++) { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - try { - Thread.sleep(10L); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/refreshRule/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/refreshRule/cmp/ACmp.java deleted file mode 100644 index 7b6cc9eb5..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/refreshRule/cmp/ACmp.java +++ /dev/null @@ -1,18 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.refreshRule.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/reload/ReloadTest.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/reload/ReloadTest.java deleted file mode 100644 index cbb54758c..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/reload/ReloadTest.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.yomahub.liteflow.test.reload; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.core.FlowExecutorHolder; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * 非spring环境下重新加载规则测试 - * @author Bryan.Zhang - * @since 2.5.0 - */ -public class ReloadTest extends BaseTest { - - private static FlowExecutor flowExecutor; - - @BeforeClass - public static void init(){ - LiteflowConfig config = new LiteflowConfig(); - config.setRuleSource("reload/flow.xml"); - flowExecutor = FlowExecutorHolder.loadInstance(config); - } - - //用reloadRule去重新加载,这里如果配置是放在本地。如果想修改,则要去修改target下面的flow.xml - //这里的测试,手动打断点然后去修改,是ok的。但是整个测试,暂且只是为了测试这个功能是否能正常运行 - @Test - public void testReload() throws Exception{ - flowExecutor.reloadRule(); - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/reload/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/reload/cmp/ACmp.java deleted file mode 100644 index b51731a85..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/reload/cmp/ACmp.java +++ /dev/null @@ -1,18 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.reload.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/removeChain/RemoveChainTest.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/removeChain/RemoveChainTest.java deleted file mode 100644 index 8fc9ce58d..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/removeChain/RemoveChainTest.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.yomahub.liteflow.test.removeChain; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.core.FlowExecutorHolder; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.flow.FlowBus; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - -public class RemoveChainTest extends BaseTest{ - - private static FlowExecutor flowExecutor; - - @BeforeClass - public static void init(){ - LiteflowConfig config = new LiteflowConfig(); - config.setRuleSource("removeChain/flow.xml"); - flowExecutor = FlowExecutorHolder.loadInstance(config); - } - - @Test - public void testRemoveChain(){ - LiteflowResponse response1 = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response1.isSuccess()); - FlowBus.removeChain("chain1"); - LiteflowResponse response2 = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertFalse(response2.isSuccess()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/removeChain/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/removeChain/cmp/ACmp.java deleted file mode 100644 index a193745c4..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/removeChain/cmp/ACmp.java +++ /dev/null @@ -1,18 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

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

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.removeChain.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class DCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/requestId/LiteflowRequestIdSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/requestId/LiteflowRequestIdSpringbootTest.java deleted file mode 100644 index 63870c5ec..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/requestId/LiteflowRequestIdSpringbootTest.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.yomahub.liteflow.test.requestId; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.core.FlowExecutorHolder; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * @author tangkc - */ -public class LiteflowRequestIdSpringbootTest extends BaseTest { - - private static FlowExecutor flowExecutor; - - @BeforeClass - public static void init(){ - LiteflowConfig config = new LiteflowConfig(); - config.setRuleSource("requestId/flow.xml"); - config.setRequestIdGeneratorClass("com.yomahub.liteflow.test.requestId.config.CustomRequestIdGenerator"); - flowExecutor = FlowExecutorHolder.loadInstance(config); - } - - @Test - public void testRequestId() throws Exception { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("1", response.getSlot().getRequestId()); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/requestId/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/requestId/cmp/ACmp.java deleted file mode 100644 index 9d5a4c1b9..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/requestId/cmp/ACmp.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.yomahub.liteflow.test.requestId.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - - -public class ACmp extends NodeComponent { - - @Override - public void process() { - System.out.println("AComp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/requestId/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/requestId/cmp/BCmp.java deleted file mode 100644 index 2620d8f2c..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/requestId/cmp/BCmp.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.yomahub.liteflow.test.requestId.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - - -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BComp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/requestId/config/CustomRequestIdGenerator.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/requestId/config/CustomRequestIdGenerator.java deleted file mode 100644 index fcaa9e84b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/requestId/config/CustomRequestIdGenerator.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.yomahub.liteflow.test.requestId.config; - -import com.yomahub.liteflow.flow.id.RequestIdGenerator; - -import java.util.concurrent.atomic.AtomicInteger; - -/** - * @author tangkc - */ -public class CustomRequestIdGenerator implements RequestIdGenerator { - - private final AtomicInteger atomicInteger = new AtomicInteger(0); - - @Override - public String generate() { - return atomicInteger.incrementAndGet() + ""; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/resizeSlot/ResizeSlotTest.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/resizeSlot/ResizeSlotTest.java deleted file mode 100644 index c844dc2cb..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/resizeSlot/ResizeSlotTest.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.yomahub.liteflow.test.resizeSlot; - -import cn.hutool.core.util.ReflectUtil; -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.core.FlowExecutorHolder; -import com.yomahub.liteflow.slot.DataBus; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; -import java.lang.reflect.Field; -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.ConcurrentLinkedQueue; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.Future; - -/** - * 非spring环境下slot扩容测试 - * @author Bryan.Zhang - * @since 2.5.0 - */ -public class ResizeSlotTest extends BaseTest { - - private static FlowExecutor flowExecutor; - - @BeforeClass - public static void init(){ - LiteflowConfig config = new LiteflowConfig(); - config.setRuleSource("resizeSlot/flow.xml"); - config.setSlotSize(4); - flowExecutor = FlowExecutorHolder.loadInstance(config); - } - - @Test - public void testResize() throws Exception{ - try{ - ExecutorService pool = Executors.newCachedThreadPool(); - - List> futureList = new ArrayList<>(); - for (int i = 0; i < 100; i++) { - Future future = pool.submit(() -> flowExecutor.execute2Resp("chain1", "arg")); - futureList.add(future); - } - - for(Future future : futureList){ - Assert.assertTrue(future.get().isSuccess()); - } - - //取到static的对象QUEUE - Field field = ReflectUtil.getField(DataBus.class, "QUEUE"); - ConcurrentLinkedQueue queue = (ConcurrentLinkedQueue) ReflectUtil.getStaticFieldValue(field); - - //因为初始slotSize是4,按照0.75的扩容比,要满足100个线程,应该扩容5~6次,5次=65,6次=114 - //为什么不是直接114呢? - //因为在单测中根据机器的性能,在多线程情况下,有些机器跑的慢一点,也就是说65个就足够了。有些机器跑的快一点,是能真正扩容到114个的 - Assert.assertTrue(queue.size() > 4); - }catch (Exception e){ - e.printStackTrace(); - } - - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/resizeSlot/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/resizeSlot/cmp/ACmp.java deleted file mode 100644 index f2dd79317..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/resizeSlot/cmp/ACmp.java +++ /dev/null @@ -1,18 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.resizeSlot.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/resizeSlot/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/resizeSlot/cmp/CCmp.java deleted file mode 100644 index 48a4c2ca4..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/resizeSlot/cmp/CCmp.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.resizeSlot.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/subflow/ImplicitSubFlowTest.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/subflow/ImplicitSubFlowTest.java deleted file mode 100644 index 85ee4cbbb..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/subflow/ImplicitSubFlowTest.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.yomahub.liteflow.test.subflow; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.core.FlowExecutorHolder; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; -import java.util.HashSet; -import java.util.Set; - -/** - * 测试隐式调用子流程 - * 单元测试 - * - * @author justin.xu - */ -public class ImplicitSubFlowTest extends BaseTest { - - private static FlowExecutor flowExecutor; - - @BeforeClass - public static void init(){ - LiteflowConfig config = new LiteflowConfig(); - config.setRuleSource("subflow/flow-implicit.xml"); - flowExecutor = FlowExecutorHolder.loadInstance(config); - } - - public static final Set RUN_TIME_SLOT = new HashSet<>(); - - //这里GCmp中隐式的调用chain4,从而执行了h,m - @Test - public void testImplicitSubFlow() { - LiteflowResponse response = flowExecutor.execute2Resp("chain3", "it's a request"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("f==>g==>h==>m", response.getExecuteStepStr()); - - // 传递了slotIndex,则set的size==1 - Assert.assertEquals(1, RUN_TIME_SLOT.size()); - // set中第一次设置的requestId和response中的requestId一致 - Assert.assertTrue(RUN_TIME_SLOT.contains(response.getSlot().getRequestId())); - //requestData的取值正确 - Assert.assertEquals("it's implicit subflow.", context.getData("innerRequest")); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/subflow/SubflowInDifferentConfigTest.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/subflow/SubflowInDifferentConfigTest.java deleted file mode 100644 index e1dd0cf46..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/subflow/SubflowInDifferentConfigTest.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.yomahub.liteflow.test.subflow; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.core.FlowExecutorHolder; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.exception.MultipleParsersException; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.property.LiteflowConfigGetter; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * 测试主流程与子流程在不同的配置文件的场景 - * - * @author Bryan.Zhang - */ -public class SubflowInDifferentConfigTest extends BaseTest { - - private static FlowExecutor flowExecutor; - - @BeforeClass - public static void init(){ - LiteflowConfig config = new LiteflowConfig(); - config.setRuleSource("subflow/flow-main.xml,subflow/flow-sub1.xml,subflow/flow-sub2.xml"); - flowExecutor = FlowExecutorHolder.loadInstance(config); - } - - //是否按照流程定义配置执行 - @Test - public void testExplicitSubFlow1() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "it's a request"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a==>b==>b==>a==>e==>d", response.getExecuteStepStr()); - } - - //主要测试有不同的配置类型后会不会报出既定的错误 - @Test(expected = MultipleParsersException.class) - public void testExplicitSubFlow2() { - LiteflowConfig config = LiteflowConfigGetter.get(); - config.setRuleSource("subflow/flow-main.xml,subflow/flow-sub1.xml,subflow/flow-sub2.yml"); - flowExecutor.init(); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/subflow/SubflowJsonTest.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/subflow/SubflowJsonTest.java deleted file mode 100644 index 27ee26a7e..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/subflow/SubflowJsonTest.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.yomahub.liteflow.test.subflow; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.core.FlowExecutorHolder; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * 测试显示调用子流程(json) - * 单元测试 - * - * @author justin.xu - */ -public class SubflowJsonTest extends BaseTest { - - private static FlowExecutor flowExecutor; - - @BeforeClass - public static void init(){ - LiteflowConfig config = new LiteflowConfig(); - config.setRuleSource("subflow/flow.json"); - flowExecutor = FlowExecutorHolder.loadInstance(config); - } - - //是否按照流程定义配置执行 - @Test - public void testExplicitSubFlow() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "it's a request"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a==>b==>c==>b==>a==>e==>d", response.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/subflow/SubflowXMLTest.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/subflow/SubflowXMLTest.java deleted file mode 100644 index b8a0a2ca9..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/subflow/SubflowXMLTest.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.yomahub.liteflow.test.subflow; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.core.FlowExecutorHolder; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * 测试显示调用子流程(xml) - * 单元测试 - * - * @author justin.xu - */ -public class SubflowXMLTest extends BaseTest { - - private static FlowExecutor flowExecutor; - - @BeforeClass - public static void init(){ - LiteflowConfig config = new LiteflowConfig(); - config.setRuleSource("subflow/flow.xml"); - flowExecutor = FlowExecutorHolder.loadInstance(config); - } - - //是否按照流程定义配置执行 - @Test - public void testExplicitSubFlow() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "it's a request"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a==>b==>c==>b==>a==>e==>d", response.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/subflow/SubflowYmlTest.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/subflow/SubflowYmlTest.java deleted file mode 100644 index 12bb28aae..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/subflow/SubflowYmlTest.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.yomahub.liteflow.test.subflow; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.core.FlowExecutorHolder; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * 测试显示调用子流程(yml) - * 单元测试 - * - * @author justin.xu - */ -public class SubflowYmlTest extends BaseTest { - - private static FlowExecutor flowExecutor; - - @BeforeClass - public static void init(){ - LiteflowConfig config = new LiteflowConfig(); - config.setRuleSource("subflow/flow.yml"); - flowExecutor = FlowExecutorHolder.loadInstance(config); - } - - //是否按照流程定义配置执行 - @Test - public void testExplicitSubFlowYml() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "it's a request"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a==>b==>c==>b==>a==>e==>d", response.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/ACmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/ACmp.java deleted file mode 100644 index fd299fae4..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/ACmp.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.yomahub.liteflow.test.subflow.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; - - -public class ACmp extends NodeComponent { - @Override - public void process() { - System.out.println("Acomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/BCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/BCmp.java deleted file mode 100644 index 36613aedc..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/BCmp.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.yomahub.liteflow.test.subflow.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; - -public class BCmp extends NodeComponent { - @Override - public void process() { - System.out.println("Bcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/CCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/CCmp.java deleted file mode 100644 index 1a95b17c0..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/CCmp.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.yomahub.liteflow.test.subflow.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; - -public class CCmp extends NodeComponent { - @Override - public void process() throws Exception { - System.out.println("Ccomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/DCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/DCmp.java deleted file mode 100644 index 0a954b4f5..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/DCmp.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.yomahub.liteflow.test.subflow.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; - -public class DCmp extends NodeComponent { - @Override - public void process() throws Exception { - System.out.println("Dcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/ECmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/ECmp.java deleted file mode 100644 index 07789037f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/ECmp.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.yomahub.liteflow.test.subflow.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; - -public class ECmp extends NodeComponent { - - @Override - public void process() throws Exception { - System.out.println("Ecomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/FCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/FCmp.java deleted file mode 100644 index 616a1c24c..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/FCmp.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.yomahub.liteflow.test.subflow.cmp2; - -import com.yomahub.liteflow.core.NodeComponent; -import static com.yomahub.liteflow.test.subflow.ImplicitSubFlowTest.RUN_TIME_SLOT; - - -public class FCmp extends NodeComponent { - @Override - public void process() throws Exception { - - RUN_TIME_SLOT.add(this.getSlot().getRequestId()); - - System.out.println("Fcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/GCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/GCmp.java deleted file mode 100644 index d4bb36882..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/GCmp.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.yomahub.liteflow.test.subflow.cmp2; -import com.yomahub.liteflow.core.NodeComponent; - -import static com.yomahub.liteflow.test.subflow.ImplicitSubFlowTest.RUN_TIME_SLOT; - - -public class GCmp extends NodeComponent { - - @Override - public void process() throws Exception { - - RUN_TIME_SLOT.add(this.getSlot().getRequestId()); - - System.out.println("Gcmp executed!"); - - this.invoke("chain4", "it's implicit subflow."); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/HCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/HCmp.java deleted file mode 100644 index 2a727d471..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/HCmp.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.yomahub.liteflow.test.subflow.cmp2; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; - -import static com.yomahub.liteflow.test.subflow.ImplicitSubFlowTest.RUN_TIME_SLOT; - - -public class HCmp extends NodeComponent { - @Override - public void process() throws Exception { - String requestData = this.getSubChainReqData(); - DefaultContext context = this.getFirstContextBean(); - context.setData("innerRequest", requestData); - - RUN_TIME_SLOT.add(this.getSlot().getRequestId()); - - System.out.println("Hcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/MCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/MCmp.java deleted file mode 100644 index 735a8e233..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/MCmp.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.yomahub.liteflow.test.subflow.cmp2; - -import com.yomahub.liteflow.core.NodeComponent; -import static com.yomahub.liteflow.test.subflow.ImplicitSubFlowTest.RUN_TIME_SLOT; - - -public class MCmp extends NodeComponent { - @Override - public void process() throws Exception { - - RUN_TIME_SLOT.add(this.getSlot().getRequestId()); - - System.out.println("Mcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/tag/NodeTagJsonTest.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/tag/NodeTagJsonTest.java deleted file mode 100644 index 18b101e34..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/tag/NodeTagJsonTest.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.yomahub.liteflow.test.tag; - -import cn.hutool.core.collection.ConcurrentHashSet; -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.core.FlowExecutorHolder; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * 非spring环境下组件标签的测试 - * @author Bryan.Zhang - * @since 2.5.0 - */ -public class NodeTagJsonTest extends BaseTest { - - private static FlowExecutor flowExecutor; - - @BeforeClass - public static void init(){ - LiteflowConfig config = new LiteflowConfig(); - config.setRuleSource("tag/flow.json"); - flowExecutor = FlowExecutorHolder.loadInstance(config); - } - - @Test - public void testTag1() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("123",context.getData("test")); - } - - @Test - public void testTag2() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain2", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a==>a==>a==>c==>e", response.getExecuteStepStr()); - } - - //测试多线程when情况下的tag取值是否正确 - //这里循环多次的原因是,因为when多线程,有时候因为凑巧,可能正确。所以多次情况下在2.6.4版本肯定出错 - @Test - public void testTag3() throws Exception{ - for (int i = 0; i < 50; i++) { - LiteflowResponse response = flowExecutor.execute2Resp("chain3", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - ConcurrentHashSet testSet = context.getData("test"); - Assert.assertEquals(3, testSet.size()); - } - } - - //测试tag是否能在isAccess中起效 - @Test - public void testTag4() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain4", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("g", response.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/tag/NodeTagXmlTest.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/tag/NodeTagXmlTest.java deleted file mode 100644 index cf05b118b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/tag/NodeTagXmlTest.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.yomahub.liteflow.test.tag; - -import cn.hutool.core.collection.ConcurrentHashSet; -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.core.FlowExecutorHolder; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * 非spring环境下组件标签的测试 - * @author Bryan.Zhang - * @since 2.5.0 - */ -public class NodeTagXmlTest extends BaseTest { - - private static FlowExecutor flowExecutor; - - @BeforeClass - public static void init(){ - LiteflowConfig config = new LiteflowConfig(); - config.setRuleSource("tag/flow.xml"); - flowExecutor = FlowExecutorHolder.loadInstance(config); - } - - @Test - public void testTag1() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("123",context.getData("test")); - } - - @Test - public void testTag2() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain2", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a==>a==>a==>c==>e", response.getExecuteStepStr()); - } - - //测试多线程when情况下的tag取值是否正确 - //这里循环多次的原因是,因为when多线程,有时候因为凑巧,可能正确。所以多次情况下在2.6.4版本肯定出错 - @Test - public void testTag3() throws Exception{ - for (int i = 0; i < 50; i++) { - LiteflowResponse response = flowExecutor.execute2Resp("chain3", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - ConcurrentHashSet testSet = context.getData("test"); - Assert.assertEquals(3, testSet.size()); - } - } - - //测试tag是否能在isAccess中起效 - @Test - public void testTag4() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain4", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("g", response.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/tag/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/tag/cmp/ACmp.java deleted file mode 100644 index 8d12933e2..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/tag/cmp/ACmp.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.tag.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; - -public class ACmp extends NodeComponent { - - @Override - public void process() { - String testKey = "test"; - - DefaultContext context = this.getFirstContextBean(); - if (context.getData(testKey) == null){ - context.setData(testKey,this.getTag()); - }else{ - String s = context.getData(testKey); - s += this.getTag(); - context.setData(testKey, s); - } - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/tag/cmp/B1Cmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/tag/cmp/B1Cmp.java deleted file mode 100644 index 11c13b00f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/tag/cmp/B1Cmp.java +++ /dev/null @@ -1,22 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.tag.cmp; - -import cn.hutool.core.collection.ConcurrentHashSet; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; - -public class B1Cmp extends NodeComponent { - - @Override - public void process() { - DefaultContext context = this.getFirstContextBean(); - context.setData("test",new ConcurrentHashSet()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/tag/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/tag/cmp/BCmp.java deleted file mode 100644 index ba93a3abd..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/tag/cmp/BCmp.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.tag.cmp; - -import cn.hutool.core.collection.ConcurrentHashSet; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; - -public class BCmp extends NodeComponent { - - @Override - public void process() { - DefaultContext context = this.getFirstContextBean(); - ConcurrentHashSet testSet = context.getData("test"); - testSet.add(this.getTag()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/tag/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/tag/cmp/CCmp.java deleted file mode 100644 index 84242cf0b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/tag/cmp/CCmp.java +++ /dev/null @@ -1,22 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.tag.cmp; - -import com.yomahub.liteflow.core.NodeSwitchComponent; - -public class CCmp extends NodeSwitchComponent { - - @Override - public String processSwitch() throws Exception { - if(this.getTag().equals("2")){ - return "e"; - }else{ - return "d"; - } - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/tag/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/tag/cmp/DCmp.java deleted file mode 100644 index fcfc5e6b4..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/tag/cmp/DCmp.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.tag.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class DCmp extends NodeComponent { - - @Override - public void process() { - System.out.println(this.getTag()); - System.out.println("DCmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/tag/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/tag/cmp/ECmp.java deleted file mode 100644 index 121dead75..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/tag/cmp/ECmp.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.tag.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class ECmp extends NodeComponent { - - @Override - public void process() { - System.out.println(this.getTag()); - System.out.println("ECmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/tag/cmp/FCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/tag/cmp/FCmp.java deleted file mode 100644 index 6a0df7697..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/tag/cmp/FCmp.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.tag.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class FCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("FCmp executed!"); - } - - @Override - public boolean isAccess() { - return Boolean.parseBoolean(this.getTag()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/tag/cmp/GCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/tag/cmp/GCmp.java deleted file mode 100644 index 66ed40a9f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/tag/cmp/GCmp.java +++ /dev/null @@ -1,18 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.tag.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class GCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("GCmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/TestTL.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/TestTL.java deleted file mode 100644 index fee0055e5..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/TestTL.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.yomahub.liteflow.test.useTTLInWhen; - -import com.alibaba.ttl.TransmittableThreadLocal; - -public class TestTL { - - public static ThreadLocal tl = new TransmittableThreadLocal<>(); - - public static String get(){ - return tl.get(); - } - - public static void set(String value){ - tl.set(value); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/UseTTLInWhenTest.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/UseTTLInWhenTest.java deleted file mode 100644 index beff5c6e4..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/UseTTLInWhenTest.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.yomahub.liteflow.test.useTTLInWhen; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.core.FlowExecutorHolder; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * 在when异步节点的情况下去拿ThreadLocal里的测试场景 - * @author Bryan.Zhang - * @since 2.6.3 - */ -public class UseTTLInWhenTest extends BaseTest { - - private static FlowExecutor flowExecutor; - - @BeforeClass - public static void init(){ - LiteflowConfig config = new LiteflowConfig(); - config.setRuleSource("useTTLInWhen/flow.xml"); - flowExecutor = FlowExecutorHolder.loadInstance(config); - } - - @Test - public void testUseTTLInWhen() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertEquals("hello,b", context.getData("b")); - Assert.assertEquals("hello,c", context.getData("c")); - Assert.assertEquals("hello,d", context.getData("d")); - Assert.assertEquals("hello,e", context.getData("e")); - Assert.assertEquals("hello,f", context.getData("f")); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/ACmp.java deleted file mode 100644 index bf52ea342..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/ACmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.useTTLInWhen.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.test.useTTLInWhen.TestTL; - -public class ACmp extends NodeComponent { - - @Override - public void process() { - TestTL.set("hello"); - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/BCmp.java deleted file mode 100644 index 8737920c4..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/BCmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.useTTLInWhen.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.useTTLInWhen.TestTL; - -public class BCmp extends NodeComponent { - - @Override - public void process() { - String value = TestTL.get(); - DefaultContext context = this.getFirstContextBean(); - context.setData(this.getNodeId(),value+",b"); - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/CCmp.java deleted file mode 100644 index f0022bee2..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/CCmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.useTTLInWhen.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.useTTLInWhen.TestTL; - -public class CCmp extends NodeComponent { - - @Override - public void process() { - String value = TestTL.get(); - DefaultContext context = this.getFirstContextBean(); - context.setData(this.getNodeId(),value+",c"); - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/DCmp.java deleted file mode 100644 index 9f99e1330..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/DCmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.useTTLInWhen.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.useTTLInWhen.TestTL; - -public class DCmp extends NodeComponent { - - @Override - public void process() { - String value = TestTL.get(); - DefaultContext context = this.getFirstContextBean(); - context.setData(this.getNodeId(),value+",d"); - System.out.println("DCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/ECmp.java deleted file mode 100644 index 0d98daae4..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/ECmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.useTTLInWhen.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.useTTLInWhen.TestTL; - -public class ECmp extends NodeComponent { - - @Override - public void process() { - String value = TestTL.get(); - DefaultContext context = this.getFirstContextBean(); - context.setData(this.getNodeId(),value+",e"); - System.out.println("ECmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/FCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/FCmp.java deleted file mode 100644 index 325a7a2ea..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/FCmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.useTTLInWhen.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.useTTLInWhen.TestTL; - -public class FCmp extends NodeComponent { - - @Override - public void process() { - String value = TestTL.get(); - DefaultContext context = this.getFirstContextBean(); - context.setData(this.getNodeId(),value+",f"); - System.out.println("FCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/whenTimeOut/WhenTimeOutTest1.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/whenTimeOut/WhenTimeOutTest1.java deleted file mode 100644 index fe3dcdfd6..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/whenTimeOut/WhenTimeOutTest1.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.yomahub.liteflow.test.whenTimeOut; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.core.FlowExecutorHolder; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.exception.WhenTimeoutException; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * 非spring环境下异步线程超时日志打印测试 - * @author Bryan.Zhang - * @since 2.6.4 - */ -public class WhenTimeOutTest1 extends BaseTest { - - private static FlowExecutor flowExecutor; - - @BeforeClass - public static void init(){ - LiteflowConfig config = new LiteflowConfig(); - config.setRuleSource("whenTimeOut/flow1.xml"); - config.setWhenMaxWaitSeconds(3); - flowExecutor = FlowExecutorHolder.loadInstance(config); - } - - //其中b和c在when情况下超时,所以抛出了WhenTimeoutException这个错 - @Test - public void testWhenTimeOut() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertFalse(response.isSuccess()); - Assert.assertEquals(WhenTimeoutException.class, response.getCause().getClass()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/whenTimeOut/WhenTimeOutTest2.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/whenTimeOut/WhenTimeOutTest2.java deleted file mode 100644 index 95b64ff81..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/whenTimeOut/WhenTimeOutTest2.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.yomahub.liteflow.test.whenTimeOut; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.core.FlowExecutorHolder; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * 非spring环境下异步线程超时日志打印测试 - * @author Bryan.Zhang - * @since 2.6.4 - */ -public class WhenTimeOutTest2 extends BaseTest { - - private static FlowExecutor flowExecutor; - - @BeforeClass - public static void init(){ - LiteflowConfig config = new LiteflowConfig(); - config.setRuleSource("whenTimeOut/flow2.xml"); - config.setWhenMaxWaitSeconds(5); - flowExecutor = FlowExecutorHolder.loadInstance(config); - } - - //其中d,e,f都sleep 4秒,其中def是不同的组,超时设置5秒 - @Test - public void testWhenTimeOut() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/ACmp.java deleted file mode 100644 index f6faf4786..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/ACmp.java +++ /dev/null @@ -1,18 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.whenTimeOut.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class BCmp extends NodeComponent { - - @Override - public void process() { - try { - Thread.sleep(4000); - }catch (Exception ignored){ - - } - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/CCmp.java deleted file mode 100644 index 262415cca..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/CCmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.whenTimeOut.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class CCmp extends NodeComponent { - - @Override - public void process() { - try { - Thread.sleep(3500); - }catch (Exception ignored){ - - } - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/DCmp.java deleted file mode 100644 index b40df5d0a..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/DCmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.whenTimeOut.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class DCmp extends NodeComponent { - - @Override - public void process() { - try { - Thread.sleep(4000); - }catch (Exception ignored){ - - } - System.out.println("DCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/ECmp.java deleted file mode 100644 index 8136cb1c5..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/ECmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.whenTimeOut.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class ECmp extends NodeComponent { - - @Override - public void process() { - try { - Thread.sleep(4000); - }catch (Exception ignored){ - - } - System.out.println("ECmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/FCmp.java b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/FCmp.java deleted file mode 100644 index 2b96487cc..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/FCmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.whenTimeOut.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class FCmp extends NodeComponent { - - @Override - public void process() { - try { - Thread.sleep(4000); - }catch (Exception ignored){ - - } - System.out.println("FCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/absoluteConfigPath/flow2.xml b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/absoluteConfigPath/flow2.xml deleted file mode 100644 index 164993ffb..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/absoluteConfigPath/flow2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/asyncNode/flow.xml b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/asyncNode/flow.xml deleted file mode 100644 index 82e82283d..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/asyncNode/flow.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/base/flow.xml b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/base/flow.xml deleted file mode 100644 index bc02c6194..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/base/flow.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/cmpRetry/flow.xml b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/cmpRetry/flow.xml deleted file mode 100644 index baa267f28..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/cmpRetry/flow.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/cmpStep/flow.xml b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/cmpStep/flow.xml deleted file mode 100644 index 4483f1b76..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/cmpStep/flow.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/component/flow.xml b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/component/flow.xml deleted file mode 100644 index 38014c737..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/component/flow.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/config/flow.xml b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/config/flow.xml deleted file mode 100644 index d8915f179..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/config/flow.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/customWhenThreadPool/flow.xml b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/customWhenThreadPool/flow.xml deleted file mode 100644 index d18ed4842..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/customWhenThreadPool/flow.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/emptyFlow/flow.xml b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/emptyFlow/flow.xml deleted file mode 100644 index e69de29bb..000000000 diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/event/flow.xml b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/event/flow.xml deleted file mode 100644 index 966469a53..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/event/flow.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/exception/flow-exception.xml b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/exception/flow-exception.xml deleted file mode 100644 index 662226def..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/exception/flow-exception.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/exception/flow.xml b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/exception/flow.xml deleted file mode 100644 index 58e93b0a7..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/exception/flow.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/execute2Future/flow.xml b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/execute2Future/flow.xml deleted file mode 100644 index 98c5a1b68..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/execute2Future/flow.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/flowmeta/flow.xml b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/flowmeta/flow.xml deleted file mode 100644 index d8821ff8b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/flowmeta/flow.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/multipleType/flow.xml b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/multipleType/flow.xml deleted file mode 100644 index dd3d820ed..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/multipleType/flow.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/multipleType/flow.yml b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/multipleType/flow.yml deleted file mode 100644 index 4c1d8375a..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/multipleType/flow.yml +++ /dev/null @@ -1,6 +0,0 @@ -flow: - chain: - - name: chain3 - condition: - - type: then - value: 'a,b,c' diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/nodeExecutor/flow.xml b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/nodeExecutor/flow.xml deleted file mode 100644 index 5a4010a28..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/nodeExecutor/flow.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/nullParam/flow.xml b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/nullParam/flow.xml deleted file mode 100644 index 9bdcadb12..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/nullParam/flow.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/parser/flow.json b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/parser/flow.json deleted file mode 100644 index 52d0d05c0..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/parser/flow.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "flow": { - "nodes": { - "node": [ - { - "id": "a", - "class": "com.yomahub.liteflow.test.parser.cmp.ACmp" - }, - { - "id": "b", - "class": "com.yomahub.liteflow.test.parser.cmp.BCmp" - }, - { - "id": "c", - "class": "com.yomahub.liteflow.test.parser.cmp.CCmp" - }, - { - "id": "d", - "class": "com.yomahub.liteflow.test.parser.cmp.DCmp" - }, - { - "id": "e", - "class": "com.yomahub.liteflow.test.parser.cmp.ECmp" - }, - { - "id": "f", - "class": "com.yomahub.liteflow.test.parser.cmp.FCmp" - }, - { - "id": "g", - "class": "com.yomahub.liteflow.test.parser.cmp.GCmp" - } - ] - }, - "chain": [ - { - "name": "chain2", - "condition": [ - {"type": "then", "value": "c,g,f"} - ] - }, - { - "name": "chain1", - "condition": [ - {"type": "then", "value": "a,c"}, - {"type": "when", "value": "b,d,e(f|g)"}, - {"type": "then", "value": "chain2"} - ] - } - ] - } -} \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/parser/flow.xml b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/parser/flow.xml deleted file mode 100644 index 0775c5ec1..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/parser/flow.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/parser/flow.yml b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/parser/flow.yml deleted file mode 100644 index 814f59d54..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/parser/flow.yml +++ /dev/null @@ -1,30 +0,0 @@ -flow: - nodes: - node: - - id: a - class: com.yomahub.liteflow.test.parser.cmp.ACmp - - id: b - class: com.yomahub.liteflow.test.parser.cmp.BCmp - - id: c - class: com.yomahub.liteflow.test.parser.cmp.CCmp - - id: d - class: com.yomahub.liteflow.test.parser.cmp.DCmp - - id: e - class: com.yomahub.liteflow.test.parser.cmp.ECmp - - id: f - class: com.yomahub.liteflow.test.parser.cmp.FCmp - - id: g - class: com.yomahub.liteflow.test.parser.cmp.GCmp - chain: - - name: chain1 - condition: - - type: then - value: 'a,c' - - type: when - value: 'b,d,e(f|g)' - - type: then - value: 'chain2' - - name: chain2 - condition: - - type: then - value: 'c,g,f' diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/preAndFinally/flow.xml b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/preAndFinally/flow.xml deleted file mode 100644 index e4ba3fa89..000000000 --- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/preAndFinally/flow.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - -
-        
-        
-    
-
-    
-        
-        
-        
-        
-    
-
-    
-        
-        
-        
-    
-
-    
-        
-        
-    
-
-    
-        
-        
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/privateDelivery/flow.xml b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/privateDelivery/flow.xml
deleted file mode 100644
index a1c30d038..000000000
--- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/privateDelivery/flow.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-    
-        
-        
-        
-        
-    
-
-    
-        
-        
-        
-        
-        
-        
-        
-        
-        
-        
-        
-        
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/refreshRule/flow.xml b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/refreshRule/flow.xml
deleted file mode 100644
index e5a845a1a..000000000
--- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/refreshRule/flow.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-    
-        
-        
-        
-    
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/refreshRule/flow_update.xml b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/refreshRule/flow_update.xml
deleted file mode 100644
index 5d21ccd59..000000000
--- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/refreshRule/flow_update.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-    
-        
-        
-        
-    
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/reload/flow.xml b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/reload/flow.xml
deleted file mode 100644
index d88d55f90..000000000
--- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/reload/flow.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-    
-        
-        
-        
-    
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/removeChain/flow.xml b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/removeChain/flow.xml
deleted file mode 100644
index c8bd6b3b2..000000000
--- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/removeChain/flow.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-    
-        
-        
-        
-        
-    
-
-    
-        
-        
-    
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/requestId/flow.xml b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/requestId/flow.xml
deleted file mode 100644
index d9c9a3d46..000000000
--- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/requestId/flow.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-    
-        
-        
-    
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/resizeSlot/flow.xml b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/resizeSlot/flow.xml
deleted file mode 100644
index f8a83742c..000000000
--- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/resizeSlot/flow.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-    
-        
-        
-        
-    
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/subflow/flow-implicit.xml b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/subflow/flow-implicit.xml
deleted file mode 100644
index aa42db5b0..000000000
--- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/subflow/flow-implicit.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-    
-        
-        
-        
-        
-    
-
-    
-         
-    
-
-    
-        
-    
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/subflow/flow-main.xml b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/subflow/flow-main.xml
deleted file mode 100644
index 42886c702..000000000
--- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/subflow/flow-main.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-    
-        
-        
-        
-        
-        
-        
-        
-        
-        
-    
-
-    
-        
-         
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/subflow/flow-sub1.xml b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/subflow/flow-sub1.xml
deleted file mode 100644
index 471dee3fe..000000000
--- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/subflow/flow-sub1.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-    
-        
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/subflow/flow-sub2.xml b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/subflow/flow-sub2.xml
deleted file mode 100644
index 63dd964bf..000000000
--- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/subflow/flow-sub2.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/subflow/flow-sub2.yml b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/subflow/flow-sub2.yml
deleted file mode 100644
index 8ba43c102..000000000
--- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/subflow/flow-sub2.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-flow:
-  chain:
-    - name: chain3
-      condition:
-        - type: then
-          value: 'e,d'
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/subflow/flow.json b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/subflow/flow.json
deleted file mode 100644
index e11a9860a..000000000
--- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/subflow/flow.json
+++ /dev/null
@@ -1,73 +0,0 @@
-{
-  "flow": {
-    "nodes": {
-      "node": [
-        {
-          "id": "a",
-          "class": "com.yomahub.liteflow.test.subflow.cmp1.ACmp"
-        },
-        {
-          "id": "b",
-          "class": "com.yomahub.liteflow.test.subflow.cmp1.BCmp"
-        },
-        {
-          "id": "c",
-          "class": "com.yomahub.liteflow.test.subflow.cmp1.CCmp"
-        },
-        {
-          "id": "d",
-          "class": "com.yomahub.liteflow.test.subflow.cmp1.DCmp"
-        },
-        {
-          "id": "e",
-          "class": "com.yomahub.liteflow.test.subflow.cmp1.ECmp"
-        },
-        {
-          "id": "f",
-          "class": "com.yomahub.liteflow.test.subflow.cmp2.FCmp"
-        },
-        {
-          "id": "g",
-          "class": "com.yomahub.liteflow.test.subflow.cmp2.GCmp"
-        },
-        {
-          "id": "h",
-          "class": "com.yomahub.liteflow.test.subflow.cmp2.HCmp"
-        },
-        {
-          "id": "M",
-          "class": "com.yomahub.liteflow.test.subflow.cmp2.MCmp"
-        }
-      ]
-    },
-    "chain": [
-      {
-        "name": "chain3",
-        "condition": [
-          {"type": "then", "value": "e,d"}
-        ]
-      },
-      {
-        "name": "chain2",
-        "condition": [
-          {"type": "then", "value": "b,a"},
-          {"type": "then", "value": "chain3"}
-        ]
-      },
-      {
-        "name": "chain1",
-        "condition": [
-          {"type": "then", "value": "a,b"},
-          {"type": "then", "value": "c"},
-          {"type": "then", "value": "chain2"}
-        ]
-      },
-      {
-        "name": "c",
-        "condition": [
-          {"type": "then", "value": "d,e"}
-        ]
-      }
-    ]
-  }
-}
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/subflow/flow.xml b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/subflow/flow.xml
deleted file mode 100644
index 538ab30ed..000000000
--- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/subflow/flow.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-    
-        
-        
-        
-        
-        
-        
-        
-        
-        
-    
-
-    
-        
-           
-         
-    
-
-    
-        
-    
-
-    
-        
-        
-    
-
-    
-        
-    
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/subflow/flow.yml b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/subflow/flow.yml
deleted file mode 100644
index 5c20998ee..000000000
--- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/subflow/flow.yml
+++ /dev/null
@@ -1,44 +0,0 @@
-flow:
-  nodes:
-    node:
-      - id: a
-        class: com.yomahub.liteflow.test.subflow.cmp1.ACmp
-      - id: b
-        class: com.yomahub.liteflow.test.subflow.cmp1.BCmp
-      - id: c
-        class: com.yomahub.liteflow.test.subflow.cmp1.CCmp
-      - id: d
-        class: com.yomahub.liteflow.test.subflow.cmp1.DCmp
-      - id: e
-        class: com.yomahub.liteflow.test.subflow.cmp1.ECmp
-      - id: f
-        class: com.yomahub.liteflow.test.subflow.cmp2.FCmp
-      - id: g
-        class: com.yomahub.liteflow.test.subflow.cmp2.GCmp
-      - id: h
-        class: com.yomahub.liteflow.test.subflow.cmp2.HCmp
-      - id: h
-        class: com.yomahub.liteflow.test.subflow.cmp2.MCmp
-  chain:
-    - name: chain3
-      condition:
-        - type: then
-          value: 'e,d'
-    - name: chain1
-      condition:
-        - type: then
-          value: 'a,b'
-        - type: then
-          value: 'c'
-        - type: then
-          value: 'chain2'
-    - name: c
-      condition:
-        - type: then
-          value: 'd,e'
-    - name: chain2
-      condition:
-        - type: then
-          value: 'b,a'
-        - type: then
-          value: 'chain3'
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/tag/flow.json b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/tag/flow.json
deleted file mode 100644
index 977872210..000000000
--- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/tag/flow.json
+++ /dev/null
@@ -1,67 +0,0 @@
-{
-  "flow": {
-    "nodes": {
-      "node": [
-        {
-          "id": "a",
-          "class": "com.yomahub.liteflow.test.tag.cmp.ACmp"
-        },
-        {
-          "id": "b",
-          "class": "com.yomahub.liteflow.test.tag.cmp.BCmp"
-        },
-        {
-          "id": "b1",
-          "class": "com.yomahub.liteflow.test.tag.cmp.B1Cmp"
-        },
-        {
-          "id": "c",
-          "class": "com.yomahub.liteflow.test.tag.cmp.CCmp"
-        },
-        {
-          "id": "d",
-          "class": "com.yomahub.liteflow.test.tag.cmp.DCmp"
-        },
-        {
-          "id": "e",
-          "class": "com.yomahub.liteflow.test.tag.cmp.ECmp"
-        },
-        {
-          "id": "f",
-          "class": "com.yomahub.liteflow.test.tag.cmp.FCmp"
-        },
-        {
-          "id": "g",
-          "class": "com.yomahub.liteflow.test.tag.cmp.GCmp"
-        }
-      ]
-    },
-    "chain": [
-      {
-        "name": "chain1",
-        "condition": [
-          {"type": "then", "value": "a[1],a[2],a[3]"}
-        ]
-      },
-      {
-        "name": "chain2",
-        "condition": [
-          {"type": "then", "value": "a[1],a[2],a[3],c[2](d[5]|e[6])"}
-        ]
-      },
-      {
-        "name": "chain3",
-        "condition": [
-          {"type": "then", "value": "b1"},
-          {"type": "when", "value": "b[1],b[2],b[3]"}
-        ]
-      },
-      {
-        "name": "chain4",
-        "condition": [
-          {"type": "then", "value": "f[false],g"}
-        ]
-      }
-    ]
-  }
-}
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/tag/flow.xml b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/tag/flow.xml
deleted file mode 100644
index 61a4d5fd3..000000000
--- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/tag/flow.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-    
-        
-        
-        
-        
-        
-        
-        
-        
-    
-
-    
-        
-    
-
-    
-        
-    
-
-    
-        
-        
-    
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/useTTLInWhen/flow.xml b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/useTTLInWhen/flow.xml
deleted file mode 100644
index 699c21abc..000000000
--- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/useTTLInWhen/flow.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-    
-        
-        
-        
-        
-        
-        
-    
-
-    
-        
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/whenTimeOut/flow1.xml b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/whenTimeOut/flow1.xml
deleted file mode 100644
index e3ac01d8a..000000000
--- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/whenTimeOut/flow1.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-    
-        
-        
-        
-    
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/whenTimeOut/flow2.xml b/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/whenTimeOut/flow2.xml
deleted file mode 100644
index 1f889c1fe..000000000
--- a/liteflow-testcase-old/liteflow-testcase-nospring/src/test/resources/whenTimeOut/flow2.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-    
-        
-        
-        
-    
-
-    
-        
-        
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/pom.xml b/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/pom.xml
deleted file mode 100644
index ab7e1afe0..000000000
--- a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/pom.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-    
-        liteflow-testcase-old
-        com.yomahub
-        ${revision}
-        ../pom.xml
-    
-    4.0.0
-
-    liteflow-testcase-script-groovy-springboot
-
-    
-        
-            com.yomahub
-            liteflow-spring-boot-starter
-            ${revision}
-        
-
-        
-            org.springframework.boot
-            spring-boot-starter-test
-        
-        
-            org.aspectj
-            aspectjweaver
-            test
-        
-        
-            com.yomahub
-            liteflow-script-groovy
-            ${revision}
-            test
-        
-    
-
-    
-        
-            
-                org.springframework.boot
-                spring-boot-maven-plugin
-                ${springboot.version}
-            
-            
-                org.apache.maven.plugins
-                maven-deploy-plugin
-                2.8.2
-                
-                    true
-                
-            
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/java/com/yomahub/liteflow/test/BaseTest.java b/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/java/com/yomahub/liteflow/test/BaseTest.java
deleted file mode 100644
index 64886670f..000000000
--- a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/java/com/yomahub/liteflow/test/BaseTest.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package com.yomahub.liteflow.test;
-
-import com.yomahub.liteflow.flow.FlowBus;
-import com.yomahub.liteflow.property.LiteflowConfigGetter;
-import com.yomahub.liteflow.spi.holder.SpiFactoryCleaner;
-import com.yomahub.liteflow.spring.ComponentScanner;
-import com.yomahub.liteflow.thread.ExecutorHelper;
-import org.junit.AfterClass;
-
-public class BaseTest {
-
-    @AfterClass
-    public static void cleanScanCache(){
-        ComponentScanner.cleanCache();
-        FlowBus.cleanCache();
-        ExecutorHelper.loadInstance().clearExecutorServiceMap();
-        SpiFactoryCleaner.clean();
-        LiteflowConfigGetter.clean();
-    }
-}
diff --git a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/java/com/yomahub/liteflow/test/script/groovy/LiteFlowXmlScriptBuilderGroovyTest.java b/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/java/com/yomahub/liteflow/test/script/groovy/LiteFlowXmlScriptBuilderGroovyTest.java
deleted file mode 100644
index 31e9a050d..000000000
--- a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/java/com/yomahub/liteflow/test/script/groovy/LiteFlowXmlScriptBuilderGroovyTest.java
+++ /dev/null
@@ -1,98 +0,0 @@
-package com.yomahub.liteflow.test.script.groovy;
-
-import com.yomahub.liteflow.builder.LiteFlowChainBuilder;
-import com.yomahub.liteflow.builder.LiteFlowConditionBuilder;
-import com.yomahub.liteflow.builder.LiteFlowNodeBuilder;
-import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.flow.LiteflowResponse;
-import com.yomahub.liteflow.enums.NodeTypeEnum;
-import com.yomahub.liteflow.slot.DefaultContext;
-import com.yomahub.liteflow.test.BaseTest;
-import org.junit.Assert;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.test.context.junit4.SpringRunner;
-
-import javax.annotation.Resource;
-
-@RunWith(SpringRunner.class)
-@SpringBootTest(classes = LiteFlowXmlScriptBuilderGroovyTest.class)
-@EnableAutoConfiguration
-public class LiteFlowXmlScriptBuilderGroovyTest extends BaseTest {
-
-    @Resource
-    private FlowExecutor flowExecutor;
-
-    //测试通过builder方式运行普通script节点,以脚本文本的方式运行
-    @Test
-    public void testBuilderScript1() {
-        LiteFlowNodeBuilder.createNode().setId("a")
-                .setName("组件A")
-                .setType(NodeTypeEnum.COMMON)
-                .setClazz("com.yomahub.liteflow.test.script.groovy.cmp.ACmp")
-                .build();
-        LiteFlowNodeBuilder.createNode().setId("b")
-                .setName("组件B")
-                .setType(NodeTypeEnum.COMMON)
-                .setClazz("com.yomahub.liteflow.test.script.groovy.cmp.BCmp")
-                .build();
-        LiteFlowNodeBuilder.createNode().setId("c")
-                .setName("组件C")
-                .setType(NodeTypeEnum.COMMON)
-                .setClazz("com.yomahub.liteflow.test.script.groovy.cmp.CCmp")
-                .build();
-        LiteFlowNodeBuilder.createScriptNode()
-                .setId("s1")
-                .setName("普通脚本S1")
-                .setType(NodeTypeEnum.SCRIPT)
-                .setScript("Integer a=3;Integer b=2;defaultContext.setData(\"s1\",a*b)")
-                .build();
-
-        LiteFlowChainBuilder.createChain().setChainName("chain1")
-                        .setCondition(LiteFlowConditionBuilder.createThenCondition().setValue("a,b,c,s1").build())
-                        .build();
-
-
-        LiteflowResponse response = flowExecutor.execute2Resp("chain1","arg1");
-        DefaultContext context = response.getFirstContextBean();
-        Assert.assertTrue(response.isSuccess());
-        Assert.assertEquals(Integer.valueOf(6), context.getData("s1"));
-    }
-
-    //测试通过builder方式运行普通script节点,以file的方式运行
-    @Test
-    public void testBuilderScript2() {
-        LiteFlowNodeBuilder.createNode().setId("d")
-                .setName("组件D")
-                .setType(NodeTypeEnum.COMMON)
-                .setClazz("com.yomahub.liteflow.test.script.groovy.cmp.DCmp")
-                .build();
-        LiteFlowNodeBuilder.createNode().setId("s2")
-                .setName("条件脚本S2")
-                .setType(NodeTypeEnum.SWITCH_SCRIPT)
-                .setFile("builder/s2.groovy")
-                .build();
-        LiteFlowNodeBuilder.createNode().setId("a")
-                .setName("组件A")
-                .setType(NodeTypeEnum.COMMON)
-                .setClazz("com.yomahub.liteflow.test.script.groovy.cmp.ACmp")
-                .build();
-        LiteFlowNodeBuilder.createNode().setId("b")
-                .setName("组件B")
-                .setType(NodeTypeEnum.COMMON)
-                .setClazz("com.yomahub.liteflow.test.script.groovy.cmp.BCmp")
-                .build();
-
-        LiteFlowChainBuilder.createChain().setChainName("chain2")
-                .setCondition(LiteFlowConditionBuilder.createThenCondition().setValue("d,s2(a|b)").build())
-                .build();
-
-
-        LiteflowResponse response = flowExecutor.execute2Resp("chain2","arg1");
-        DefaultContext context = response.getFirstContextBean();
-        Assert.assertTrue(response.isSuccess());
-        Assert.assertEquals("d[组件D]==>s2[条件脚本S2]==>a[组件A]", response.getExecuteStepStr());
-    }
-}
diff --git a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/java/com/yomahub/liteflow/test/script/groovy/LiteflowJsonScriptFileGroovyTest.java b/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/java/com/yomahub/liteflow/test/script/groovy/LiteflowJsonScriptFileGroovyTest.java
deleted file mode 100644
index 639a7d796..000000000
--- a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/java/com/yomahub/liteflow/test/script/groovy/LiteflowJsonScriptFileGroovyTest.java
+++ /dev/null
@@ -1,93 +0,0 @@
-package com.yomahub.liteflow.test.script.groovy;
-
-import cn.hutool.core.io.resource.ResourceUtil;
-import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.flow.LiteflowResponse;
-import com.yomahub.liteflow.enums.FlowParserTypeEnum;
-import com.yomahub.liteflow.flow.FlowBus;
-import com.yomahub.liteflow.slot.DefaultContext;
-import com.yomahub.liteflow.test.BaseTest;
-import org.junit.Assert;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.test.context.TestPropertySource;
-import org.springframework.test.context.junit4.SpringRunner;
-
-import javax.annotation.Resource;
-
-
-/**
- * 测试springboot下的groovy脚本组件,基于json配置
- * @author Bryan.Zhang
- * @since 2.6.4
- */
-@RunWith(SpringRunner.class)
-@TestPropertySource(value = "classpath:/json-script-file/application.properties")
-@SpringBootTest(classes = LiteflowJsonScriptFileGroovyTest.class)
-@EnableAutoConfiguration
-@ComponentScan({"com.yomahub.liteflow.test.script.groovy.cmp"})
-public class LiteflowJsonScriptFileGroovyTest extends BaseTest {
-
-    @Resource
-    private FlowExecutor flowExecutor;
-
-    //测试普通脚本节点
-    @Test
-    public void testScript1() {
-        LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg");
-        DefaultContext context = response.getFirstContextBean();
-        Assert.assertTrue(response.isSuccess());
-        Assert.assertEquals(Integer.valueOf(6), context.getData("s1"));
-    }
-
-    //测试条件脚本节点
-    @Test
-    public void testScript2() {
-        LiteflowResponse response = flowExecutor.execute2Resp("chain2", "arg");
-        Assert.assertTrue(response.isSuccess());
-        Assert.assertEquals("d==>s2[条件脚本]==>a", response.getExecuteStepStr());
-    }
-
-    //测试脚本的热重载
-    @Test
-    public void testScript3() throws Exception{
-        //根据配置,加载的应该是flow.xml,执行原来的规则
-        LiteflowResponse responseOld = flowExecutor.execute2Resp("chain2", "arg");
-        Assert.assertTrue(responseOld.isSuccess());
-        Assert.assertEquals("d==>s2[条件脚本]==>a", responseOld.getExecuteStepStr());
-        //更改规则,重新加载,更改的规则内容从flow_update.xml里读取,这里只是为了模拟下获取新的内容。不一定是从文件中读取
-        String newContent = ResourceUtil.readUtf8Str("classpath: /json-script-file/flow_update.json");
-        //进行刷新
-        FlowBus.refreshFlowMetaData(FlowParserTypeEnum.TYPE_JSON, newContent);
-
-        //重新执行chain2这个链路,结果会变
-        LiteflowResponse responseNew = flowExecutor.execute2Resp("chain2", "arg");
-        Assert.assertTrue(responseNew.isSuccess());
-        Assert.assertEquals("d==>s2[条件脚本_改]==>b==>s3[普通脚本_新增]", responseNew.getExecuteStepStr());
-    }
-
-    //测试脚本&规则平滑重载刷新
-    @Test
-    public void testScript4() throws Exception{
-        new Thread(() -> {
-            try{
-                Thread.sleep(2000L);
-                //更改规则,重新加载,更改的规则内容从flow_update.xml里读取,这里只是为了模拟下获取新的内容。不一定是从文件中读取
-                String newContent = ResourceUtil.readUtf8Str("classpath: /json-script-file/flow_update.json");
-                //进行刷新
-                FlowBus.refreshFlowMetaData(FlowParserTypeEnum.TYPE_JSON, newContent);
-            }catch (Exception e){
-                e.printStackTrace();
-            }
-        }).start();
-
-        for (int i = 0; i < 300; i++) {
-            LiteflowResponse responseNew = flowExecutor.execute2Resp("chain2", "arg");
-            Assert.assertTrue(responseNew.isSuccess());
-            Thread.sleep(10L);
-        }
-    }
-}
diff --git a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/java/com/yomahub/liteflow/test/script/groovy/LiteflowJsonScriptGroovyTest.java b/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/java/com/yomahub/liteflow/test/script/groovy/LiteflowJsonScriptGroovyTest.java
deleted file mode 100644
index af87ccd79..000000000
--- a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/java/com/yomahub/liteflow/test/script/groovy/LiteflowJsonScriptGroovyTest.java
+++ /dev/null
@@ -1,71 +0,0 @@
-package com.yomahub.liteflow.test.script.groovy;
-
-import cn.hutool.core.io.resource.ResourceUtil;
-import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.flow.LiteflowResponse;
-import com.yomahub.liteflow.enums.FlowParserTypeEnum;
-import com.yomahub.liteflow.flow.FlowBus;
-import com.yomahub.liteflow.slot.DefaultContext;
-import com.yomahub.liteflow.test.BaseTest;
-import org.junit.Assert;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.test.context.TestPropertySource;
-import org.springframework.test.context.junit4.SpringRunner;
-
-import javax.annotation.Resource;
-
-
-/**
- * 测试springboot下的groovy脚本组件,基于json配置
- * @author Bryan.Zhang
- * @since 2.6.4
- */
-@RunWith(SpringRunner.class)
-@TestPropertySource(value = "classpath:/json-script/application.properties")
-@SpringBootTest(classes = LiteflowJsonScriptGroovyTest.class)
-@EnableAutoConfiguration
-@ComponentScan({"com.yomahub.liteflow.test.script.groovy.cmp"})
-public class LiteflowJsonScriptGroovyTest extends BaseTest {
-
-    @Resource
-    private FlowExecutor flowExecutor;
-
-    //测试普通脚本节点
-    @Test
-    public void testScript1() {
-        LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg");
-        DefaultContext context = response.getFirstContextBean();
-        Assert.assertTrue(response.isSuccess());
-        Assert.assertEquals(Integer.valueOf(6), context.getData("s1"));
-    }
-
-    //测试条件脚本节点
-    @Test
-    public void testScript2() {
-        LiteflowResponse response = flowExecutor.execute2Resp("chain2", "arg");
-        Assert.assertTrue(response.isSuccess());
-        Assert.assertEquals("d==>s2[条件脚本]==>a", response.getExecuteStepStr());
-    }
-
-    //测试脚本的热重载
-    @Test
-    public void testScript3() throws Exception{
-        //根据配置,加载的应该是flow.xml,执行原来的规则
-        LiteflowResponse responseOld = flowExecutor.execute2Resp("chain2", "arg");
-        Assert.assertTrue(responseOld.isSuccess());
-        Assert.assertEquals("d==>s2[条件脚本]==>a", responseOld.getExecuteStepStr());
-        //更改规则,重新加载,更改的规则内容从flow_update.xml里读取,这里只是为了模拟下获取新的内容。不一定是从文件中读取
-        String newContent = ResourceUtil.readUtf8Str("classpath: /json-script/flow_update.json");
-        //进行刷新
-        FlowBus.refreshFlowMetaData(FlowParserTypeEnum.TYPE_JSON, newContent);
-
-        //重新执行chain2这个链路,结果会变
-        LiteflowResponse responseNew = flowExecutor.execute2Resp("chain2", "arg");
-        Assert.assertTrue(responseNew.isSuccess());
-        Assert.assertEquals("d==>s2[条件脚本_改]==>b==>s3[普通脚本_新增]", responseNew.getExecuteStepStr());
-    }
-}
diff --git a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/java/com/yomahub/liteflow/test/script/groovy/LiteflowXmlScriptFileGroovyTest.java b/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/java/com/yomahub/liteflow/test/script/groovy/LiteflowXmlScriptFileGroovyTest.java
deleted file mode 100644
index 4fca9bcb9..000000000
--- a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/java/com/yomahub/liteflow/test/script/groovy/LiteflowXmlScriptFileGroovyTest.java
+++ /dev/null
@@ -1,93 +0,0 @@
-package com.yomahub.liteflow.test.script.groovy;
-
-import cn.hutool.core.io.resource.ResourceUtil;
-import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.flow.LiteflowResponse;
-import com.yomahub.liteflow.enums.FlowParserTypeEnum;
-import com.yomahub.liteflow.flow.FlowBus;
-import com.yomahub.liteflow.slot.DefaultContext;
-import com.yomahub.liteflow.test.BaseTest;
-import org.junit.Assert;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.test.context.TestPropertySource;
-import org.springframework.test.context.junit4.SpringRunner;
-
-import javax.annotation.Resource;
-
-
-/**
- * 测试springboot下的groovy脚本组件,基于xml配置,file脚本
- * @author Bryan.Zhang
- * @since 2.6.4
- */
-@RunWith(SpringRunner.class)
-@TestPropertySource(value = "classpath:/xml-script-file/application.properties")
-@SpringBootTest(classes = LiteflowXmlScriptFileGroovyTest.class)
-@EnableAutoConfiguration
-@ComponentScan({"com.yomahub.liteflow.test.script.groovy.cmp"})
-public class LiteflowXmlScriptFileGroovyTest extends BaseTest {
-
-    @Resource
-    private FlowExecutor flowExecutor;
-
-    //测试普通脚本节点
-    @Test
-    public void testScript1() {
-        LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg");
-        DefaultContext context = response.getFirstContextBean();
-        Assert.assertTrue(response.isSuccess());
-        Assert.assertEquals(Integer.valueOf(6), context.getData("s1"));
-    }
-
-    //测试条件脚本节点
-    @Test
-    public void testScript2() {
-        LiteflowResponse response = flowExecutor.execute2Resp("chain2", "arg");
-        Assert.assertTrue(response.isSuccess());
-        Assert.assertEquals("d==>s2[条件脚本]==>a", response.getExecuteStepStr());
-    }
-
-    //测试脚本的热重载
-    @Test
-    public void testScript3() throws Exception{
-        //根据配置,加载的应该是flow.xml,执行原来的规则
-        LiteflowResponse responseOld = flowExecutor.execute2Resp("chain2", "arg");
-        Assert.assertTrue(responseOld.isSuccess());
-        Assert.assertEquals("d==>s2[条件脚本]==>a", responseOld.getExecuteStepStr());
-        //更改规则,重新加载,更改的规则内容从flow_update.xml里读取,这里只是为了模拟下获取新的内容。不一定是从文件中读取
-        String newContent = ResourceUtil.readUtf8Str("classpath: /xml-script-file/flow_update.xml");
-        //进行刷新
-        FlowBus.refreshFlowMetaData(FlowParserTypeEnum.TYPE_XML, newContent);
-
-        //重新执行chain2这个链路,结果会变
-        LiteflowResponse responseNew = flowExecutor.execute2Resp("chain2", "arg");
-        Assert.assertTrue(responseNew.isSuccess());
-        Assert.assertEquals("d==>s2[条件脚本_改]==>b==>s3[普通脚本_新增]", responseNew.getExecuteStepStr());
-    }
-
-    //测试脚本&规则平滑重载刷新
-    @Test
-    public void testScript4() throws Exception{
-        new Thread(() -> {
-            try{
-                Thread.sleep(2000L);
-                //更改规则,重新加载,更改的规则内容从flow_update.xml里读取,这里只是为了模拟下获取新的内容。不一定是从文件中读取
-                String newContent = ResourceUtil.readUtf8Str("classpath: /xml-script-file/flow_update.xml");
-                //进行刷新
-                FlowBus.refreshFlowMetaData(FlowParserTypeEnum.TYPE_XML, newContent);
-            }catch (Exception e){
-                e.printStackTrace();
-            }
-        }).start();
-
-        for (int i = 0; i < 300; i++) {
-            LiteflowResponse responseNew = flowExecutor.execute2Resp("chain2", "arg");
-            Assert.assertTrue(responseNew.isSuccess());
-            Thread.sleep(10L);
-        }
-    }
-}
diff --git a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/java/com/yomahub/liteflow/test/script/groovy/LiteflowXmlScriptGroovyTest.java b/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/java/com/yomahub/liteflow/test/script/groovy/LiteflowXmlScriptGroovyTest.java
deleted file mode 100644
index a8b3c15ed..000000000
--- a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/java/com/yomahub/liteflow/test/script/groovy/LiteflowXmlScriptGroovyTest.java
+++ /dev/null
@@ -1,71 +0,0 @@
-package com.yomahub.liteflow.test.script.groovy;
-
-import cn.hutool.core.io.resource.ResourceUtil;
-import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.flow.LiteflowResponse;
-import com.yomahub.liteflow.enums.FlowParserTypeEnum;
-import com.yomahub.liteflow.flow.FlowBus;
-import com.yomahub.liteflow.slot.DefaultContext;
-import com.yomahub.liteflow.test.BaseTest;
-import org.junit.Assert;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.test.context.TestPropertySource;
-import org.springframework.test.context.junit4.SpringRunner;
-
-import javax.annotation.Resource;
-
-
-/**
- * 测试springboot下的groovy脚本组件,基于xml配置
- * @author Bryan.Zhang
- * @since 2.6.0
- */
-@RunWith(SpringRunner.class)
-@TestPropertySource(value = "classpath:/xml-script/application.properties")
-@SpringBootTest(classes = LiteflowXmlScriptGroovyTest.class)
-@EnableAutoConfiguration
-@ComponentScan({"com.yomahub.liteflow.test.script.groovy.cmp"})
-public class LiteflowXmlScriptGroovyTest extends BaseTest {
-
-    @Resource
-    private FlowExecutor flowExecutor;
-
-    //测试普通脚本节点
-    @Test
-    public void testScript1() {
-        LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg");
-        DefaultContext context = response.getFirstContextBean();
-        Assert.assertTrue(response.isSuccess());
-        Assert.assertEquals(Integer.valueOf(6), context.getData("s1"));
-    }
-
-    //测试条件脚本节点
-    @Test
-    public void testScript2() {
-        LiteflowResponse response = flowExecutor.execute2Resp("chain2", "arg");
-        Assert.assertTrue(response.isSuccess());
-        Assert.assertEquals("d==>s2[条件脚本]==>a", response.getExecuteStepStr());
-    }
-
-    //测试脚本的热重载
-    @Test
-    public void testScript3() throws Exception{
-        //根据配置,加载的应该是flow.xml,执行原来的规则
-        LiteflowResponse responseOld = flowExecutor.execute2Resp("chain2", "arg");
-        Assert.assertTrue(responseOld.isSuccess());
-        Assert.assertEquals("d==>s2[条件脚本]==>a", responseOld.getExecuteStepStr());
-        //更改规则,重新加载,更改的规则内容从flow_update.xml里读取,这里只是为了模拟下获取新的内容。不一定是从文件中读取
-        String newContent = ResourceUtil.readUtf8Str("classpath: /xml-script/flow_update.xml");
-        //进行刷新
-        FlowBus.refreshFlowMetaData(FlowParserTypeEnum.TYPE_XML, newContent);
-
-        //重新执行chain2这个链路,结果会变
-        LiteflowResponse responseNew = flowExecutor.execute2Resp("chain2", "arg");
-        Assert.assertTrue(responseNew.isSuccess());
-        Assert.assertEquals("d==>s2[条件脚本_改]==>b==>s3[普通脚本_新增]", responseNew.getExecuteStepStr());
-    }
-}
diff --git a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/java/com/yomahub/liteflow/test/script/groovy/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/java/com/yomahub/liteflow/test/script/groovy/cmp/ACmp.java
deleted file mode 100644
index 81882d47a..000000000
--- a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/java/com/yomahub/liteflow/test/script/groovy/cmp/ACmp.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/**
- * 

Title: liteflow

- *

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

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

Title: liteflow

- *

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

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

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.script.groovy.cmp; - -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; - -@LiteflowComponent("d") -public class DCmp extends NodeComponent { - - @Override - public void process() { - DefaultContext context = this.getFirstContextBean(); - context.setData("count",198); - System.out.println("DCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/builder/s1.groovy b/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/builder/s1.groovy deleted file mode 100644 index 02ae4756f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/builder/s1.groovy +++ /dev/null @@ -1,3 +0,0 @@ -Integer a=3 -Integer b=2 -defaultContext.setData("s1",a*b) \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/builder/s2.groovy b/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/builder/s2.groovy deleted file mode 100644 index dc9199dee..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/builder/s2.groovy +++ /dev/null @@ -1,6 +0,0 @@ -Integer count = defaultContext.getData("count") -if(count > 100){ - return "a" -}else{ - return "b" -} \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/json-script-file/application.properties b/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/json-script-file/application.properties deleted file mode 100644 index ab170892a..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/json-script-file/application.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=json-script-file/flow.json \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/json-script-file/flow.json b/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/json-script-file/flow.json deleted file mode 100644 index ec2f7d03d..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/json-script-file/flow.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "flow": { - "nodes": { - "node": [ - { - "id": "s1", - "name": "普通脚本", - "type": "script", - "file": "json-script-file/s1.groovy" - }, - { - "id": "s2", - "name": "条件脚本", - "type": "switch_script", - "file": "json-script-file/s2.groovy" - } - ] - }, - "chain": [ - { - "name": "chain1", - "condition": [ - {"type": "then", "value": "a,b,c,s1"} - ] - }, - { - "name": "chain2", - "condition": [ - {"type": "then", "value": "d,s2(a|b)"} - ] - } - ] - } -} \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/json-script-file/flow_update.json b/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/json-script-file/flow_update.json deleted file mode 100644 index 6718f4233..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/json-script-file/flow_update.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "flow": { - "nodes": { - "node": [ - { - "id": "s1", - "name": "普通脚本", - "type": "script", - "file": "json-script-file/s1.groovy" - }, - { - "id": "s2", - "name": "条件脚本_改", - "type": "switch_script", - "file": "json-script-file/s2_update.groovy" - }, - { - "id": "s3", - "name": "普通脚本_新增", - "type": "script", - "file": "json-script-file/s2_update.groovy" - } - ] - }, - "chain": [ - { - "name": "chain1", - "condition": [ - {"type": "then", "value": "a,b,c,s1"} - ] - }, - { - "name": "chain2", - "condition": [ - {"type": "then", "value": "d,s2(a|b),s3"} - ] - } - ] - } -} \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/json-script-file/s1.groovy b/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/json-script-file/s1.groovy deleted file mode 100644 index 02ae4756f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/json-script-file/s1.groovy +++ /dev/null @@ -1,3 +0,0 @@ -Integer a=3 -Integer b=2 -defaultContext.setData("s1",a*b) \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/json-script-file/s2.groovy b/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/json-script-file/s2.groovy deleted file mode 100644 index dc9199dee..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/json-script-file/s2.groovy +++ /dev/null @@ -1,6 +0,0 @@ -Integer count = defaultContext.getData("count") -if(count > 100){ - return "a" -}else{ - return "b" -} \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/json-script-file/s2_update.groovy b/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/json-script-file/s2_update.groovy deleted file mode 100644 index 287b639d2..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/json-script-file/s2_update.groovy +++ /dev/null @@ -1,6 +0,0 @@ -Integer count = defaultContext.getData("count") -if(count > 150){ - return "b" -}else{ - return "a" -} \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/json-script-file/s3.groovy b/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/json-script-file/s3.groovy deleted file mode 100644 index 144001ec7..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/json-script-file/s3.groovy +++ /dev/null @@ -1,4 +0,0 @@ -Integer a=3 -Integer b=2 -Integer c=10 -defaultContext.setData("s1",a*b+c) \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/json-script/application.properties b/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/json-script/application.properties deleted file mode 100644 index 42559d0b3..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/json-script/application.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=json-script/flow.json \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/json-script/flow.json b/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/json-script/flow.json deleted file mode 100644 index 550fc0416..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/json-script/flow.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "flow": { - "nodes": { - "node": [ - { - "id": "s1", - "name": "普通脚本", - "type": "script", - "value": "def a=3;def b=2;defaultContext.setData(\"s1\",a*b);" - }, - { - "id": "s2", - "name": "条件脚本", - "type": "switch_script", - "value": "count = defaultContext.getData(\"count\");if(count > 100){return \"a\";}else{return \"b\";}" - }, - { - "id": "s3", - "name": "普通脚本2", - "type": "script", - "value": "def a=30;def b=2;defaultContext.setData(\"s1\",a*b);" - } - ] - }, - "chain": [ - { - "name": "chain1", - "condition": [ - {"type": "then", "value": "a,b,c,s1"} - ] - }, - { - "name": "chain2", - "condition": [ - {"type": "then", "value": "d,s2(a|b)"} - ] - } - ] - } -} \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/json-script/flow_update.json b/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/json-script/flow_update.json deleted file mode 100644 index f5ac0d10d..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/json-script/flow_update.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "flow": { - "nodes": { - "node": [ - { - "id": "s1", - "name": "普通脚本", - "type": "script", - "value": "def a=3;def b=2;defaultContext.setData(\"s1\",a*b);" - }, - { - "id": "s2", - "name": "条件脚本_改", - "type": "switch_script", - "value": "count = defaultContext.getData(\"count\");if(count > 150){return \"b\";}else{return \"a\";}" - }, - { - "id": "s3", - "name": "普通脚本_新增", - "type": "script", - "value": "def a=3;def b=2;def c=10;defaultContext.setData(\"s1\",a*b+c);" - } - ] - }, - "chain": [ - { - "name": "chain1", - "condition": [ - {"type": "then", "value": "a,b,c,s1"} - ] - }, - { - "name": "chain2", - "condition": [ - {"type": "then", "value": "d,s2(a|b),s3"} - ] - } - ] - } -} \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/xml-script-file/application.properties b/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/xml-script-file/application.properties deleted file mode 100644 index 09ee93069..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/xml-script-file/application.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=xml-script-file/flow.xml \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/xml-script-file/flow.xml b/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/xml-script-file/flow.xml deleted file mode 100644 index 6dee5b7fd..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/xml-script-file/flow.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/xml-script-file/flow_update.xml b/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/xml-script-file/flow_update.xml deleted file mode 100644 index 5be65c7ae..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/xml-script-file/flow_update.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/xml-script-file/s1.groovy b/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/xml-script-file/s1.groovy deleted file mode 100644 index 02ae4756f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/xml-script-file/s1.groovy +++ /dev/null @@ -1,3 +0,0 @@ -Integer a=3 -Integer b=2 -defaultContext.setData("s1",a*b) \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/xml-script-file/s2.groovy b/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/xml-script-file/s2.groovy deleted file mode 100644 index dc9199dee..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/xml-script-file/s2.groovy +++ /dev/null @@ -1,6 +0,0 @@ -Integer count = defaultContext.getData("count") -if(count > 100){ - return "a" -}else{ - return "b" -} \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/xml-script-file/s2_update.groovy b/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/xml-script-file/s2_update.groovy deleted file mode 100644 index 287b639d2..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/xml-script-file/s2_update.groovy +++ /dev/null @@ -1,6 +0,0 @@ -Integer count = defaultContext.getData("count") -if(count > 150){ - return "b" -}else{ - return "a" -} \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/xml-script-file/s3.groovy b/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/xml-script-file/s3.groovy deleted file mode 100644 index 39a48f4cd..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/xml-script-file/s3.groovy +++ /dev/null @@ -1,4 +0,0 @@ -Integer a=3 -Integer b=2 -Integer c=10 -defaultContext.setData("s1",a*b+c); \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/xml-script/application.properties b/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/xml-script/application.properties deleted file mode 100644 index 692fc494b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/xml-script/application.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=xml-script/flow.xml \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/xml-script/flow.xml b/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/xml-script/flow.xml deleted file mode 100644 index 38cb361f9..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/xml-script/flow.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - 100){ - return "a"; - }else{ - return "b"; - } - ]]> - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/xml-script/flow_update.xml b/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/xml-script/flow_update.xml deleted file mode 100644 index 836555d65..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-groovy-springboot/src/test/resources/xml-script/flow_update.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - 150){ - return "b"; - }else{ - return "a"; - } - ]]> - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/pom.xml b/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/pom.xml deleted file mode 100644 index 3a9255167..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/pom.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - liteflow-testcase-old - com.yomahub - ${revision} - ../pom.xml - - 4.0.0 - - liteflow-testcase-script-qlexpress-springboot - - - - com.yomahub - liteflow-spring-boot-starter - ${revision} - - - - org.springframework.boot - spring-boot-starter-test - - - org.aspectj - aspectjweaver - - - com.yomahub - liteflow-script-qlexpress - ${revision} - - - - - - - org.springframework.boot - spring-boot-maven-plugin - ${springboot.version} - - - org.apache.maven.plugins - maven-deploy-plugin - 2.8.2 - - true - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/java/com/yomahub/liteflow/test/BaseTest.java b/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/java/com/yomahub/liteflow/test/BaseTest.java deleted file mode 100644 index 64886670f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/java/com/yomahub/liteflow/test/BaseTest.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.yomahub.liteflow.test; - -import com.yomahub.liteflow.flow.FlowBus; -import com.yomahub.liteflow.property.LiteflowConfigGetter; -import com.yomahub.liteflow.spi.holder.SpiFactoryCleaner; -import com.yomahub.liteflow.spring.ComponentScanner; -import com.yomahub.liteflow.thread.ExecutorHelper; -import org.junit.AfterClass; - -public class BaseTest { - - @AfterClass - public static void cleanScanCache(){ - ComponentScanner.cleanCache(); - FlowBus.cleanCache(); - ExecutorHelper.loadInstance().clearExecutorServiceMap(); - SpiFactoryCleaner.clean(); - LiteflowConfigGetter.clean(); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/java/com/yomahub/liteflow/test/script/qlexpress/LiteFlowXmlScriptBuilderQLExpressTest.java b/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/java/com/yomahub/liteflow/test/script/qlexpress/LiteFlowXmlScriptBuilderQLExpressTest.java deleted file mode 100644 index 29121bb49..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/java/com/yomahub/liteflow/test/script/qlexpress/LiteFlowXmlScriptBuilderQLExpressTest.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.yomahub.liteflow.test.script.qlexpress; - -import com.yomahub.liteflow.builder.LiteFlowChainBuilder; -import com.yomahub.liteflow.builder.LiteFlowConditionBuilder; -import com.yomahub.liteflow.builder.LiteFlowNodeBuilder; -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.enums.NodeTypeEnum; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -@RunWith(SpringRunner.class) -@SpringBootTest(classes = LiteFlowXmlScriptBuilderQLExpressTest.class) -@EnableAutoConfiguration -public class LiteFlowXmlScriptBuilderQLExpressTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //测试通过builder方式运行普通script节点,以脚本文本的方式运行 - @Test - public void testBuilderScript1() { - LiteFlowNodeBuilder.createNode().setId("a") - .setName("组件A") - .setType(NodeTypeEnum.COMMON) - .setClazz("com.yomahub.liteflow.test.script.qlexpress.cmp.ACmp") - .build(); - LiteFlowNodeBuilder.createNode().setId("b") - .setName("组件B") - .setType(NodeTypeEnum.COMMON) - .setClazz("com.yomahub.liteflow.test.script.qlexpress.cmp.BCmp") - .build(); - LiteFlowNodeBuilder.createNode().setId("c") - .setName("组件C") - .setType(NodeTypeEnum.COMMON) - .setClazz("com.yomahub.liteflow.test.script.qlexpress.cmp.CCmp") - .build(); - LiteFlowNodeBuilder.createScriptNode() - .setId("s1") - .setName("普通脚本S1") - .setType(NodeTypeEnum.SCRIPT) - .setScript("a=3;b=2;defaultContext.setData(\"s1\",a*b);") - .build(); - - LiteFlowChainBuilder.createChain().setChainName("chain1") - .setCondition(LiteFlowConditionBuilder.createThenCondition().setValue("a,b,c,s1").build()) - .build(); - - - LiteflowResponse response = flowExecutor.execute2Resp("chain1","arg1"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals(Integer.valueOf(6), context.getData("s1")); - } - - //测试通过builder方式运行普通script节点,以file的方式运行 - @Test - public void testBuilderScript2() { - LiteFlowNodeBuilder.createNode().setId("d") - .setName("组件D") - .setType(NodeTypeEnum.COMMON) - .setClazz("com.yomahub.liteflow.test.script.qlexpress.cmp.DCmp") - .build(); - LiteFlowNodeBuilder.createNode().setId("s2") - .setName("条件脚本S2") - .setType(NodeTypeEnum.SWITCH_SCRIPT) - .setFile("builder/s2.ql") - .build(); - LiteFlowNodeBuilder.createNode().setId("a") - .setName("组件A") - .setType(NodeTypeEnum.COMMON) - .setClazz("com.yomahub.liteflow.test.script.qlexpress.cmp.ACmp") - .build(); - LiteFlowNodeBuilder.createNode().setId("b") - .setName("组件B") - .setType(NodeTypeEnum.COMMON) - .setClazz("com.yomahub.liteflow.test.script.qlexpress.cmp.BCmp") - .build(); - - LiteFlowChainBuilder.createChain().setChainName("chain2") - .setCondition(LiteFlowConditionBuilder.createThenCondition().setValue("d,s2(a|b)").build()) - .build(); - - - LiteflowResponse response = flowExecutor.execute2Resp("chain2","arg1"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("d[组件D]==>s2[条件脚本S2]==>b[组件B]", response.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/java/com/yomahub/liteflow/test/script/qlexpress/LiteflowJsonScriptFileQLExpressTest.java b/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/java/com/yomahub/liteflow/test/script/qlexpress/LiteflowJsonScriptFileQLExpressTest.java deleted file mode 100644 index 69b81a266..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/java/com/yomahub/liteflow/test/script/qlexpress/LiteflowJsonScriptFileQLExpressTest.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.yomahub.liteflow.test.script.qlexpress; - -import cn.hutool.core.io.resource.ResourceUtil; -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.enums.FlowParserTypeEnum; -import com.yomahub.liteflow.flow.FlowBus; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - - -/** - * 测试springboot下的脚本组件 - * @author Bryan.Zhang - * @since 2.6.0 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/json-script-file/application.properties") -@SpringBootTest(classes = LiteflowJsonScriptFileQLExpressTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.script.qlexpress.cmp"}) -public class LiteflowJsonScriptFileQLExpressTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //测试普通脚本节点 - @Test - public void testScript1() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals(Integer.valueOf(6), context.getData("s1")); - } - - //测试条件脚本节点 - @Test - public void testScript2() { - LiteflowResponse response = flowExecutor.execute2Resp("chain2", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("d==>s2[条件脚本]==>b", response.getExecuteStepStr()); - } - - @Test - public void testScript3() throws Exception{ - //根据配置,加载的应该是flow.xml,执行原来的规则 - LiteflowResponse responseOld = flowExecutor.execute2Resp("chain2", "arg"); - Assert.assertTrue(responseOld.isSuccess()); - Assert.assertEquals("d==>s2[条件脚本]==>b", responseOld.getExecuteStepStr()); - //更改规则,重新加载,更改的规则内容从flow_update.xml里读取,这里只是为了模拟下获取新的内容。不一定是从文件中读取 - String newContent = ResourceUtil.readUtf8Str("classpath: /json-script-file/flow_update.json"); - //进行刷新 - FlowBus.refreshFlowMetaData(FlowParserTypeEnum.TYPE_JSON, newContent); - - //重新执行chain2这个链路,结果会变 - LiteflowResponse responseNew = flowExecutor.execute2Resp("chain2", "arg"); - Assert.assertTrue(responseNew.isSuccess()); - Assert.assertEquals("d==>s2[条件脚本_改]==>a==>s3[普通脚本_新增]", responseNew.getExecuteStepStr()); - } - - //测试脚本&规则平滑重载刷新 - @Test - public void testScript4() throws Exception{ - new Thread(() -> { - try{ - Thread.sleep(2000L); - //更改规则,重新加载,更改的规则内容从flow_update.xml里读取,这里只是为了模拟下获取新的内容。不一定是从文件中读取 - String newContent = ResourceUtil.readUtf8Str("classpath: /json-script-file/flow_update.json"); - //进行刷新 - FlowBus.refreshFlowMetaData(FlowParserTypeEnum.TYPE_JSON, newContent); - }catch (Exception e){ - e.printStackTrace(); - } - }).start(); - - for (int i = 0; i < 300; i++) { - LiteflowResponse responseNew = flowExecutor.execute2Resp("chain2", "arg"); - Assert.assertTrue(responseNew.isSuccess()); - Thread.sleep(10L); - } - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/java/com/yomahub/liteflow/test/script/qlexpress/LiteflowJsonScriptQLExpressTest.java b/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/java/com/yomahub/liteflow/test/script/qlexpress/LiteflowJsonScriptQLExpressTest.java deleted file mode 100644 index f8321769c..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/java/com/yomahub/liteflow/test/script/qlexpress/LiteflowJsonScriptQLExpressTest.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.yomahub.liteflow.test.script.qlexpress; - -import cn.hutool.core.io.resource.ResourceUtil; -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.enums.FlowParserTypeEnum; -import com.yomahub.liteflow.flow.FlowBus; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - - -/** - * 测试springboot下的脚本组件 - * @author Bryan.Zhang - * @since 2.6.0 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/json-script/application.properties") -@SpringBootTest(classes = LiteflowJsonScriptQLExpressTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.script.qlexpress.cmp"}) -public class LiteflowJsonScriptQLExpressTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //测试普通脚本节点 - @Test - public void testScript1() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals(Integer.valueOf(6), context.getData("s1")); - } - - //测试条件脚本节点 - @Test - public void testScript2() { - LiteflowResponse response = flowExecutor.execute2Resp("chain2", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("d==>s2[条件脚本]==>b", response.getExecuteStepStr()); - } - - @Test - public void testScript3() throws Exception{ - //根据配置,加载的应该是flow.xml,执行原来的规则 - LiteflowResponse responseOld = flowExecutor.execute2Resp("chain2", "arg"); - Assert.assertTrue(responseOld.isSuccess()); - Assert.assertEquals("d==>s2[条件脚本]==>b", responseOld.getExecuteStepStr()); - //更改规则,重新加载,更改的规则内容从flow_update.xml里读取,这里只是为了模拟下获取新的内容。不一定是从文件中读取 - String newContent = ResourceUtil.readUtf8Str("classpath: /json-script/flow_update.json"); - //进行刷新 - FlowBus.refreshFlowMetaData(FlowParserTypeEnum.TYPE_JSON, newContent); - - //重新执行chain2这个链路,结果会变 - LiteflowResponse responseNew = flowExecutor.execute2Resp("chain2", "arg"); - Assert.assertTrue(responseNew.isSuccess()); - Assert.assertEquals("d==>s2[条件脚本_改]==>a==>s3[普通脚本_新增]", responseNew.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/java/com/yomahub/liteflow/test/script/qlexpress/LiteflowXmlScriptFileQLExpressTest.java b/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/java/com/yomahub/liteflow/test/script/qlexpress/LiteflowXmlScriptFileQLExpressTest.java deleted file mode 100644 index af745da03..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/java/com/yomahub/liteflow/test/script/qlexpress/LiteflowXmlScriptFileQLExpressTest.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.yomahub.liteflow.test.script.qlexpress; - -import cn.hutool.core.io.resource.ResourceUtil; -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.enums.FlowParserTypeEnum; -import com.yomahub.liteflow.flow.FlowBus; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - - -/** - * 测试springboot下的脚本组件 - * @author Bryan.Zhang - * @since 2.6.0 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/xml-script-file/application.properties") -@SpringBootTest(classes = LiteflowXmlScriptFileQLExpressTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.script.qlexpress.cmp"}) -public class LiteflowXmlScriptFileQLExpressTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //测试普通脚本节点 - @Test - public void testScript1() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals(Integer.valueOf(6), context.getData("s1")); - } - - //测试条件脚本节点 - @Test - public void testScript2() { - LiteflowResponse response = flowExecutor.execute2Resp("chain2", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("d==>s2[条件脚本]==>b", response.getExecuteStepStr()); - } - - @Test - public void testScript3() throws Exception{ - //根据配置,加载的应该是flow.xml,执行原来的规则 - LiteflowResponse responseOld = flowExecutor.execute2Resp("chain2", "arg"); - Assert.assertTrue(responseOld.isSuccess()); - Assert.assertEquals("d==>s2[条件脚本]==>b", responseOld.getExecuteStepStr()); - //更改规则,重新加载,更改的规则内容从flow_update.xml里读取,这里只是为了模拟下获取新的内容。不一定是从文件中读取 - String newContent = ResourceUtil.readUtf8Str("classpath: /xml-script-file/flow_update.xml"); - //进行刷新 - FlowBus.refreshFlowMetaData(FlowParserTypeEnum.TYPE_XML, newContent); - - //重新执行chain2这个链路,结果会变 - LiteflowResponse responseNew = flowExecutor.execute2Resp("chain2", "arg"); - Assert.assertTrue(responseNew.isSuccess()); - Assert.assertEquals("d==>s2[条件脚本_改]==>a==>s3[普通脚本_新增]", responseNew.getExecuteStepStr()); - } - - //测试脚本&规则平滑重载刷新 - @Test - public void testScript4() throws Exception{ - new Thread(() -> { - try{ - Thread.sleep(2000L); - //更改规则,重新加载,更改的规则内容从flow_update.xml里读取,这里只是为了模拟下获取新的内容。不一定是从文件中读取 - String newContent = ResourceUtil.readUtf8Str("classpath: /xml-script-file/flow_update.xml"); - //进行刷新 - FlowBus.refreshFlowMetaData(FlowParserTypeEnum.TYPE_XML, newContent); - }catch (Exception e){ - e.printStackTrace(); - } - }).start(); - - for (int i = 0; i < 300; i++) { - LiteflowResponse responseNew = flowExecutor.execute2Resp("chain2", "arg"); - Assert.assertTrue(responseNew.isSuccess()); - Thread.sleep(10L); - } - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/java/com/yomahub/liteflow/test/script/qlexpress/LiteflowXmlScriptQLExpressTest.java b/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/java/com/yomahub/liteflow/test/script/qlexpress/LiteflowXmlScriptQLExpressTest.java deleted file mode 100644 index ba4680a76..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/java/com/yomahub/liteflow/test/script/qlexpress/LiteflowXmlScriptQLExpressTest.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.yomahub.liteflow.test.script.qlexpress; - -import cn.hutool.core.io.resource.ResourceUtil; -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.enums.FlowParserTypeEnum; -import com.yomahub.liteflow.flow.FlowBus; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - - -/** - * 测试springboot下的脚本组件 - * @author Bryan.Zhang - * @since 2.6.0 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/xml-script/application.properties") -@SpringBootTest(classes = LiteflowXmlScriptQLExpressTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.script.qlexpress.cmp"}) -public class LiteflowXmlScriptQLExpressTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //测试普通脚本节点 - @Test - public void testScript1() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals(Integer.valueOf(6), context.getData("s1")); - } - - //测试条件脚本节点 - @Test - public void testScript2() { - LiteflowResponse response = flowExecutor.execute2Resp("chain2", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("d==>s2[条件脚本]==>b", response.getExecuteStepStr()); - } - - @Test - public void testScript3() throws Exception{ - //根据配置,加载的应该是flow.xml,执行原来的规则 - LiteflowResponse responseOld = flowExecutor.execute2Resp("chain2", "arg"); - Assert.assertTrue(responseOld.isSuccess()); - Assert.assertEquals("d==>s2[条件脚本]==>b", responseOld.getExecuteStepStr()); - //更改规则,重新加载,更改的规则内容从flow_update.xml里读取,这里只是为了模拟下获取新的内容。不一定是从文件中读取 - String newContent = ResourceUtil.readUtf8Str("classpath: /xml-script/flow_update.xml"); - //进行刷新 - FlowBus.refreshFlowMetaData(FlowParserTypeEnum.TYPE_XML, newContent); - - //重新执行chain2这个链路,结果会变 - LiteflowResponse responseNew = flowExecutor.execute2Resp("chain2", "arg"); - Assert.assertTrue(responseNew.isSuccess()); - Assert.assertEquals("d==>s2[条件脚本_改]==>a==>s3[普通脚本_新增]", responseNew.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/java/com/yomahub/liteflow/test/script/qlexpress/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/java/com/yomahub/liteflow/test/script/qlexpress/cmp/ACmp.java deleted file mode 100644 index 0db8d6bf5..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/java/com/yomahub/liteflow/test/script/qlexpress/cmp/ACmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

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

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.script.qlexpress.cmp; - -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; - -@LiteflowComponent("d") -public class DCmp extends NodeComponent { - - @Override - public void process() { - DefaultContext context = this.getFirstContextBean(); - context.setData("count",97); - System.out.println("DCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/builder/s1.ql b/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/builder/s1.ql deleted file mode 100644 index 560850daf..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/builder/s1.ql +++ /dev/null @@ -1,3 +0,0 @@ -a=3; -b=2; -defaultContext.setData("s1",a*b); \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/builder/s2.ql b/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/builder/s2.ql deleted file mode 100644 index e27901531..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/builder/s2.ql +++ /dev/null @@ -1,6 +0,0 @@ -count = defaultContext.getData("count"); -if(count > 100){ - return "a"; -}else{ - return "b"; -} \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/json-script-file/application.properties b/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/json-script-file/application.properties deleted file mode 100644 index ab170892a..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/json-script-file/application.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=json-script-file/flow.json \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/json-script-file/flow.json b/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/json-script-file/flow.json deleted file mode 100644 index f6973fec8..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/json-script-file/flow.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "flow": { - "nodes": { - "node": [ - { - "id": "s1", - "name": "普通脚本", - "type": "script", - "file": "json-script-file/s1.ql" - }, - { - "id": "s2", - "name": "条件脚本", - "type": "switch_script", - "file": "json-script-file/s2.ql" - } - ] - }, - "chain": [ - { - "name": "chain1", - "condition": [ - {"type": "then", "value": "a,b,c,s1"} - ] - }, - { - "name": "chain2", - "condition": [ - {"type": "then", "value": "d,s2(a|b)"} - ] - } - ] - } -} \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/json-script-file/flow_update.json b/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/json-script-file/flow_update.json deleted file mode 100644 index b1bde2dcd..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/json-script-file/flow_update.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "flow": { - "nodes": { - "node": [ - { - "id": "s1", - "name": "普通脚本", - "type": "script", - "file": "json-script-file/s1.ql" - }, - { - "id": "s2", - "name": "条件脚本_改", - "type": "switch_script", - "file": "json-script-file/s2_update.ql" - }, - { - "id": "s3", - "name": "普通脚本_新增", - "type": "script", - "file": "json-script-file/s3.ql" - } - ] - }, - "chain": [ - { - "name": "chain1", - "condition": [ - {"type": "then", "value": "a,b,c,s1"} - ] - }, - { - "name": "chain2", - "condition": [ - {"type": "then", "value": "d,s2(a|b),s3"} - ] - } - ] - } -} \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/json-script-file/s1.ql b/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/json-script-file/s1.ql deleted file mode 100644 index 560850daf..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/json-script-file/s1.ql +++ /dev/null @@ -1,3 +0,0 @@ -a=3; -b=2; -defaultContext.setData("s1",a*b); \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/json-script-file/s2.ql b/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/json-script-file/s2.ql deleted file mode 100644 index e27901531..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/json-script-file/s2.ql +++ /dev/null @@ -1,6 +0,0 @@ -count = defaultContext.getData("count"); -if(count > 100){ - return "a"; -}else{ - return "b"; -} \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/json-script-file/s2_update.ql b/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/json-script-file/s2_update.ql deleted file mode 100644 index ebfa25e4c..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/json-script-file/s2_update.ql +++ /dev/null @@ -1,6 +0,0 @@ -count = defaultContext.getData("count"); -if(count > 150){ - return "b"; -}else{ - return "a"; -} \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/json-script-file/s3.ql b/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/json-script-file/s3.ql deleted file mode 100644 index f7285edbf..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/json-script-file/s3.ql +++ /dev/null @@ -1,4 +0,0 @@ -a=3; -b=2; -c=10; -defaultContext.setData("s1",a*b+c); \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/json-script/application.properties b/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/json-script/application.properties deleted file mode 100644 index 42559d0b3..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/json-script/application.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=json-script/flow.json \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/json-script/flow.json b/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/json-script/flow.json deleted file mode 100644 index 198d13fdd..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/json-script/flow.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "flow": { - "nodes": { - "node": [ - { - "id": "s1", - "name": "普通脚本", - "type": "script", - "value": "a=3;b=2;defaultContext.setData(\"s1\",a*b);" - }, - { - "id": "s2", - "name": "条件脚本", - "type": "switch_script", - "value": "count = defaultContext.getData(\"count\");if(count > 100){return \"a\";}else{return \"b\";}" - }, - { - "id": "s3", - "name": "普通脚本2", - "type": "script", - "value": "a=30;b=2;defaultContext.setData(\"s1\",a*b);" - } - ] - }, - "chain": [ - { - "name": "chain1", - "condition": [ - {"type": "then", "value": "a,b,c,s1"} - ] - }, - { - "name": "chain2", - "condition": [ - {"type": "then", "value": "d,s2(a|b)"} - ] - } - ] - } -} \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/json-script/flow_update.json b/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/json-script/flow_update.json deleted file mode 100644 index 65911de7f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/json-script/flow_update.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "flow": { - "nodes": { - "node": [ - { - "id": "s1", - "name": "普通脚本", - "type": "script", - "value": "a=3;b=2;defaultContext.setData(\"s1\",a*b);" - }, - { - "id": "s2", - "name": "条件脚本_改", - "type": "switch_script", - "value": "count = defaultContext.getData(\"count\");if(count > 150){return \"b\";}else{return \"a\";}" - }, - { - "id": "s3", - "name": "普通脚本_新增", - "type": "script", - "value": "a=3;b=2;c=10;defaultContext.setData(\"s1\",a*b+c);" - } - ] - }, - "chain": [ - { - "name": "chain1", - "condition": [ - {"type": "then", "value": "a,b,c,s1"} - ] - }, - { - "name": "chain2", - "condition": [ - {"type": "then", "value": "d,s2(a|b),s3"} - ] - } - ] - } -} \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/xml-script-file/application.properties b/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/xml-script-file/application.properties deleted file mode 100644 index 09ee93069..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/xml-script-file/application.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=xml-script-file/flow.xml \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/xml-script-file/flow.xml b/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/xml-script-file/flow.xml deleted file mode 100644 index 2e2387cfe..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/xml-script-file/flow.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/xml-script-file/flow_update.xml b/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/xml-script-file/flow_update.xml deleted file mode 100644 index a07c91033..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/xml-script-file/flow_update.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/xml-script-file/s1.ql b/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/xml-script-file/s1.ql deleted file mode 100644 index 560850daf..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/xml-script-file/s1.ql +++ /dev/null @@ -1,3 +0,0 @@ -a=3; -b=2; -defaultContext.setData("s1",a*b); \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/xml-script-file/s2.ql b/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/xml-script-file/s2.ql deleted file mode 100644 index e27901531..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/xml-script-file/s2.ql +++ /dev/null @@ -1,6 +0,0 @@ -count = defaultContext.getData("count"); -if(count > 100){ - return "a"; -}else{ - return "b"; -} \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/xml-script-file/s2_update.ql b/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/xml-script-file/s2_update.ql deleted file mode 100644 index ebfa25e4c..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/xml-script-file/s2_update.ql +++ /dev/null @@ -1,6 +0,0 @@ -count = defaultContext.getData("count"); -if(count > 150){ - return "b"; -}else{ - return "a"; -} \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/xml-script-file/s3.ql b/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/xml-script-file/s3.ql deleted file mode 100644 index f7285edbf..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/xml-script-file/s3.ql +++ /dev/null @@ -1,4 +0,0 @@ -a=3; -b=2; -c=10; -defaultContext.setData("s1",a*b+c); \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/xml-script/application.properties b/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/xml-script/application.properties deleted file mode 100644 index 692fc494b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/xml-script/application.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=xml-script/flow.xml \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/xml-script/flow.xml b/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/xml-script/flow.xml deleted file mode 100644 index caeee84b1..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/xml-script/flow.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - 100){ - return "a"; - }else{ - return "b"; - } - ]]> - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/xml-script/flow_update.xml b/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/xml-script/flow_update.xml deleted file mode 100644 index 49e3e46ee..000000000 --- a/liteflow-testcase-old/liteflow-testcase-script-qlexpress-springboot/src/test/resources/xml-script/flow_update.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - 150){ - return "b"; - }else{ - return "a"; - } - ]]> - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/pom.xml b/liteflow-testcase-old/liteflow-testcase-springboot/pom.xml deleted file mode 100644 index da3a69ca5..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/pom.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - liteflow-testcase-old - com.yomahub - ${revision} - ../pom.xml - - 4.0.0 - - liteflow-testcase-springboot - - - - com.yomahub - liteflow-spring-boot-starter - ${revision} - - - - org.springframework.boot - spring-boot-starter-test - - - org.aspectj - aspectjweaver - - - - - - - org.springframework.boot - spring-boot-maven-plugin - ${springboot.version} - - - org.apache.maven.plugins - maven-deploy-plugin - 2.8.2 - - true - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/BaseTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/BaseTest.java deleted file mode 100644 index 64886670f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/BaseTest.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.yomahub.liteflow.test; - -import com.yomahub.liteflow.flow.FlowBus; -import com.yomahub.liteflow.property.LiteflowConfigGetter; -import com.yomahub.liteflow.spi.holder.SpiFactoryCleaner; -import com.yomahub.liteflow.spring.ComponentScanner; -import com.yomahub.liteflow.thread.ExecutorHelper; -import org.junit.AfterClass; - -public class BaseTest { - - @AfterClass - public static void cleanScanCache(){ - ComponentScanner.cleanCache(); - FlowBus.cleanCache(); - ExecutorHelper.loadInstance().clearExecutorServiceMap(); - SpiFactoryCleaner.clean(); - LiteflowConfigGetter.clean(); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/AbsoluteConfigPathSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/AbsoluteConfigPathSpringbootTest.java deleted file mode 100644 index 02913478c..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/AbsoluteConfigPathSpringbootTest.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.yomahub.liteflow.test.absoluteConfigPath; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * springboot环境下异步线程超时日志打印测试 - * @author Bryan.Zhang - * @since 2.6.4 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/absoluteConfigPath/application.properties") -@SpringBootTest(classes = AbsoluteConfigPathSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.absoluteConfigPath.cmp"}) -public class AbsoluteConfigPathSpringbootTest extends BaseTest { - - private final Logger log = LoggerFactory.getLogger(this.getClass()); - - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testAbsoluteConfig() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/ACmp.java deleted file mode 100644 index 74091479f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/ACmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.absoluteConfigPath.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("b") -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/CCmp.java deleted file mode 100644 index 2da1ea352..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/CCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.absoluteConfigPath.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("c") -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/aop/CustomAOPSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/aop/CustomAOPSpringbootTest.java deleted file mode 100644 index 5eeda18ae..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/aop/CustomAOPSpringbootTest.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.yomahub.liteflow.test.aop; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import com.yomahub.liteflow.test.aop.aspect.CustomAspect; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Import; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * 切面场景单元测试 - * @author Bryan.Zhang - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/aop/application.properties") -@SpringBootTest(classes = CustomAOPSpringbootTest.class) -@EnableAutoConfiguration -@Import(CustomAspect.class) -@ComponentScan({"com.yomahub.liteflow.test.aop.cmp1","com.yomahub.liteflow.test.aop.cmp2"}) -public class CustomAOPSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //测试自定义AOP,串行场景 - @Test - public void testCustomAopS() { - LiteflowResponse response= flowExecutor.execute2Resp("chain1", "it's a request"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("before_after", context.getData("a")); - Assert.assertEquals("before_after", context.getData("b")); - Assert.assertEquals("before_after", context.getData("c")); - } - - //测试自定义AOP,并行场景 - @Test - public void testCustomAopP() { - LiteflowResponse response= flowExecutor.execute2Resp("chain2", "it's a request"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("before_after", context.getData("a")); - Assert.assertEquals("before_after", context.getData("b")); - Assert.assertEquals("before_after", context.getData("c")); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/aop/GlobalAOPSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/aop/GlobalAOPSpringbootTest.java deleted file mode 100644 index 04bcbc997..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/aop/GlobalAOPSpringbootTest.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.yomahub.liteflow.test.aop; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.spring.ComponentScanner; -import com.yomahub.liteflow.test.BaseTest; -import com.yomahub.liteflow.test.aop.aspect.CmpAspect; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Import; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * 切面场景单元测试 - * @author Bryan.Zhang - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/aop/application.properties") -@SpringBootTest(classes = GlobalAOPSpringbootTest.class) -@EnableAutoConfiguration -@Import(CmpAspect.class) -@ComponentScan({"com.yomahub.liteflow.test.aop.cmp1","com.yomahub.liteflow.test.aop.cmp2"}) -public class GlobalAOPSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //测试全局AOP,串行场景 - @Test - public void testGlobalAopS() { - LiteflowResponse response= flowExecutor.execute2Resp("chain1", "it's a request"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("before_after", context.getData("a")); - Assert.assertEquals("before_after", context.getData("b")); - Assert.assertEquals("before_after", context.getData("c")); - Assert.assertEquals("before_after", context.getData("d")); - Assert.assertEquals("before_after", context.getData("e")); - } - - //测试全局AOP,并行场景 - @Test - public void testGlobalAopP() { - LiteflowResponse response= flowExecutor.execute2Resp("chain2", "it's a request"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("before_after", context.getData("a")); - Assert.assertEquals("before_after", context.getData("b")); - Assert.assertEquals("before_after", context.getData("c")); - Assert.assertEquals("before_after", context.getData("d")); - Assert.assertEquals("before_after", context.getData("e")); - } - - @Test - public void testGlobalAopException() { - LiteflowResponse response= flowExecutor.execute2Resp("chain3", "it's a request"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertFalse(response.isSuccess()); - Assert.assertEquals("before_after", context.getData("a")); - Assert.assertEquals("before_after", context.getData("b")); - Assert.assertEquals("before_after", context.getData("c")); - Assert.assertEquals("before_after", context.getData("f")); - } - - @AfterClass - public static void cleanScanCache(){ - BaseTest.cleanScanCache(); - ComponentScanner.cmpAroundAspect = null; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/aop/aspect/CmpAspect.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/aop/aspect/CmpAspect.java deleted file mode 100644 index 3704a146d..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/aop/aspect/CmpAspect.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.yomahub.liteflow.test.aop.aspect; - -import cn.hutool.core.util.StrUtil; -import com.yomahub.liteflow.aop.ICmpAroundAspect; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; - -public class CmpAspect implements ICmpAroundAspect { - @Override - public void beforeProcess(String nodeId, Slot slot) { - DefaultContext context = slot.getFirstContextBean(); - context.setData(nodeId, "before"); - } - - @Override - public void afterProcess(String nodeId, Slot slot) { - DefaultContext context = slot.getFirstContextBean(); - context.setData(nodeId, StrUtil.format("{}_{}", context.getData(nodeId), "after")); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/aop/aspect/CustomAspect.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/aop/aspect/CustomAspect.java deleted file mode 100644 index b2fc0f86a..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/aop/aspect/CustomAspect.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.yomahub.liteflow.test.aop.aspect; - -import cn.hutool.core.util.StrUtil; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; -import org.aspectj.lang.ProceedingJoinPoint; -import org.aspectj.lang.annotation.Around; -import org.aspectj.lang.annotation.Aspect; -import org.aspectj.lang.annotation.Pointcut; - -@Aspect -public class CustomAspect { - - @Pointcut("execution(* com.yomahub.liteflow.test.aop.cmp1.*.process())") - public void cut() { - } - - @Around("cut()") - public Object around(ProceedingJoinPoint jp) throws Throwable { - NodeComponent cmp = (NodeComponent) jp.getThis(); - DefaultContext context = cmp.getFirstContextBean(); - context.setData(cmp.getNodeId(), "before"); - Object returnObj = jp.proceed(); - context.setData(cmp.getNodeId(), StrUtil.format("{}_{}", context.getData(cmp.getNodeId()), "after")); - return returnObj; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp1/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp1/ACmp.java deleted file mode 100644 index 7fd947163..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp1/ACmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.aop.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("a") -public class ACmp extends NodeComponent { - - @Override - public void process() { - System.out.println("Acomp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp1/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp1/BCmp.java deleted file mode 100644 index d99d2a1e6..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp1/BCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.aop.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("b") -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("Bcomp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp1/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp1/CCmp.java deleted file mode 100644 index 7a2181438..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp1/CCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.aop.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("c") -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("Ccomp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp2/DCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp2/DCmp.java deleted file mode 100644 index eb8ae7648..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp2/DCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.aop.cmp2; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("d") -public class DCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("Dcomp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp2/ECmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp2/ECmp.java deleted file mode 100644 index ce0319d44..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp2/ECmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.aop.cmp2; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("e") -public class ECmp extends NodeComponent { - - @Override - public void process() { - System.out.println("Ecomp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp2/FCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp2/FCmp.java deleted file mode 100644 index 0fa254ffe..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp2/FCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.aop.cmp2; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("f") -public class FCmp extends NodeComponent { - - @Override - public void process() { - throw new RuntimeException("test error"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/AsyncNodeSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/AsyncNodeSpringbootTest.java deleted file mode 100644 index 7a3c636cf..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/AsyncNodeSpringbootTest.java +++ /dev/null @@ -1,139 +0,0 @@ -package com.yomahub.liteflow.test.asyncNode; - -import cn.hutool.core.collection.ListUtil; -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import com.yomahub.liteflow.test.asyncNode.exception.TestException; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * 测试隐式调用子流程 - * 单元测试 - * - * @author ssss - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/asyncNode/application.properties") -@SpringBootTest(classes = AsyncNodeSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.asyncNode.cmp"}) -public class AsyncNodeSpringbootTest extends BaseTest { - @Resource - private FlowExecutor flowExecutor; - - /***** - * 标准chain 嵌套选择 嵌套子chain进行执行 - * 验证了when情况下 多个node是并行执行 - * 验证了默认参数情况下 when可以加载执行 - * **/ - @Test - public void testAsyncFlow1() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "it's a base request"); - Assert.assertTrue(response.isSuccess()); - System.out.println(response.getExecuteStepStr()); - } - - //这个和test1有点类似,只不过进一步验证了步骤 - @Test - public void testAsyncFlow2() { - LiteflowResponse response = flowExecutor.execute2Resp("chain2", "it's a base request"); - Assert.assertTrue(ListUtil.toList("b==>j==>g==>f==>h","b==>j==>g==>h==>f", - "b==>j==>h==>g==>f","b==>j==>h==>f==>g", - "b==>j==>f==>h==>g","b==>j==>f==>g==>h" - ).contains(response.getExecuteStepStr())); - } - - //测试errorResume,默认的errorResume为false,这里测试默认的 - @Test - public void testAsyncFlow3_1() { - LiteflowResponse response = flowExecutor.execute2Resp("chain3-1", "it's a base request"); - Assert.assertFalse(response.isSuccess()); - Assert.assertEquals(response.getSlot().getException().getClass(), TestException.class); - } - - //测试errorResume,默认的errorResume为false,这里设置为true - @Test - public void testAsyncFlow3_2() { - LiteflowResponse response = flowExecutor.execute2Resp("chain3-2", "it's a base request"); - Assert.assertTrue(response.isSuccess()); - } - - //相同group的并行组,会合并,并且errorResume根据第一个when来,这里第一个when配置了不抛错 - @Test - public void testAsyncFlow4() { - LiteflowResponse response = flowExecutor.execute2Resp("chain4", "it's a base request"); - //因为不记录错误,所以最终结果是true - Assert.assertTrue(response.isSuccess()); - //因为是并行组,所以即便抛错了,其他组件也会执行,i在流程里配置了2遍,i抛错,但是也执行了2遍,这里验证下 - DefaultContext context = response.getFirstContextBean(); - Integer count = context.getData("count"); - Assert.assertEquals(new Integer(2), count); - //因为配置了不抛错,所以response里的cause应该为null - Assert.assertNull(response.getCause()); - } - - //相同group的并行组,会合并,并且errorResume根据第一个when来,这里第一个when配置了会抛错 - @Test - public void testAsyncFlow5() throws Exception { - LiteflowResponse response = flowExecutor.execute2Resp("chain5", "it's a base request"); - //整个并行组是报错的,所以最终结果是false - Assert.assertFalse(response.isSuccess()); - //因为是并行组,所以即便抛错了,其他组件也会执行,i在流程里配置了2遍,i抛错,但是也执行了2遍,这里验证下 - DefaultContext context = response.getFirstContextBean(); - Integer count = context.getData("count"); - Assert.assertEquals(new Integer(2), count); - //因为第一个when配置了会报错,所以response里的cause里应该会有TestException - Assert.assertEquals(TestException.class, response.getCause().getClass()); - } - - //不同group的并行组,不会合并,第一个when的errorResume是false,会抛错,那第二个when就不会执行 - @Test - public void testAsyncFlow6() throws Exception { - LiteflowResponse response = flowExecutor.execute2Resp("chain6", "it's a base request"); - //第一个when会抛错,所以最终结果是false - Assert.assertFalse(response.isSuccess()); - //因为是不同组并行组,第一组的when里的i就抛错了,所以i就执行了1遍 - DefaultContext context = response.getFirstContextBean(); - Integer count = context.getData("count"); - Assert.assertEquals(new Integer(1), count); - //第一个when会报错,所以最终response的cause里应该会有TestException - Assert.assertEquals(TestException.class, response.getCause().getClass()); - } - - //不同group的并行组,不会合并,第一个when的errorResume是true,不会报错,那第二个when还会继续执行,但是第二个when的errorResume是false,所以第二个when会报错 - @Test - public void testAsyncFlow7() throws Exception { - LiteflowResponse response = flowExecutor.execute2Resp("chain7", "it's a base request"); - //第二个when会抛错,所以最终结果是false - Assert.assertFalse(response.isSuccess()); - // 传递了slotIndex,则set的size==2 - DefaultContext context = response.getFirstContextBean(); - Integer count = context.getData("count"); - Assert.assertEquals(new Integer(2), count); - //第一个when会报错,所以最终response的cause里应该会有TestException - Assert.assertEquals(TestException.class, response.getCause().getClass()); - } - - //测试任意异步一个执行完即继续的场景 - //d g h并行,配置了any=true,其中d耗时1秒,g耗时0.5秒,其他都不设耗时 - //最终执行效果应该是h先返回,然后执行abc,最后gd - //这里要注意的是,由于step是先加入,所以step的打印顺序并不是这样的。但是实际执行是正确的 - @Test - public void testAsyncFlow8() throws Exception { - LiteflowResponse response = flowExecutor.execute2Resp("chain8", "it's a base request"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - Assert.assertTrue(context.getData("check").toString().startsWith("habc")); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ACmp.java deleted file mode 100644 index 01afc5856..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ACmp.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.yomahub.liteflow.test.asyncNode.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; -import org.springframework.stereotype.Component; - - -@Component("a") -public class ACmp extends NodeComponent { - @Override - public void process() { - DefaultContext context = this.getFirstContextBean(); - synchronized (NodeComponent.class){ - if (context.hasData("check")){ - String str = context.getData("check"); - str += this.getNodeId(); - context.setData("check", str); - }else{ - context.setData("check", this.getNodeId()); - } - } - System.out.println("Acomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/BCmp.java deleted file mode 100644 index 73c27c742..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/BCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.yomahub.liteflow.test.asyncNode.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; -import org.springframework.stereotype.Component; - - -@Component("b") -public class BCmp extends NodeComponent { - @Override - public void process() { - DefaultContext context = this.getFirstContextBean(); - synchronized (NodeComponent.class){ - if (context.hasData("check")){ - String str = context.getData("check"); - str += this.getNodeId(); - context.setData("check", str); - }else{ - context.setData("check", this.getNodeId()); - } - } - System.out.println("Bcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/CCmp.java deleted file mode 100644 index 253447f81..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/CCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.yomahub.liteflow.test.asyncNode.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; -import org.springframework.stereotype.Component; - - -@Component("c") -public class CCmp extends NodeComponent { - @Override - public void process() throws Exception { - DefaultContext context = this.getFirstContextBean(); - synchronized (NodeComponent.class){ - if (context.hasData("check")){ - String str = context.getData("check"); - str += this.getNodeId(); - context.setData("check", str); - }else{ - context.setData("check", this.getNodeId()); - } - } - System.out.println("Ccomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/DCmp.java deleted file mode 100644 index 6203d92da..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/DCmp.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.yomahub.liteflow.test.asyncNode.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; -import org.springframework.stereotype.Component; - - -@Component("d") -public class DCmp extends NodeComponent { - @Override - public void process() throws Exception { - Thread.sleep(1000); - DefaultContext context = this.getFirstContextBean(); - synchronized (NodeComponent.class){ - if (context.hasData("check")){ - String str = context.getData("check"); - str += this.getNodeId(); - context.setData("check", str); - }else{ - context.setData("check", this.getNodeId()); - } - } - System.out.println("Dcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ECmp.java deleted file mode 100644 index caff1beb8..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ECmp.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.yomahub.liteflow.test.asyncNode.cmp; - -import com.yomahub.liteflow.core.NodeSwitchComponent; -import org.springframework.stereotype.Component; - - -@Component("e") -public class ECmp extends NodeSwitchComponent { - - @Override - public String processSwitch() throws Exception { - System.out.println("Ecomp executed!"); - return "g"; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/FCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/FCmp.java deleted file mode 100644 index eb9322c81..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/FCmp.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.yomahub.liteflow.test.asyncNode.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - - -@Component("f") -public class FCmp extends NodeComponent { - - @Override - public void process() throws Exception { - System.out.println("Fcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/GCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/GCmp.java deleted file mode 100644 index 66fd659cc..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/GCmp.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.yomahub.liteflow.test.asyncNode.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; -import org.springframework.stereotype.Component; - - -@Component("g") -public class GCmp extends NodeComponent { - - @Override - public void process() throws Exception { - Thread.sleep(500); - DefaultContext context = this.getFirstContextBean(); - synchronized (NodeComponent.class){ - if (context.hasData("check")){ - String str = context.getData("check"); - str += this.getNodeId(); - context.setData("check", str); - }else{ - context.setData("check", this.getNodeId()); - } - } - System.out.println("Gcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/HCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/HCmp.java deleted file mode 100644 index dd211dfa3..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/HCmp.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.yomahub.liteflow.test.asyncNode.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; -import org.springframework.stereotype.Component; - - -@Component("h") -public class HCmp extends NodeComponent { - - @Override - public void process() throws Exception { - DefaultContext context = this.getFirstContextBean(); - synchronized (NodeComponent.class){ - if (context.hasData("check")){ - String str = context.getData("check"); - str += this.getNodeId(); - context.setData("check", str); - }else{ - context.setData("check", this.getNodeId()); - } - } - - System.out.println("Hcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ICmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ICmp.java deleted file mode 100644 index d85b775e8..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ICmp.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.yomahub.liteflow.test.asyncNode.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; -import com.yomahub.liteflow.test.asyncNode.exception.TestException; -import org.springframework.stereotype.Component; - - -@Component("i") -public class ICmp extends NodeComponent { - - @Override - public void process() throws Exception { - DefaultContext context = this.getFirstContextBean(); - synchronized (ICmp.class){ - if (context.hasData("count")){ - Integer count = context.getData("count"); - context.setData("count", ++count); - } else{ - context.setData("count", 1); - } - } - System.out.println("Icomp executed! throw Exception!"); - throw new TestException(); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/JCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/JCmp.java deleted file mode 100644 index 66bb9cab9..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/JCmp.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.yomahub.liteflow.test.asyncNode.cmp; - -import com.yomahub.liteflow.core.NodeSwitchComponent; -import org.springframework.stereotype.Component; - - -@Component("j") -public class JCmp extends NodeSwitchComponent { - - @Override - public String processSwitch() throws Exception { - System.out.println("Jcomp executed!"); - return "chain3"; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/exception/TestException.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/exception/TestException.java deleted file mode 100644 index e786e9f86..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/exception/TestException.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.yomahub.liteflow.test.asyncNode.exception; - -public class TestException extends Exception{ -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/bannerPrint/BannerPrintSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/bannerPrint/BannerPrintSpringbootTest.java deleted file mode 100644 index 972b0e25b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/bannerPrint/BannerPrintSpringbootTest.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.yomahub.liteflow.test.bannerPrint; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * springboot环境下重新加载规则测试 - * @author Bryan.Zhang - * @since 2.6.4 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/bannerPrint/application.properties") -@SpringBootTest(classes = BannerPrintSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.bannerPrint.cmp"}) -public class BannerPrintSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testRefresh() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/bannerPrint/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/bannerPrint/cmp/ACmp.java deleted file mode 100644 index ed0c8a824..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/bannerPrint/cmp/ACmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.bannerPrint.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("c") -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/base/BaseSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/base/BaseSpringbootTest.java deleted file mode 100644 index 608e90986..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/base/BaseSpringbootTest.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.yomahub.liteflow.test.base; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * springboot环境最普通的例子测试 - * @author Bryan.Zhang - * @since 2.6.4 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/base/application.properties") -@SpringBootTest(classes = BaseSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.base.cmp"}) -public class BaseSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testBase() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/base/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/base/cmp/ACmp.java deleted file mode 100644 index c33792217..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/base/cmp/ACmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.base.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("b") -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/base/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/base/cmp/CCmp.java deleted file mode 100644 index 6b6f84b41..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/base/cmp/CCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.base.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("d") -public class DCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("DCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/base/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/base/cmp/ECmp.java deleted file mode 100644 index e2a2a226a..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/base/cmp/ECmp.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.yomahub.liteflow.test.base.cmp; - -import com.yomahub.liteflow.core.NodeSwitchComponent; -import org.springframework.stereotype.Component; - -@Component("e") -public class ECmp extends NodeSwitchComponent { - @Override - public String processSwitch() throws Exception { - return "d"; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/builder/BuilderSpringbootTest1.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/builder/BuilderSpringbootTest1.java deleted file mode 100644 index ecdc78f2c..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/builder/BuilderSpringbootTest1.java +++ /dev/null @@ -1,220 +0,0 @@ -package com.yomahub.liteflow.test.builder; - -import com.yomahub.liteflow.builder.LiteFlowChainBuilder; -import com.yomahub.liteflow.builder.LiteFlowConditionBuilder; -import com.yomahub.liteflow.builder.LiteFlowNodeBuilder; -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.builder.entity.ExecutableEntity; -import com.yomahub.liteflow.enums.NodeTypeEnum; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import com.yomahub.liteflow.test.builder.cmp1.ACmp; -import com.yomahub.liteflow.test.builder.cmp1.BCmp; -import com.yomahub.liteflow.test.builder.cmp1.CCmp; -import com.yomahub.liteflow.test.builder.cmp1.DCmp; -import com.yomahub.liteflow.test.builder.cmp1.ECmp; -import com.yomahub.liteflow.test.builder.cmp1.FCmp; -import com.yomahub.liteflow.test.builder.cmp1.GCmp; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -//基于builder模式的单元测试 -//这里只是最基本的builder模式的测试,只是为了验证在springboot模式下的正常性 -//更详细的builder模式测试用例会单独拉testcase去做 -@RunWith(SpringRunner.class) -@SpringBootTest(classes = BuilderSpringbootTest1.class) -@EnableAutoConfiguration -public class BuilderSpringbootTest1 extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //基于普通组件的builder模式测试 - @Test - public void testBuilder() throws Exception { - LiteFlowNodeBuilder.createNode().setId("a") - .setName("组件A") - .setType(NodeTypeEnum.COMMON) - .setClazz("com.yomahub.liteflow.test.builder.cmp1.ACmp") - .build(); - LiteFlowNodeBuilder.createNode().setId("b") - .setName("组件B") - .setType(NodeTypeEnum.COMMON) - .setClazz("com.yomahub.liteflow.test.builder.cmp1.BCmp") - .build(); - LiteFlowNodeBuilder.createNode().setId("c") - .setName("组件C") - .setType(NodeTypeEnum.COMMON) - .setClazz("com.yomahub.liteflow.test.builder.cmp1.CCmp") - .build(); - LiteFlowNodeBuilder.createNode().setId("d") - .setName("组件D") - .setType(NodeTypeEnum.COMMON) - .setClazz("com.yomahub.liteflow.test.builder.cmp1.DCmp") - .build(); - LiteFlowNodeBuilder.createNode().setId("e") - .setName("组件E") - .setType(NodeTypeEnum.SWITCH) - .setClazz("com.yomahub.liteflow.test.builder.cmp1.ECmp") - .build(); - LiteFlowNodeBuilder.createNode().setId("f") - .setName("组件F") - .setType(NodeTypeEnum.COMMON) - .setClazz("com.yomahub.liteflow.test.builder.cmp1.FCmp") - .build(); - LiteFlowNodeBuilder.createNode().setId("g") - .setName("组件G") - .setType(NodeTypeEnum.COMMON) - .setClazz("com.yomahub.liteflow.test.builder.cmp1.GCmp") - .build(); - - - LiteFlowChainBuilder.createChain().setChainName("chain2").setCondition( - LiteFlowConditionBuilder.createThenCondition().setValue("c,d").build() - ).build(); - - LiteFlowChainBuilder.createChain().setChainName("chain1").setCondition( - LiteFlowConditionBuilder.createThenCondition().setValue("a,b").build() - ).setCondition( - LiteFlowConditionBuilder.createWhenCondition().setValue("e(f|g|chain2)").build() - ).build(); - - LiteflowResponse response = flowExecutor.execute2Resp("chain1"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a[组件A]==>b[组件B]==>e[组件E]==>c[组件C]==>d[组件D]", response.getExecuteStepStr()); - } - - //基于普通组件的builder模式测试 - @Test - public void testBuilderForClassAndCode() throws Exception { - LiteFlowNodeBuilder.createNode().setId("a") - .setName("组件A") - .setType(NodeTypeEnum.COMMON) - .setClazz(ACmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("b") - .setName("组件B") - .setType(NodeTypeEnum.COMMON) - .setClazz(BCmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("c") - .setName("组件C") - .setType(NodeTypeEnum.COMMON) - .setClazz(CCmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("d") - .setName("组件D") - .setType(NodeTypeEnum.COMMON) - .setClazz(DCmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("e") - .setName("组件E") - .setType(NodeTypeEnum.SWITCH) - .setClazz(ECmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("f") - .setName("组件F") - .setType(NodeTypeEnum.COMMON) - .setClazz(FCmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("g") - .setName("组件G") - .setType(NodeTypeEnum.COMMON) - .setClazz(GCmp.class) - .build(); - - - LiteFlowChainBuilder.createChain().setChainName("chain2").setCondition( - LiteFlowConditionBuilder.createThenCondition().setValue("c,d").build() - ).build(); - - LiteFlowChainBuilder.createChain().setChainName("chain1").setCondition( - LiteFlowConditionBuilder - .createThenCondition() - .setValue("a,b").build() - ).setCondition( - LiteFlowConditionBuilder.createWhenCondition() - .setValue("e(f|g|chain2)").build() - ).build(); - - LiteflowResponse response = flowExecutor.execute2Resp("chain1"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a[组件A]==>b[组件B]==>e[组件E]==>c[组件C]==>d[组件D]", response.getExecuteStepStr()); - } - - - //基于普通组件的builder模式测试 - @Test - public void testBuilderForConditionNode() throws Exception { - LiteFlowNodeBuilder.createNode().setId("a") - .setName("组件A") - .setType(NodeTypeEnum.COMMON) - .setClazz(ACmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("b") - .setName("组件B") - .setType(NodeTypeEnum.COMMON) - .setClazz(BCmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("c") - .setName("组件C") - .setType(NodeTypeEnum.COMMON) - .setClazz(CCmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("d") - .setName("组件D") - .setType(NodeTypeEnum.COMMON) - .setClazz(DCmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("e") - .setName("组件E") - .setType(NodeTypeEnum.SWITCH) - .setClazz(ECmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("f") - .setName("组件F") - .setType(NodeTypeEnum.COMMON) - .setClazz(FCmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("g") - .setName("组件G") - .setType(NodeTypeEnum.COMMON) - .setClazz(GCmp.class) - .build(); - - - LiteFlowChainBuilder.createChain().setChainName("chain2").setCondition( - LiteFlowConditionBuilder.createThenCondition() - .setExecutable(new ExecutableEntity().setId("c")) - .setExecutable(new ExecutableEntity().setId("d")) - .build() - ).build(); - - LiteFlowChainBuilder.createChain().setChainName("chain1").setCondition( - LiteFlowConditionBuilder - .createThenCondition() - .setExecutable(new ExecutableEntity().setId("a").setTag("hello")) - .setExecutable(new ExecutableEntity().setId("b")) - .build() - ).setCondition( - LiteFlowConditionBuilder.createWhenCondition() - .setExecutable( - new ExecutableEntity().setId("e") - .addNodeCondComponent(new ExecutableEntity().setId("f").setTag("FHello")) - .addNodeCondComponent(new ExecutableEntity().setId("g")) - .addNodeCondComponent(new ExecutableEntity().setId("chain2") - )).build() - ).build(); - - LiteflowResponse response = flowExecutor.execute2Resp("chain1"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a[组件A]==>b[组件B]==>e[组件E]==>c[组件C]==>d[组件D]", response.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/builder/BuilderSpringbootTest2.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/builder/BuilderSpringbootTest2.java deleted file mode 100644 index fc8d67074..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/builder/BuilderSpringbootTest2.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.yomahub.liteflow.test.builder; - -import com.yomahub.liteflow.builder.LiteFlowChainBuilder; -import com.yomahub.liteflow.builder.LiteFlowConditionBuilder; -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -//基于builder模式的单元测试 -//这里测试的是通过spring去扫描,但是通过代码去构建chain的用例 -@RunWith(SpringRunner.class) -@SpringBootTest(classes = BuilderSpringbootTest2.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.builder.cmp2"}) -public class BuilderSpringbootTest2 extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //通过spring去扫描组件,通过代码去构建chain - @Test - public void testBuilder() throws Exception { - LiteFlowChainBuilder.createChain().setChainName("chain1").setCondition( - LiteFlowConditionBuilder.createThenCondition().setValue("h,i,j").build() - ).build(); - - LiteflowResponse response = flowExecutor.execute2Resp("chain1"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("h==>i==>j", response.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/ACmp.java deleted file mode 100644 index 79573bc8a..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/ACmp.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.builder.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -public class ACmp extends NodeComponent { - - @Override - public void process() { - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/BCmp.java deleted file mode 100644 index 3e6c3f076..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/BCmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.builder.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/CCmp.java deleted file mode 100644 index 679565030..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/CCmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.builder.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/DCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/DCmp.java deleted file mode 100644 index 010fc1852..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/DCmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.builder.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -public class DCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("DCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/ECmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/ECmp.java deleted file mode 100644 index e30f7f831..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/ECmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.builder.cmp1; - -import com.yomahub.liteflow.core.NodeSwitchComponent; - -public class ECmp extends NodeSwitchComponent { - - @Override - public String processSwitch() throws Exception { - System.out.println("ECmp executed!"); - return "chain2"; - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/FCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/FCmp.java deleted file mode 100644 index 6cd712581..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/FCmp.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

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

Title: liteflow

- *

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

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

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.builder.cmp2; - -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.core.NodeComponent; - -@LiteflowComponent("j") -public class JCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("JCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/LiteflowRetrySpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/LiteflowRetrySpringbootTest.java deleted file mode 100644 index bae024e7f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/LiteflowRetrySpringbootTest.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.yomahub.liteflow.test.cmpRetry; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - - -/** - * 测试springboot下的节点执行器 - * @author Bryan.Zhang - * @since 2.5.10 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/cmpRetry/application.properties") -@SpringBootTest(classes = LiteflowRetrySpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.cmpRetry.cmp"}) -public class LiteflowRetrySpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //全局重试配置测试 - @Test - public void testRetry1() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a==>b==>b==>b", response.getExecuteStepStr()); - } - - //单个组件重试配置测试 - @Test - public void testRetry2() { - LiteflowResponse response = flowExecutor.execute2Resp("chain2", "arg"); - Assert.assertFalse(response.isSuccess()); - Assert.assertEquals("c==>c==>c==>c==>c==>c", response.getExecuteStepStr()); - } - - //单个组件指定异常,但抛出的并不是指定异常的场景测试 - @Test - public void testRetry3() { - LiteflowResponse response = flowExecutor.execute2Resp("chain3", "arg"); - Assert.assertFalse(response.isSuccess()); - } - - //单个组件指定异常重试,抛出的是指定异常或者 - @Test - public void testRetry4() { - LiteflowResponse response = flowExecutor.execute2Resp("chain4", "arg"); - Assert.assertFalse(response.isSuccess()); - Assert.assertEquals("e==>e==>e==>e==>e==>e", response.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/ACmp.java deleted file mode 100644 index a1b1b3fb4..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/ACmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.cmpRetry.cmp; - -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.core.NodeComponent; - -@LiteflowComponent("b") -public class BCmp extends NodeComponent { - - private int flag = 0; - - @Override - public void process() { - System.out.println("BCmp executed!"); - if (flag < 2){ - flag++; - throw new RuntimeException("demo exception"); - } - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/CCmp.java deleted file mode 100644 index 89c59fba9..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/CCmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.cmpRetry.cmp; - -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.annotation.LiteflowRetry; -import com.yomahub.liteflow.core.NodeComponent; - -@LiteflowComponent("d") -@LiteflowRetry(retry = 5, forExceptions = {NullPointerException.class}) -public class DCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("DCmp executed!"); - throw new RuntimeException("demo exception"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/ECmp.java deleted file mode 100644 index ba3f92d65..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/ECmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.cmpRetry.cmp; - -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.annotation.LiteflowRetry; -import com.yomahub.liteflow.core.NodeComponent; - -@LiteflowComponent("e") -@LiteflowRetry(retry = 5, forExceptions = {NullPointerException.class}) -public class ECmp extends NodeComponent { - - @Override - public void process() { - System.out.println("ECmp executed!"); - throw new NullPointerException("demo null exception"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/CmpStepSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/CmpStepSpringbootTest.java deleted file mode 100644 index 0c9817345..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/CmpStepSpringbootTest.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.yomahub.liteflow.test.cmpStep; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * springboot环境step的测试例子 - * @author Bryan.Zhang - * @since 2.7.0 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/cmpStep/application.properties") -@SpringBootTest(classes = CmpStepSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.cmpStep.cmp"}) -public class CmpStepSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //ab串行 - //cd并行,都抛错,其中c耗时2秒 - @Test - public void testStep1() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertFalse(response.isSuccess()); - Assert.assertTrue(response.getExecuteSteps().get("a").isSuccess()); - Assert.assertTrue(response.getExecuteSteps().get("b").isSuccess()); - Assert.assertFalse(response.getExecuteSteps().get("c").isSuccess()); - Assert.assertFalse(response.getExecuteSteps().get("d").isSuccess()); - Assert.assertTrue(response.getExecuteSteps().get("c").getTimeSpent() >= 2000); - Assert.assertEquals(RuntimeException.class, response.getExecuteSteps().get("c").getException().getClass()); - Assert.assertEquals(RuntimeException.class, response.getExecuteSteps().get("d").getException().getClass()); - } - - @Test - public void testStep2() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain2", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a==>b", response.getExecuteStepStrWithoutTime()); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/ACmp.java deleted file mode 100644 index 6c1573f4e..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/ACmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.cmpStep.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("a") -public class ACmp extends NodeComponent { - - @Override - public void process() throws Exception{ - Thread.sleep(5000L); - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/BCmp.java deleted file mode 100644 index aa0e7d3dd..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/BCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.cmpStep.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("b") -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/CCmp.java deleted file mode 100644 index 34f7792be..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/CCmp.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.cmpStep.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("c") -public class CCmp extends NodeComponent { - - @Override - public void process() throws Exception{ - System.out.println("CCmp executed!"); - Thread.sleep(2000); - throw new RuntimeException("test error c"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/DCmp.java deleted file mode 100644 index 7814a2ba4..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/DCmp.java +++ /dev/null @@ -1,22 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.cmpStep.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("d") -public class DCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - throw new RuntimeException("test error d"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/ECmp.java deleted file mode 100644 index f78b42399..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/ECmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.cmpStep.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("e") -public class ECmp extends NodeComponent { - - @Override - public void process() { - System.out.println("ECmp executed!"); - } - - @Override - public boolean isAccess() { - return false; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/component/FlowExecutorSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/component/FlowExecutorSpringbootTest.java deleted file mode 100644 index 5bc400e2b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/component/FlowExecutorSpringbootTest.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.yomahub.liteflow.test.component; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.util.ReflectionUtils; - -import javax.annotation.Resource; - -/** - * 组件功能点测试 - * 单元测试 - * - * @author donguo.tao - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/component/application.properties") -@SpringBootTest(classes = FlowExecutorSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.component.cmp1","com.yomahub.liteflow.test.component.cmp2"}) -public class FlowExecutorSpringbootTest extends BaseTest { - private static final Logger LOG = LoggerFactory.getLogger(FlowExecutorSpringbootTest.class); - - @Resource - private FlowExecutor flowExecutor; - - //isAccess方法的功能测试 - @Test - public void testIsAccess() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", 101); - Assert.assertTrue(response.isSuccess()); - Assert.assertNotNull(response.getSlot().getResponseData()); - } - - //组件抛错的功能点测试 - @Test(expected = ArithmeticException.class) - public void testComponentException() throws Exception { - LiteflowResponse response = flowExecutor.execute2Resp("chain2", 0); - Assert.assertFalse(response.isSuccess()); - Assert.assertEquals("/ by zero", response.getMessage()); - ReflectionUtils.rethrowException(response.getCause()); - } - - //isContinueOnError方法的功能点测试 - @Test - public void testIsContinueOnError() throws Exception { - LiteflowResponse response = flowExecutor.execute2Resp("chain3", 0); - Assert.assertTrue(response.isSuccess()); - Assert.assertNull(response.getCause()); - } - - //isEnd方法的功能点测试 - @Test - public void testIsEnd() throws Exception { - LiteflowResponse response = flowExecutor.execute2Resp("chain4", 10); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("d",response.getExecuteStepStr()); - } - - //setIsEnd方法的功能点测试 - @Test - public void testSetIsEnd1() throws Exception { - LiteflowResponse response = flowExecutor.execute2Resp("chain5", 10); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("e",response.getExecuteStepStr()); - } - - //条件组件的功能点测试 - @Test - public void testNodeCondComponent() { - LiteflowResponse response = flowExecutor.execute2Resp("chain6", 0); - Assert.assertTrue(response.isSuccess()); - } - - //测试setIsEnd如果为true,continueError也为true,那不应该continue了 - @Test - public void testSetIsEnd2() throws Exception { - LiteflowResponse response = flowExecutor.execute2Resp("chain7", 10); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("g",response.getExecuteStepStr()); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/ACmp.java deleted file mode 100644 index 3f125d17d..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/ACmp.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.yomahub.liteflow.test.component.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -import java.util.Objects; - - -@Component("a") -public class ACmp extends NodeComponent { - @Override - public void process() { - System.out.println("AComp executed!"); - this.getSlot().setResponseData("AComp executed!"); - } - - @Override - public boolean isAccess() { - Integer requestData = this.getRequestData(); - if (Objects.nonNull(requestData) && requestData > 100){ - return true; - } - System.out.println("AComp isAccess false."); - return false; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/BCmp.java deleted file mode 100644 index 6d5db7fc9..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/BCmp.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.yomahub.liteflow.test.component.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -import java.util.Objects; - - -@Component("b") -public class BCmp extends NodeComponent { - @Override - public void process() { - System.out.println("BComp executed!"); - Integer requestData = this.getRequestData(); - Integer divisor = 130; - Integer result = divisor / requestData; - this.getSlot().setResponseData(result); - } - - @Override - public boolean isAccess() { - Integer requestData = this.getRequestData(); - if (Objects.nonNull(requestData)){ - return true; - } - return false; - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/CCmp.java deleted file mode 100644 index dc4620e4a..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/CCmp.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.yomahub.liteflow.test.component.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -import java.util.Objects; - - -@Component("c") -public class CCmp extends NodeComponent { - @Override - public void process() { - System.out.println("CComp executed!"); - Integer requestData = this.getRequestData(); - Integer divisor = 130; - Integer result = divisor / requestData; - this.getSlot().setResponseData(result); - System.out.println("responseData="+Integer.parseInt(this.getSlot().getResponseData())); - } - - @Override - public boolean isContinueOnError() { - Integer requestData = this.getRequestData(); - if (Objects.nonNull(requestData)){ - return true; - } - return false; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/DCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/DCmp.java deleted file mode 100644 index c28a41e34..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/DCmp.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.yomahub.liteflow.test.component.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -import java.util.Objects; - - -@Component("d") -public class DCmp extends NodeComponent { - @Override - public void process() throws Exception { - System.out.println("DComp executed!"); - } - - @Override - public boolean isEnd() { - //组件的process执行完之后才会执行isEnd - Object requestData = this.getSlot().getResponseData(); - if (Objects.isNull(requestData)){ - System.out.println("DComp flow isEnd, because of responseData is null."); - return true; - } - return false; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/ECmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/ECmp.java deleted file mode 100644 index 9103080a4..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/ECmp.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.yomahub.liteflow.test.component.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.util.JsonUtil; -import org.springframework.stereotype.Component; - -import java.util.Objects; - - -@Component("e") -public class ECmp extends NodeComponent { - - @Override - public void process() throws Exception { - System.out.println("EComp executed!"); - Object responseData = this.getSlot().getResponseData(); - if (Objects.isNull(responseData)){ - System.out.println("EComp responseData flow must be set end ."); - //执行到某个条件时,手动结束流程。 - this.setIsEnd(true); - } - System.out.println("EComp responseData responseData=" + JsonUtil.toJsonString(responseData)); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/GCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/GCmp.java deleted file mode 100644 index f7917cfae..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/GCmp.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.component.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("g") -public class GCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("GCmp executed!"); - this.setIsEnd(true); - } - - @Override - public boolean isContinueOnError() { - return true; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/HCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/HCmp.java deleted file mode 100644 index df41a9c13..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/HCmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.component.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("h") -public class HCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("HCmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp2/FSwitchCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp2/FSwitchCmp.java deleted file mode 100644 index 5f4951f54..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp2/FSwitchCmp.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.yomahub.liteflow.test.component.cmp2; - -import com.yomahub.liteflow.core.NodeSwitchComponent; -import org.springframework.stereotype.Component; - -import java.util.Objects; - - -@Component("f") -public class FSwitchCmp extends NodeSwitchComponent { - @Override - public String processSwitch() { - Integer requestData = this.getRequestData(); - if (Objects.isNull(requestData)){ - return "d"; - } else if(requestData == 0){ - return "c"; - } else { - return "b"; - } - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/config/LiteflowConfigSpringbootTest1.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/config/LiteflowConfigSpringbootTest1.java deleted file mode 100644 index 2f510da1a..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/config/LiteflowConfigSpringbootTest1.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.yomahub.liteflow.test.config; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.property.LiteflowConfigGetter; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * springboot环境下参数单元测试 - * @author zendwang - * @since 2.5.0 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/config/application1.properties") -@SpringBootTest(classes = LiteflowConfigSpringbootTest1.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.config.cmp"}) -public class LiteflowConfigSpringbootTest1 extends BaseTest { - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testConfig() { - LiteflowConfig config = LiteflowConfigGetter.get(); - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("config/flow.yml", config.getRuleSource()); - Assert.assertEquals(15, config.getWhenMaxWaitSeconds().intValue()); - Assert.assertEquals(200, config.getQueueLimit().intValue()); - Assert.assertEquals(300000L, config.getDelay().longValue()); - Assert.assertEquals(300000L, config.getPeriod().longValue()); - Assert.assertFalse(config.getEnableLog()); - Assert.assertEquals(16, config.getWhenMaxWorkers().longValue()); - Assert.assertEquals(512, config.getWhenQueueLimit().longValue()); - Assert.assertEquals(true, config.isParseOnStart()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/config/LiteflowConfigSpringbootTest2.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/config/LiteflowConfigSpringbootTest2.java deleted file mode 100644 index ae90bd391..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/config/LiteflowConfigSpringbootTest2.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.yomahub.liteflow.test.config; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * springboot环境下参数单元测试 - * @author zendwang - * @since 2.5.0 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/config/application2.properties") -@SpringBootTest(classes = LiteflowConfigSpringbootTest2.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.config.cmp"}) -public class LiteflowConfigSpringbootTest2 extends BaseTest { - @Resource - private FlowExecutor flowExecutor; - - //测试通配符 - @Test - public void testRuleSourceMatch() { - LiteflowResponse response0 = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertEquals("a==>b==>c", response0.getExecuteStepStr()); - - LiteflowResponse response1 = flowExecutor.execute2Resp("chain2", "arg"); - Assert.assertEquals("a==>c==>b==>d", response1.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/config/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/config/cmp/ACmp.java deleted file mode 100644 index 89be97ac8..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/config/cmp/ACmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.config.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("b") -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/config/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/config/cmp/CCmp.java deleted file mode 100644 index 9867bac45..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/config/cmp/CCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.config.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("d") -public class DCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("DCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/CustomNodesSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/CustomNodesSpringbootTest.java deleted file mode 100644 index 6437c5640..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/CustomNodesSpringbootTest.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.yomahub.liteflow.test.customNodes; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * springboot环境下自定义声明节点的测试 - * 不通过spring扫描的方式,通过在配置文件里定义nodes的方式 - * @author Bryan.Zhang - * @since 2.6.4 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/customNodes/application.properties") -@SpringBootTest(classes = CustomNodesSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.customNodes.domain"}) -public class CustomNodesSpringbootTest extends BaseTest { - - private final Logger log = LoggerFactory.getLogger(this.getClass()); - - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testCustomNodes() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - response = flowExecutor.execute2Resp("chain2", "arg"); - Assert.assertTrue(response.isSuccess()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/ACmp.java deleted file mode 100644 index d93561044..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/ACmp.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.customNodes.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -public class ACmp extends NodeComponent { - - @Override - public void process() { - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/BCmp.java deleted file mode 100644 index ba21f7192..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/BCmp.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.customNodes.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.test.customNodes.domain.DemoDomain; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; - -public class BCmp extends NodeComponent { - - @Resource - private DemoDomain demoDomain; - - @Override - public void process() { - demoDomain.sayHi(); - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/CCmp.java deleted file mode 100644 index 1190c76a8..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/CCmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.customNodes.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/DCmp.java deleted file mode 100644 index 46455f3d4..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/DCmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.customNodes.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -public class DCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("DCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/ECmp.java deleted file mode 100644 index a76a740a9..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/ECmp.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.customNodes.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.test.customNodes.domain.DemoDomain; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; - -public class ECmp extends NodeComponent { - - @Resource - private DemoDomain demoDomain; - - @Override - public void process() { - demoDomain.sayHi(); - System.out.println("ECmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/FCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/FCmp.java deleted file mode 100644 index f791500e9..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/FCmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.customNodes.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -public class FCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("FCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/domain/DemoDomain.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/domain/DemoDomain.java deleted file mode 100644 index d0b10dc0b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/domain/DemoDomain.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.yomahub.liteflow.test.customNodes.domain; - -import org.springframework.stereotype.Component; - -@Component -public class DemoDomain { - - public void sayHi(){ - System.out.println("hi"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor1.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor1.java deleted file mode 100644 index fbb5f7a14..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor1.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.yomahub.liteflow.test.customWhenThreadPool; - -import cn.hutool.core.util.ObjectUtil; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.property.LiteflowConfigGetter; -import com.yomahub.liteflow.spi.holder.ContextAwareHolder; -import com.yomahub.liteflow.thread.ExecutorBuilder; - -import java.util.concurrent.*; - -public class CustomThreadExecutor1 implements ExecutorBuilder { - - @Override - public ExecutorService buildExecutor() { - LiteflowConfig liteflowConfig = LiteflowConfigGetter.get(); - //只有在非spring的场景下liteflowConfig才会为null - if (ObjectUtil.isNull(liteflowConfig)) { - liteflowConfig = new LiteflowConfig(); - } - return buildDefaultExecutor( - liteflowConfig.getWhenMaxWorkers(), - liteflowConfig.getWhenMaxWorkers(), - liteflowConfig.getWhenQueueLimit(), - "customer-when-1-thead-"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor2.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor2.java deleted file mode 100644 index f43afaa10..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor2.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.yomahub.liteflow.test.customWhenThreadPool; - -import cn.hutool.core.util.ObjectUtil; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.property.LiteflowConfigGetter; -import com.yomahub.liteflow.spi.holder.ContextAwareHolder; -import com.yomahub.liteflow.thread.ExecutorBuilder; - -import java.util.concurrent.*; - -public class CustomThreadExecutor2 implements ExecutorBuilder { - @Override - public ExecutorService buildExecutor() { - LiteflowConfig liteflowConfig = LiteflowConfigGetter.get(); - //只有在非spring的场景下liteflowConfig才会为null - if (ObjectUtil.isNull(liteflowConfig)) { - liteflowConfig = new LiteflowConfig(); - } - return buildDefaultExecutor( - liteflowConfig.getWhenMaxWorkers(), - liteflowConfig.getWhenMaxWorkers(), - liteflowConfig.getWhenQueueLimit(), - "customer-when-2-thead-"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor3.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor3.java deleted file mode 100644 index fb8134c68..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor3.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.yomahub.liteflow.test.customWhenThreadPool; - -import cn.hutool.core.util.ObjectUtil; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.property.LiteflowConfigGetter; -import com.yomahub.liteflow.spi.holder.ContextAwareHolder; -import com.yomahub.liteflow.thread.ExecutorBuilder; - -import java.util.concurrent.ExecutorService; - -public class CustomThreadExecutor3 implements ExecutorBuilder { - @Override - public ExecutorService buildExecutor() { - LiteflowConfig liteflowConfig = LiteflowConfigGetter.get(); - //只有在非spring的场景下liteflowConfig才会为null - if (ObjectUtil.isNull(liteflowConfig)) { - liteflowConfig = new LiteflowConfig(); - } - return buildDefaultExecutor( - liteflowConfig.getWhenMaxWorkers(), - liteflowConfig.getWhenMaxWorkers(), - liteflowConfig.getWhenQueueLimit(), - "customer-when-3-thead-"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomWhenThreadPoolSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomWhenThreadPoolSpringbootTest.java deleted file mode 100644 index 766ed3165..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomWhenThreadPoolSpringbootTest.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.yomahub.liteflow.test.customWhenThreadPool; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * springboot环境下异步线程超时日志打印测试 - * - * @author Bryan.Zhang - * @since 2.6.4 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/customWhenThreadPool/application.properties") -@SpringBootTest(classes = CustomWhenThreadPoolSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.customWhenThreadPool.cmp"}) -public class CustomWhenThreadPoolSpringbootTest extends BaseTest { - - private final Logger log = LoggerFactory.getLogger(this.getClass()); - - @Resource - private FlowExecutor flowExecutor; - - /** - * 测试全局线程池配置 - */ - @Test - public void testGlobalThreadPool() { - LiteflowResponse response = flowExecutor.execute2Resp("chain", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - Assert.assertTrue(context.getData("threadName").toString().startsWith("lf-when-thead")); - } - - /** - * 测试全局和when上自定义线程池-优先以when上为准 - */ - @Test - public void testGlobalAndCustomWhenThreadPool() { - LiteflowResponse response1 = flowExecutor.execute2Resp("chain1", "arg"); - DefaultContext context = response1.getFirstContextBean(); - Assert.assertTrue(response1.isSuccess()); - Assert.assertTrue(context.getData("threadName").toString().startsWith("customer-when-1-thead")); - } - - - /** - * when配置的线程池可以共用 - */ - @Test - public void testCustomWhenThreadPool() { - // 使用when - thread1 - testGlobalAndCustomWhenThreadPool(); - // chain配置同一个thead1 - LiteflowResponse response2 = flowExecutor.execute2Resp("chain2", "arg"); - DefaultContext context = response2.getFirstContextBean(); - Assert.assertTrue(response2.isSuccess()); - Assert.assertTrue(context.getData("threadName").toString().startsWith("customer-when-1-thead")); - - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/ACmp.java deleted file mode 100644 index f47c972da..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/ACmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.customWhenThreadPool.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("a") -public class ACmp extends NodeComponent { - - @Override - public void process() { - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/BCmp.java deleted file mode 100644 index 66bc03a45..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/BCmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.customWhenThreadPool.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import org.springframework.stereotype.Component; - -@Component("b") -public class BCmp extends NodeComponent { - - @Override - public void process() { - DefaultContext context = this.getFirstContextBean(); - context.setData("threadName", Thread.currentThread().getName()); - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/CCmp.java deleted file mode 100644 index 809d4429a..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/CCmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.customWhenThreadPool.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import org.springframework.stereotype.Component; - -@Component("c") -public class CCmp extends NodeComponent { - - @Override - public void process() { - DefaultContext context = this.getFirstContextBean(); - context.setData("threadName", Thread.currentThread().getName()); - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/DCmp.java deleted file mode 100644 index 07d5a53dd..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/DCmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.customWhenThreadPool.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import org.springframework.stereotype.Component; - -@Component("d") -public class DCmp extends NodeComponent { - - @Override - public void process() { - DefaultContext context = this.getFirstContextBean(); - context.setData("threadName", Thread.currentThread().getName()); - System.out.println("DCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/ECmp.java deleted file mode 100644 index 6e96482bf..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/ECmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.customWhenThreadPool.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import org.springframework.stereotype.Component; - -@Component("e") -public class ECmp extends NodeComponent { - - @Override - public void process() { - DefaultContext context = this.getFirstContextBean(); - context.setData("threadName", Thread.currentThread().getName()); - System.out.println("ECmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/FCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/FCmp.java deleted file mode 100644 index 7091b7316..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/FCmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.customWhenThreadPool.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import org.springframework.stereotype.Component; - -@Component("f") -public class FCmp extends NodeComponent { - - @Override - public void process() { - DefaultContext context = this.getFirstContextBean(); - context.setData("threadName", Thread.currentThread().getName()); - System.out.println("FCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/deadLoopChain/DeadLoopChainSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/deadLoopChain/DeadLoopChainSpringbootTest.java deleted file mode 100644 index ad2f4bd01..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/deadLoopChain/DeadLoopChainSpringbootTest.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.yomahub.liteflow.test.deadLoopChain; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; - -import javax.annotation.Resource; - - -/** - * 测试springboot下循环chain死循环问题 - * @author Bryan.Zhang - * @since 2.5.10 - */ -/*@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/deadLoopChain/application.properties") -@SpringBootTest(classes = DeadLoopChainSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.deadLoopChain.cmp"})*/ -public class DeadLoopChainSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //死循环问题解析时自动发现,抛错 - //为了写测试用例,才配置了liteflow.parse-on-start=false参数,实际上应用不用配置延迟加载参数 - //自从2.6.8之后,支持循环依赖,但是用户必须在组件里自己判断退出的条件,否则会报栈溢出 - //所以这个测试用例暂时不打开 - //为什么不删除呢?是因为如果用户不自己判断退出的条件。会报出栈溢出。以后希望liteflow自己能抛出相关的错。而不是抛出JDK的异常。所以暂时留着。 - //@Test(expected = CyclicDependencyException.class) - public void testDeadLoopChain() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/deadLoopChain/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/deadLoopChain/cmp/ACmp.java deleted file mode 100644 index 3f5e940df..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/deadLoopChain/cmp/ACmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.deadLoopChain.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("b") -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/deadLoopChain/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/deadLoopChain/cmp/CCmp.java deleted file mode 100644 index 78edd7e34..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/deadLoopChain/cmp/CCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.deadLoopChain.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("c") -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/emptyflow/EmptyFlowSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/emptyflow/EmptyFlowSpringbootTest.java deleted file mode 100644 index f6c0f05e8..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/emptyflow/EmptyFlowSpringbootTest.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.yomahub.liteflow.test.emptyflow; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.test.BaseTest; -import com.yomahub.liteflow.test.aop.aspect.CustomAspect; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.Import; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * 切面场景单元测试 - * @author Bryan.Zhang - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/emptyFlow/application.properties") -@SpringBootTest(classes = EmptyFlowSpringbootTest.class) -@EnableAutoConfiguration -@Import(CustomAspect.class) -public class EmptyFlowSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //测试空flow的情况下,liteflow是否能正常启动 - @Test - public void testEmptyFlow() { - //不做任何事,为的是能正常启动 - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/enable/LiteflowEnableSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/enable/LiteflowEnableSpringbootTest.java deleted file mode 100644 index b75e94701..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/enable/LiteflowEnableSpringbootTest.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.yomahub.liteflow.test.enable; - -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.property.LiteflowConfigGetter; -import com.yomahub.liteflow.spi.holder.ContextAwareHolder; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.ApplicationContext; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - - -/** - * 测试springboot下的enable参数 - * - * @author Bryan.Zhang - * @since 2.5.10 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/enable/application.properties") -@SpringBootTest(classes = LiteflowEnableSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.enable.cmp"}) -public class LiteflowEnableSpringbootTest extends BaseTest { - - @Test - public void testEnable() { - LiteflowConfig config = LiteflowConfigGetter.get(); - Boolean enable = config.getEnable(); - if (enable) { - System.out.println("成功启动,并且打印"); - return; - } - Assert.assertFalse(enable); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/enable/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/enable/cmp/ACmp.java deleted file mode 100644 index 1028beae5..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/enable/cmp/ACmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.enable.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("c") -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/event/EventSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/event/EventSpringbootTest.java deleted file mode 100644 index 31e6d65f7..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/event/EventSpringbootTest.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.yomahub.liteflow.test.event; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * springboot环境事件回调测试 - * @author Bryan.Zhang - * @since 2.7.1 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/event/application.properties") -@SpringBootTest(classes = EventSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.event.cmp"}) -public class EventSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //测试组件成功事件 - @Test - public void testEvent1() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("abc", context.getData("test")); - } - - //测试组件失败事件 - @Test - public void testEvent2() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain2", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertFalse(response.isSuccess()); - Assert.assertEquals(NullPointerException.class, response.getCause().getClass()); - Assert.assertEquals("ab", context.getData("test")); - Assert.assertEquals("error:d", context.getData("error")); - } - - //测试组件失败事件本身抛出异常 - @Test - public void testEvent3() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain3", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertFalse(response.isSuccess()); - Assert.assertEquals(NullPointerException.class, response.getCause().getClass()); - Assert.assertEquals("a", context.getData("test")); - Assert.assertEquals("error:e", context.getData("error")); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/event/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/event/cmp/ACmp.java deleted file mode 100644 index 11c7509ba..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/event/cmp/ACmp.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.event.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import org.springframework.stereotype.Component; - -@Component("a") -public class ACmp extends NodeComponent { - - @Override - public void process() { - DefaultContext context = this.getFirstContextBean(); - context.setData("test",""); - System.out.println("ACmp executed!"); - } - - @Override - public void onSuccess() throws Exception { - DefaultContext context = this.getFirstContextBean(); - String str = context.getData("test"); - str += this.getNodeId(); - context.setData("test", str); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/event/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/event/cmp/BCmp.java deleted file mode 100644 index 7fc1b3538..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/event/cmp/BCmp.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.event.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import org.springframework.stereotype.Component; - -@Component("b") -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BCmp executed!"); - } - - @Override - public void onSuccess() throws Exception { - DefaultContext context = this.getFirstContextBean(); - String str = context.getData("test"); - str += this.getNodeId(); - context.setData("test", str); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/event/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/event/cmp/CCmp.java deleted file mode 100644 index f87eeed18..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/event/cmp/CCmp.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.event.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import org.springframework.stereotype.Component; - -@Component("c") -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - - @Override - public void onSuccess() throws Exception { - DefaultContext context = this.getFirstContextBean(); - String str = context.getData("test"); - str += this.getNodeId(); - context.setData("test", str); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/event/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/event/cmp/DCmp.java deleted file mode 100644 index 1865b83ed..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/event/cmp/DCmp.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.event.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import org.springframework.stereotype.Component; - -@Component("d") -public class DCmp extends NodeComponent { - - @Override - public void process() throws Exception{ - System.out.println("CCmp executed!"); - throw new NullPointerException(); - } - - @Override - public void onError() throws Exception { - DefaultContext context = this.getFirstContextBean(); - context.setData("error","error:"+this.getNodeId()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/event/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/event/cmp/ECmp.java deleted file mode 100644 index 600f16321..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/event/cmp/ECmp.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.event.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import org.springframework.stereotype.Component; - -@Component("e") -public class ECmp extends NodeComponent { - - @Override - public void process() throws Exception{ - System.out.println("CCmp executed!"); - throw new NullPointerException(); - } - - @Override - public void onError() throws Exception { - DefaultContext context = this.getFirstContextBean(); - context.setData("error","error:"+this.getNodeId()); - throw new IllegalAccessException("错误事件回调本身抛出异常"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/exception/CustomStatefulException.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/exception/CustomStatefulException.java deleted file mode 100644 index 11441ab58..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/exception/CustomStatefulException.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.yomahub.liteflow.test.exception; - -import com.yomahub.liteflow.exception.LiteFlowException; - -/** - * 用户自定义带状态码的异常 - */ -public class CustomStatefulException extends LiteFlowException { - public CustomStatefulException(String code, String message) { - super(code, message); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/exception/Exception1SpringBootTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/exception/Exception1SpringBootTest.java deleted file mode 100644 index 8c53b8c85..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/exception/Exception1SpringBootTest.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.yomahub.liteflow.test.exception; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.exception.ChainDuplicateException; -import com.yomahub.liteflow.exception.ConfigErrorException; -import com.yomahub.liteflow.exception.FlowExecutorNotInitException; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.property.LiteflowConfigGetter; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * 流程执行异常 - * 单元测试 - * - * @author zendwang - */ -@RunWith(SpringRunner.class) -@SpringBootTest(classes = Exception1SpringBootTest.class) -@EnableAutoConfiguration -public class Exception1SpringBootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - /** - * 验证 chain 节点重复的异常 - */ - @Test(expected = ChainDuplicateException.class) - public void testChainDuplicateException() { - LiteflowConfig config = LiteflowConfigGetter.get(); - config.setRuleSource("exception/flow-exception.xml"); - flowExecutor.init(); - } - - @Test(expected = ConfigErrorException.class) - public void testConfigErrorException() { - flowExecutor.setLiteflowConfig(null); - flowExecutor.init(); - } - - @Test(expected = FlowExecutorNotInitException.class) - public void testFlowExecutorNotInitException() { - LiteflowConfig config = LiteflowConfigGetter.get(); - config.setRuleSource("error/flow.txt"); - flowExecutor.init(); - } - - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/exception/Exception2SpringBootTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/exception/Exception2SpringBootTest.java deleted file mode 100644 index 05877c45d..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/exception/Exception2SpringBootTest.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.yomahub.liteflow.test.exception; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.exception.*; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.ApplicationContext; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.util.ReflectionUtils; - -import javax.annotation.Resource; - -/** - * 流程执行异常 - * 单元测试 - * - * @author zendwang - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/exception/application.properties") -@SpringBootTest(classes = Exception2SpringBootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.exception.cmp"}) -public class Exception2SpringBootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - @Autowired - private ApplicationContext context; - - @Test(expected = ChainNotFoundException.class) - public void testChainNotFoundException() throws Exception { - flowExecutor.execute("chain0", "it's a request"); - } - - @Test(expected = RuntimeException.class) - public void testComponentCustomException() throws Exception { - flowExecutor.execute("chain1", "exception"); - } - - @Test(expected = FlowSystemException.class) - public void testNoConditionInChainException() throws Exception { - LiteflowResponse response = flowExecutor.execute2Resp("chain2", "test"); - Assert.assertFalse(response.isSuccess()); - Assert.assertEquals("no conditionList in this chain[chain2]", response.getMessage()); - ReflectionUtils.rethrowException(response.getCause()); - } - - @Test - public void testGetSlotFromResponseWhenException() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain4", "test"); - Assert.assertFalse(response.isSuccess()); - Assert.assertNotNull(response.getCause()); - Assert.assertNotNull(response.getSlot()); - } - - @Test(expected = NoSwitchTargetNodeException.class) - public void testNoTargetFindException() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain5", "test"); - Assert.assertFalse(response.isSuccess()); - throw response.getCause(); - } - - @Test - public void testInvokeCustomStatefulException() { - LiteflowResponse response = flowExecutor.execute2Resp("chain6", "custom-stateful-exception"); - Assert.assertFalse(response.isSuccess()); - Assert.assertEquals("300", response.getCode()); - Assert.assertNotNull(response.getCause()); - Assert.assertTrue(response.getCause() instanceof LiteFlowException); - Assert.assertNotNull(response.getSlot()); - } - - @Test - public void testNotInvokeCustomStatefulException() { - LiteflowResponse response = flowExecutor.execute2Resp("chain6", "test"); - Assert.assertTrue(response.isSuccess()); - Assert.assertNull(response.getCode()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/ACmp.java deleted file mode 100644 index d637fab7b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/ACmp.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.exception.cmp; - -import cn.hutool.core.util.StrUtil; -import com.yomahub.liteflow.core.NodeComponent; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; - -@Component("a") -public class ACmp extends NodeComponent { - - private static final Logger LOG = LoggerFactory.getLogger(ACmp.class); - - @Override - public void process() { - String str = this.getRequestData(); - if(StrUtil.isNotBlank(str) && str.equals("exception")) { - throw new RuntimeException("chain execute execption"); - } - LOG.info("Acomp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/BCmp.java deleted file mode 100644 index 0f7411c9b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/BCmp.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.exception.cmp; - -import cn.hutool.core.util.StrUtil; -import com.yomahub.liteflow.core.NodeComponent; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; - -@Component("b") -public class BCmp extends NodeComponent { - - private static final Logger LOG = LoggerFactory.getLogger(BCmp.class); - - @Override - public void process() throws InterruptedException { - String str = this.getRequestData(); - if(StrUtil.isNotBlank(str) && str.equals("when")) { - try { - LOG.info("Bcomp sleep begin"); - Thread.sleep(3000); - LOG.info("Bcomp sleep end"); - } catch (InterruptedException e) { - throw e; - } - } - LOG.info("Bcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/CCmp.java deleted file mode 100644 index ab1759ade..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/CCmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.exception.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; - -@Component("c") -public class CCmp extends NodeComponent { - - private static final Logger LOG = LoggerFactory.getLogger(CCmp.class); - - @Override - public void process() { - LOG.info("Ccomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/DCmp.java deleted file mode 100644 index 3aebcc420..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/DCmp.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.exception.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; - -@Component("d") -public class DCmp extends NodeComponent { - - private static final Logger LOG = LoggerFactory.getLogger(DCmp.class); - - @Override - public void process() { - if(1==1){ - int a = 1/0; - } - LOG.info("Dcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/ECmp.java deleted file mode 100644 index 5911c2e3f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/ECmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.exception.cmp; - -import com.yomahub.liteflow.core.NodeSwitchComponent; -import org.springframework.stereotype.Component; - -@Component("e") -public class ECmp extends NodeSwitchComponent { - - @Override - public String processSwitch() throws Exception { - return "a"; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/FCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/FCmp.java deleted file mode 100644 index c0b3917ac..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/FCmp.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.exception.cmp; - -import cn.hutool.core.util.StrUtil; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.test.exception.CustomStatefulException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; - -@Component("f") -public class FCmp extends NodeComponent { - - private static final Logger LOG = LoggerFactory.getLogger(FCmp.class); - - @Override - public void process() { - String str = this.getRequestData(); - if(StrUtil.isNotBlank(str) && str.equals("custom-stateful-exception")) { - throw new CustomStatefulException("300", "chain execute custom stateful execption"); - } - LOG.info("Fcomp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/GCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/GCmp.java deleted file mode 100644 index 0c1120aa0..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/GCmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.exception.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; - -@Component("g") -public class GCmp extends NodeComponent { - - private static final Logger LOG = LoggerFactory.getLogger(GCmp.class); - - @Override - public void process() { - LOG.info("Gcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/execute2Future/Executor2FutureSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/execute2Future/Executor2FutureSpringbootTest.java deleted file mode 100644 index 7327cc568..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/execute2Future/Executor2FutureSpringbootTest.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.yomahub.liteflow.test.execute2Future; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; -import java.util.concurrent.Future; - -/** - * springboot环境执行返回future的例子 - * @author Bryan.Zhang - * @since 2.6.13 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/execute2Future/application.properties") -@SpringBootTest(classes = Executor2FutureSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.execute2Future.cmp"}) -public class Executor2FutureSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testFuture() throws Exception{ - Future future = flowExecutor.execute2Future("chain1", "arg", DefaultContext.class); - LiteflowResponse response = future.get(); - Assert.assertTrue(response.isSuccess()); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/execute2Future/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/execute2Future/cmp/ACmp.java deleted file mode 100644 index 05dabbd3d..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/execute2Future/cmp/ACmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

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

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.execute2Future.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("d") -public class DCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/flowmeta/FlowMetaSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/flowmeta/FlowMetaSpringbootTest.java deleted file mode 100644 index 8e0eaebd0..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/flowmeta/FlowMetaSpringbootTest.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.yomahub.liteflow.test.flowmeta; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.flow.FlowBus; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import com.yomahub.liteflow.test.flowmeta.cmp2.DCmp; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/flowmeta/application.properties") -@SpringBootTest(classes = FlowMetaSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.flowmeta.cmp1"}) -public class FlowMetaSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //测试动态添加元信息节点 - @Test - public void testFlowMeta() { - FlowBus.addCommonNode("d", "d组件", DCmp.class); - LiteflowResponse response= flowExecutor.execute2Resp("chain1", "it's a request"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a==>b==>c==>d[d组件]", response.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/flowmeta/cmp1/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/flowmeta/cmp1/ACmp.java deleted file mode 100644 index 4df6c78fa..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/flowmeta/cmp1/ACmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.flowmeta.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("a") -public class ACmp extends NodeComponent { - - @Override - public void process() { - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/flowmeta/cmp1/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/flowmeta/cmp1/BCmp.java deleted file mode 100644 index f6ef80cb6..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/flowmeta/cmp1/BCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.flowmeta.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("b") -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/flowmeta/cmp1/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/flowmeta/cmp1/CCmp.java deleted file mode 100644 index ed599b642..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/flowmeta/cmp1/CCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.flowmeta.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("c") -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/flowmeta/cmp2/DCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/flowmeta/cmp2/DCmp.java deleted file mode 100644 index f4f20957d..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/flowmeta/cmp2/DCmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.flowmeta.cmp2; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -public class DCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("Dcomp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/lazy/LazySpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/lazy/LazySpringbootTest.java deleted file mode 100644 index e656a9029..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/lazy/LazySpringbootTest.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.yomahub.liteflow.test.lazy; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/lazy/application.properties") -@SpringBootTest(classes = LazySpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.lazy.cmp"}) -public class LazySpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testLazy() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/lazy/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/lazy/cmp/ACmp.java deleted file mode 100644 index 9d3dacbca..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/lazy/cmp/ACmp.java +++ /dev/null @@ -1,22 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.lazy.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.context.annotation.Lazy; -import org.springframework.stereotype.Component; - -@Lazy -@Component("a") -public class ACmp extends NodeComponent { - - @Override - public void process() { - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/lazy/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/lazy/cmp/BCmp.java deleted file mode 100644 index 13bfe6725..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/lazy/cmp/BCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.lazy.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("b") -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/lazy/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/lazy/cmp/CCmp.java deleted file mode 100644 index 3f45e86a6..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/lazy/cmp/CCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.lazy.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("c") -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/lfCmpAnno/LiteflowComponentSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/lfCmpAnno/LiteflowComponentSpringbootTest.java deleted file mode 100644 index c47a29a2b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/lfCmpAnno/LiteflowComponentSpringbootTest.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.yomahub.liteflow.test.lfCmpAnno; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - - -/** - * 测试@LiteflowComponent标注 - * @author Bryan.Zhang - * @since 2.5.10 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/lfCmpAnno/application.properties") -@SpringBootTest(classes = LiteflowComponentSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.lfCmpAnno.cmp"}) -public class LiteflowComponentSpringbootTest extends BaseTest { - - @Autowired - private FlowExecutor flowExecutor; - - @Test - public void testConfig() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a[A组件]==>b[B组件]==>c[C组件]==>b[B组件]==>a[A组件]==>d", response.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/lfCmpAnno/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/lfCmpAnno/cmp/ACmp.java deleted file mode 100644 index 6c4fc23ad..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/lfCmpAnno/cmp/ACmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

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

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.lfCmpAnno.cmp; - -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.core.NodeComponent; - -@LiteflowComponent("d") -public class DCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("DCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/monitor/MonitorSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/monitor/MonitorSpringbootTest.java deleted file mode 100644 index c151cbaa3..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/monitor/MonitorSpringbootTest.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.yomahub.liteflow.test.monitor; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.monitor.MonitorBus; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.spi.holder.ContextAwareHolder; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * springboot环境最普通的例子测试 - * @author Bryan.Zhang - * @since 2.6.4 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/monitor/application.properties") -@SpringBootTest(classes = MonitorSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.monitor.cmp"}) -public class MonitorSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testMonitor() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - - Thread.sleep(10000); - } - - @AfterClass - public static void clean(){ - MonitorBus monitorBus = ContextAwareHolder.loadContextAware().getBean(MonitorBus.class); - monitorBus.closeScheduler(); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/monitor/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/monitor/cmp/ACmp.java deleted file mode 100644 index d5f2438af..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/monitor/cmp/ACmp.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.monitor.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -import java.util.Random; - -@Component("a") -public class ACmp extends NodeComponent { - - @Override - public void process() { - try { - Thread.sleep(new Random().nextInt(2000)); - }catch (Exception e){ - e.printStackTrace(); - } - - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/monitor/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/monitor/cmp/BCmp.java deleted file mode 100644 index a5a3f44e0..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/monitor/cmp/BCmp.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.monitor.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -import java.util.Random; - -@Component("b") -public class BCmp extends NodeComponent { - - @Override - public void process() { - try { - Thread.sleep(new Random().nextInt(2000)); - }catch (Exception e){ - e.printStackTrace(); - } - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/monitor/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/monitor/cmp/CCmp.java deleted file mode 100644 index 6a44bb60a..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/monitor/cmp/CCmp.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.monitor.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -import java.util.Random; - -@Component("c") -public class CCmp extends NodeComponent { - - @Override - public void process() { - try { - Thread.sleep(new Random().nextInt(2000)); - }catch (Exception e){ - e.printStackTrace(); - } - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/multiContext/CheckContext.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/multiContext/CheckContext.java deleted file mode 100644 index af8bfad4a..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/multiContext/CheckContext.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.yomahub.liteflow.test.multiContext; - -public class CheckContext { - - private String sign; - - private int randomId; - - public String getSign() { - return sign; - } - - public void setSign(String sign) { - this.sign = sign; - } - - public int getRandomId() { - return randomId; - } - - public void setRandomId(int randomId) { - this.randomId = randomId; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/multiContext/MultiContextSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/multiContext/MultiContextSpringbootTest.java deleted file mode 100644 index da7b98eb5..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/multiContext/MultiContextSpringbootTest.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.yomahub.liteflow.test.multiContext; - -import cn.hutool.core.date.DateUtil; -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.exception.ChainNotFoundException; -import com.yomahub.liteflow.exception.NoSuchContextBeanException; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * springboot环境最普通的例子测试 - * @author Bryan.Zhang - * @since 2.6.4 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/multiContext/application.properties") -@SpringBootTest(classes = MultiContextSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.multiContext.cmp"}) -public class MultiContextSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testMultiContext1() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg", OrderContext.class, CheckContext.class); - OrderContext orderContext = response.getContextBean(OrderContext.class); - CheckContext checkContext = response.getContextBean(CheckContext.class); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("987XYZ", checkContext.getSign()); - Assert.assertEquals(95, checkContext.getRandomId()); - Assert.assertEquals("SO12345", orderContext.getOrderNo()); - Assert.assertEquals(2, orderContext.getOrderType()); - Assert.assertEquals(DateUtil.parseDate("2022-06-15"), orderContext.getCreateTime()); - } - - @Test(expected = NoSuchContextBeanException.class) - public void testMultiContext2() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg", OrderContext.class, CheckContext.class); - DefaultContext context = response.getContextBean(DefaultContext.class); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/multiContext/OrderContext.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/multiContext/OrderContext.java deleted file mode 100644 index c477108b3..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/multiContext/OrderContext.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.yomahub.liteflow.test.multiContext; - -import java.util.Date; - -public class OrderContext { - - private String orderNo; - - private int orderType; - - private Date createTime; - - public String getOrderNo() { - return orderNo; - } - - public void setOrderNo(String orderNo) { - this.orderNo = orderNo; - } - - public int getOrderType() { - return orderType; - } - - public void setOrderType(int orderType) { - this.orderType = orderType; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/multiContext/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/multiContext/cmp/ACmp.java deleted file mode 100644 index b8e5b6757..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/multiContext/cmp/ACmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.multiContext.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.test.multiContext.CheckContext; -import org.springframework.stereotype.Component; - -@Component("a") -public class ACmp extends NodeComponent { - - @Override - public void process() { - CheckContext checkContext = this.getContextBean(CheckContext.class); - checkContext.setSign("987XYZ"); - checkContext.setRandomId(95); - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/multiContext/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/multiContext/cmp/BCmp.java deleted file mode 100644 index c5a13ddba..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/multiContext/cmp/BCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.multiContext.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.test.multiContext.OrderContext; -import org.springframework.stereotype.Component; - -@Component("b") -public class BCmp extends NodeComponent { - - @Override - public void process() { - //getContextBean无参方法是获取到第一个上下文 - OrderContext orderContext = this.getFirstContextBean(); - orderContext.setOrderNo("SO12345"); - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/multiContext/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/multiContext/cmp/CCmp.java deleted file mode 100644 index 027de6f98..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/multiContext/cmp/CCmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.multiContext.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.test.multiContext.OrderContext; -import org.springframework.stereotype.Component; - -@Component("c") -public class CCmp extends NodeComponent { - - @Override - public void process() { - OrderContext orderContext = this.getContextBean(OrderContext.class); - orderContext.setOrderType(2); - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/multiContext/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/multiContext/cmp/DCmp.java deleted file mode 100644 index 1ebfd536a..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/multiContext/cmp/DCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.multiContext.cmp; - -import cn.hutool.core.date.DateUtil; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.test.multiContext.OrderContext; -import org.springframework.stereotype.Component; - -@Component("d") -public class DCmp extends NodeComponent { - - @Override - public void process() { - OrderContext orderContext = this.getContextBean(OrderContext.class); - orderContext.setCreateTime(DateUtil.parseDate("2022-06-15")); - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/multipleType/LiteflowMultipleTypeSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/multipleType/LiteflowMultipleTypeSpringbootTest.java deleted file mode 100644 index 74659c688..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/multipleType/LiteflowMultipleTypeSpringbootTest.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.yomahub.liteflow.test.multipleType; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - - -/** - * 测试springboot下混合格式规则的场景 - * @author Bryan.Zhang - * @since 2.5.10 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/multipleType/application.properties") -@SpringBootTest(classes = LiteflowMultipleTypeSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.multipleType.cmp"}) -public class LiteflowMultipleTypeSpringbootTest extends BaseTest { - - @Autowired - private FlowExecutor flowExecutor; - - @Test - public void testMultipleType() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a==>b==>c==>b==>a", response.getExecuteStepStr()); - response = flowExecutor.execute2Resp("chain3", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a==>b==>c", response.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/multipleType/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/multipleType/cmp/ACmp.java deleted file mode 100644 index 343dd85e8..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/multipleType/cmp/ACmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.multipleType.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("c") -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/nodeExecutor/CustomerDefaultNodeExecutor.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/nodeExecutor/CustomerDefaultNodeExecutor.java deleted file mode 100644 index 0ced9da9f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/nodeExecutor/CustomerDefaultNodeExecutor.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.yomahub.liteflow.test.nodeExecutor; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DataBus; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; -import com.yomahub.liteflow.flow.executor.NodeExecutor; - -/** - * 自定义默认的节点执行器 - */ -public class CustomerDefaultNodeExecutor extends NodeExecutor { - @Override - public void execute(NodeComponent instance) throws Exception { - DefaultContext context = instance.getFirstContextBean(); - LOG.info("使用customerDefaultNodeExecutor进行执行"); - context.setData("customerDefaultNodeExecutor", this.getClass()); - super.execute(instance); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/nodeExecutor/CustomerNodeExecutor.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/nodeExecutor/CustomerNodeExecutor.java deleted file mode 100644 index 5a9f2e58d..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/nodeExecutor/CustomerNodeExecutor.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.yomahub.liteflow.test.nodeExecutor; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DataBus; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; -import com.yomahub.liteflow.flow.executor.NodeExecutor; - -/** - * 自定义节点执行器 - */ -public class CustomerNodeExecutor extends NodeExecutor { - @Override - public void execute(NodeComponent instance) throws Exception { - DefaultContext context = instance.getFirstContextBean(); - LOG.info("使用customerNodeExecutor进行执行"); - context.setData("customerNodeExecutor", this.getClass()); - super.execute(instance); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/nodeExecutor/CustomerNodeExecutorAndCustomRetry.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/nodeExecutor/CustomerNodeExecutorAndCustomRetry.java deleted file mode 100644 index 003d33319..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/nodeExecutor/CustomerNodeExecutorAndCustomRetry.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.yomahub.liteflow.test.nodeExecutor; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DataBus; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; -import com.yomahub.liteflow.flow.executor.NodeExecutor; - -import java.util.concurrent.TimeUnit; - -/** - * 自定义节点执行器 - */ -public class CustomerNodeExecutorAndCustomRetry extends NodeExecutor { - @Override - public void execute(NodeComponent instance) throws Exception { - DefaultContext context = instance.getFirstContextBean(); - LOG.info("使用customerNodeExecutorAndCustomRetry进行执行"); - context.setData("customerNodeExecutorAndCustomRetry", this.getClass()); - super.execute(instance); - } - - @Override - protected void retry(NodeComponent instance, int currentRetryCount) throws Exception { - TimeUnit.MICROSECONDS.sleep(20L); - DefaultContext context = instance.getFirstContextBean(); - context.setData("retryLogic", this.getClass()); - super.retry(instance, currentRetryCount); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/nodeExecutor/LiteflowNodeExecutorSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/nodeExecutor/LiteflowNodeExecutorSpringbootTest.java deleted file mode 100644 index 45baf6bae..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/nodeExecutor/LiteflowNodeExecutorSpringbootTest.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.yomahub.liteflow.test.nodeExecutor; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - - -/** - * 测试springboot下的组件重试 - * - * @author Bryan.Zhang - * @since 2.5.10 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/nodeExecutor/application.properties") -@SpringBootTest(classes = LiteflowNodeExecutorSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.nodeExecutor.cmp"}) -public class LiteflowNodeExecutorSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - // 默认执行器测试 - @Test - public void testCustomerDefaultNodeExecutor() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals(CustomerDefaultNodeExecutor.class, context.getData("customerDefaultNodeExecutor")); - Assert.assertEquals("a", response.getExecuteStepStr()); - } - - //默认执行器测试+全局重试配置测试 - @Test - public void testDefaultExecutorForRetry() { - LiteflowResponse response = flowExecutor.execute2Resp("chain2", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals(CustomerDefaultNodeExecutor.class, context.getData("customerDefaultNodeExecutor")); - Assert.assertEquals("b==>b==>b", response.getExecuteStepStr()); - } - - //自定义执行器测试 - @Test - public void testCustomerExecutor() { - LiteflowResponse response = flowExecutor.execute2Resp("chain3", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("c", response.getExecuteStepStr()); - } - - //自定义执行器测试+全局重试配置测试 - @Test - public void testCustomExecutorForRetry() { - LiteflowResponse response = flowExecutor.execute2Resp("chain4", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertFalse(response.isSuccess()); - Assert.assertEquals(CustomerNodeExecutorAndCustomRetry.class, context.getData("retryLogic")); - Assert.assertEquals("d==>d==>d==>d==>d==>d", response.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/nodeExecutor/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/nodeExecutor/cmp/ACmp.java deleted file mode 100644 index 8fd765bb1..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/nodeExecutor/cmp/ACmp.java +++ /dev/null @@ -1,22 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.nodeExecutor.cmp; - -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.core.NodeComponent; - -@LiteflowComponent("b") -public class BCmp extends NodeComponent { - - private int flag = 0; - - @Override - public void process() { - System.out.println("BCmp executed!"); - if (flag < 2){ - flag++; - throw new RuntimeException("demo exception"); - } - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/nodeExecutor/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/nodeExecutor/cmp/CCmp.java deleted file mode 100644 index f800c08b2..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/nodeExecutor/cmp/CCmp.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.nodeExecutor.cmp; - -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.annotation.LiteflowRetry; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.flow.executor.NodeExecutor; -import com.yomahub.liteflow.test.nodeExecutor.CustomerNodeExecutor; - -@LiteflowComponent("c") -@LiteflowRetry(5) -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - - @Override - public Class getNodeExecutorClass() { - return CustomerNodeExecutor.class; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/nodeExecutor/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/nodeExecutor/cmp/DCmp.java deleted file mode 100644 index bc99b47a9..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/nodeExecutor/cmp/DCmp.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * - * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.nodeExecutor.cmp; - -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.annotation.LiteflowRetry; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.flow.executor.NodeExecutor; -import com.yomahub.liteflow.test.nodeExecutor.CustomerNodeExecutorAndCustomRetry; - -@LiteflowComponent("d") -@LiteflowRetry(retry = 5, forExceptions = {NullPointerException.class}) -public class DCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("DCmp executed!"); - throw new NullPointerException("demo exception"); - } - - @Override - public Class getNodeExecutorClass() { - return CustomerNodeExecutorAndCustomRetry.class; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/nullParam/NullParamSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/nullParam/NullParamSpringbootTest.java deleted file mode 100644 index b7d5eda9e..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/nullParam/NullParamSpringbootTest.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.yomahub.liteflow.test.nullParam; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -/** - * 单元测试:传递null param导致NPE的优化代码 - * - * @author LeoLee - * @since 2.6.6 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/nullParam/application.properties") -@SpringBootTest(classes = NullParamSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.nullParam.cmp"}) -public class NullParamSpringbootTest { - - @Autowired - private FlowExecutor flowExecutor; - - /** - * 支持无参的flow执行,以及param 为null时的异常抛出 - */ - @Test - public void testNullParam() throws Exception { - LiteflowResponse response = flowExecutor.execute2Resp("chain1"); - Assert.assertTrue(response.isSuccess()); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/nullParam/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/nullParam/cmp/ACmp.java deleted file mode 100644 index e518efd8c..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/nullParam/cmp/ACmp.java +++ /dev/null @@ -1,22 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.nullParam.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("a") -public class ACmp extends NodeComponent { - - @Override - public void process() { - System.out.println("ACmp executed!"); - System.out.println("get request data:" + this.getRequestData()); - this.getSlot().setInput("BCmp", "param for BCmp"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/nullParam/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/nullParam/cmp/BCmp.java deleted file mode 100644 index 52bdc4633..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/nullParam/cmp/BCmp.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.nullParam.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("b") -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BCmp executed!"); - System.out.println("BCmp param:" + this.getSlot().getInput("BCmp")); - this.getSlot().setOutput("CCmp", "param for CCmp"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/nullParam/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/nullParam/cmp/CCmp.java deleted file mode 100644 index 5707caf27..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/nullParam/cmp/CCmp.java +++ /dev/null @@ -1,22 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.nullParam.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("c") -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - System.out.println("CCmp param:" + this.getSlot().getOutput("CCmp")); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomParserJsonSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomParserJsonSpringbootTest.java deleted file mode 100644 index dd2b055e3..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomParserJsonSpringbootTest.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.yomahub.liteflow.test.parsecustom; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * springboot环境的自定义json parser单元测试 - * @author dongguo.tao - * @since 2.5.0 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/parsecustom/application-custom-json.properties") -@SpringBootTest(classes = CustomParserJsonSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.parsecustom.cmp"}) -public class CustomParserJsonSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //测试springboot场景的自定义json parser - @Test - public void testJsonCustomParser() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "args"); - Assert.assertTrue(response.isSuccess()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomParserXmlSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomParserXmlSpringbootTest.java deleted file mode 100644 index 47e80dee4..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomParserXmlSpringbootTest.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.yomahub.liteflow.test.parsecustom; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * springboot环境的自定义xml parser单元测试 - * 主要测试自定义配置源类是否能引入springboot中的其他依赖 - * @author bryan.zhang - * @since 2.5.7 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/parsecustom/application-custom-xml.properties") -@SpringBootTest(classes = CustomParserXmlSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.parsecustom.cmp","com.yomahub.liteflow.test.parsecustom.bean"}) -public class CustomParserXmlSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //测试springboot场景的自定义json parser - @Test - public void testXmlCustomParser() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "args"); - Assert.assertTrue(response.isSuccess()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomParserYmlSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomParserYmlSpringbootTest.java deleted file mode 100644 index 6094261bf..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomParserYmlSpringbootTest.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.yomahub.liteflow.test.parsecustom; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * springboot环境的自定义xml parser单元测试 - * 主要测试自定义配置源类是否能引入springboot中的其他依赖 - * @author bryan.zhang - * @since 2.5.7 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/parsecustom/application-custom-yml.properties") -@SpringBootTest(classes = CustomParserXmlSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.parsecustom.cmp","com.yomahub.liteflow.test.parsecustom.bean"}) -public class CustomParserYmlSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //测试springboot场景的自定义json parser - @Test - public void testYmlCustomParser() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "args"); - Assert.assertTrue(response.isSuccess()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/bean/TestBean.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/bean/TestBean.java deleted file mode 100644 index 3d4eece3b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/bean/TestBean.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.yomahub.liteflow.test.parsecustom.bean; - -import org.springframework.stereotype.Component; - -@Component -public class TestBean { - - public String returnXmlContent(){ - return ""; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/ACmp.java deleted file mode 100644 index a6af92af0..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/ACmp.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.parsecustom.cmp; - -import cn.hutool.core.util.StrUtil; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.exception.FlowSystemException; -import org.springframework.stereotype.Component; - -@Component("a") -public class ACmp extends NodeComponent { - - @Override - public void process() { - String str = this.getRequestData(); - if(StrUtil.isNotBlank(str) && str.equals("exception")) { - throw new FlowSystemException("chain execute execption"); - } - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/BCmp.java deleted file mode 100644 index 8eb4f0aad..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/BCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.parsecustom.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("b") -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/CCmp.java deleted file mode 100644 index 4590c5dee..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/CCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.parsecustom.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("d") -public class DCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("DCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/ECmp.java deleted file mode 100644 index 4f3a0d1e8..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/ECmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.parsecustom.cmp; - -import com.yomahub.liteflow.core.NodeSwitchComponent; -import org.springframework.stereotype.Component; - -@Component("e") -public class ECmp extends NodeSwitchComponent { - - @Override - public String processSwitch() throws Exception { - return "g"; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/FCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/FCmp.java deleted file mode 100644 index 517cd324e..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/FCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.parsecustom.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("f") -public class FCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("FCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/GCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/GCmp.java deleted file mode 100644 index ab04bf209..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/GCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.parsecustom.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("g") -public class GCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("GCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/parser/CustomJsonFlowParser.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/parser/CustomJsonFlowParser.java deleted file mode 100644 index dd3a41929..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/parser/CustomJsonFlowParser.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.yomahub.liteflow.test.parsecustom.parser; - -import com.yomahub.liteflow.parser.ClassJsonFlowParser; - -/** - * 模拟用户自定义源解析 - * @author dongguo.tao - * @since 2.5.0 - */ -public class CustomJsonFlowParser extends ClassJsonFlowParser { - @Override - public String parseCustom() { - //模拟自定义解析结果 - String content = "{\"flow\":{\"nodes\":{\"node\":[{\"id\":\"a\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.ACmp\"},{\"id\":\"b\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.BCmp\"},{\"id\":\"c\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.CCmp\"},{\"id\":\"d\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.DCmp\"},{\"id\":\"e\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.ECmp\"},{\"id\":\"f\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.FCmp\"},{\"id\":\"g\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.GCmp\"}]},\"chain\":[{\"name\":\"chain2\",\"condition\":[{\"type\":\"then\",\"value\":\"c,g,f\"}]},{\"name\":\"chain1\",\"condition\":[{\"type\":\"then\",\"value\":\"a,c\"},{\"type\":\"when\",\"value\":\"b,d,e(f|g)\"},{\"type\":\"then\",\"value\":\"chain2\"}]}]}}"; - return content; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/parser/CustomXmlFlowParser.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/parser/CustomXmlFlowParser.java deleted file mode 100644 index 064323b89..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/parser/CustomXmlFlowParser.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.yomahub.liteflow.test.parsecustom.parser; - -import com.yomahub.liteflow.parser.ClassXmlFlowParser; -import com.yomahub.liteflow.test.parsecustom.bean.TestBean; - -import javax.annotation.Resource; - -/** - * springboot环境的自定义xml parser单元测试 - * 主要测试自定义配置源类是否能引入springboot中的其他依赖 - * @author bryan.zhang - * @since 2.5.7 - */ -public class CustomXmlFlowParser extends ClassXmlFlowParser { - - @Resource - private TestBean testBean; - - @Override - public String parseCustom() { - return testBean.returnXmlContent(); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/parser/CustomYmlFlowParser.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/parser/CustomYmlFlowParser.java deleted file mode 100644 index f2a56e314..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parsecustom/parser/CustomYmlFlowParser.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.yomahub.liteflow.test.parsecustom.parser; - -import com.yomahub.liteflow.parser.ClassYmlFlowParser; - -/** - * springboot环境的自定义yml parser单元测试 - * 主要测试自定义配置源类是否能引入springboot中的其他依赖 - *

- * - * @author junjun - */ -public class CustomYmlFlowParser extends ClassYmlFlowParser { - - @Override - public String parseCustom() { - return "flow:\n" + - " chain:\n" + - " - name: chain1\n" + - " condition:\n" + - " - type: then\n" + - " value: 'a,b,c'"; - } -} \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parser/JsonParserSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parser/JsonParserSpringbootTest.java deleted file mode 100644 index 04707d903..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parser/JsonParserSpringbootTest.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.yomahub.liteflow.test.parser; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * spring环境的json parser单元测试 - * @author Bryan.Zhang - * @since 2.5.0 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/parser/application-json.properties") -@SpringBootTest(classes = JsonParserSpringbootTest.class) -@EnableAutoConfiguration -public class JsonParserSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //测试spring场景的json parser - @Test - public void testJsonParser() { - LiteflowResponse response = flowExecutor.execute2Resp("chain2", "arg"); - Assert.assertTrue(response.isSuccess()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parser/SpringELSupportSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parser/SpringELSupportSpringbootTest.java deleted file mode 100644 index 5234ab72d..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parser/SpringELSupportSpringbootTest.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.yomahub.liteflow.test.parser; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/parser/application-springEL.properties") -@SpringBootTest(classes = SpringELSupportSpringbootTest.class) -@EnableAutoConfiguration -public class SpringELSupportSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //测试springEL的解析情况 - @Test - public void testSpringELParser() { - LiteflowResponse response = flowExecutor.execute2Resp("chain11", "arg"); - Assert.assertTrue(response.isSuccess()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parser/XmlParserSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parser/XmlParserSpringbootTest.java deleted file mode 100644 index 2e52acc18..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parser/XmlParserSpringbootTest.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.yomahub.liteflow.test.parser; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * springboot环境的xml parser单元测试 - * @author Bryan.Zhang - * @since 2.5.0 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/parser/application-xml.properties") -@SpringBootTest(classes = XmlParserSpringbootTest.class) -@EnableAutoConfiguration -public class XmlParserSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //测试无springboot场景的xml parser - @Test - public void testXmlParser() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parser/YmlParserSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parser/YmlParserSpringbootTest.java deleted file mode 100644 index d64698267..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parser/YmlParserSpringbootTest.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.yomahub.liteflow.test.parser; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * springboot下的yml parser测试用例 - * @author Bryan.Zhang - * @since 2.5.0 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/parser/application-yml.properties") -@SpringBootTest(classes = YmlParserSpringbootTest.class) -@EnableAutoConfiguration -public class YmlParserSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //测试无springboot场景的yml parser - @Test - public void testYmlParser() { - LiteflowResponse response = flowExecutor.execute2Resp("chain2", "arg"); - Assert.assertTrue(response.isSuccess()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parser/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parser/cmp/ACmp.java deleted file mode 100644 index 2c6a9ddf4..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parser/cmp/ACmp.java +++ /dev/null @@ -1,22 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.parser.cmp; - -import cn.hutool.core.util.StrUtil; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.exception.FlowSystemException; -import org.springframework.stereotype.Component; - -@Component("a") -public class ACmp extends NodeComponent { - - @Override - public void process() { - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parser/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parser/cmp/BCmp.java deleted file mode 100644 index ee283f0ef..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parser/cmp/BCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.parser.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("b") -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parser/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parser/cmp/CCmp.java deleted file mode 100644 index 7be4d1b56..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parser/cmp/CCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.parser.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("d") -public class DCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("DCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parser/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parser/cmp/ECmp.java deleted file mode 100644 index e86aca5dc..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parser/cmp/ECmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.parser.cmp; - -import com.yomahub.liteflow.core.NodeSwitchComponent; -import org.springframework.stereotype.Component; - -@Component("e") -public class ECmp extends NodeSwitchComponent { - - @Override - public String processSwitch() throws Exception { - return "g"; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parser/cmp/FCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parser/cmp/FCmp.java deleted file mode 100644 index c4ce4ffde..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parser/cmp/FCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.parser.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("f") -public class FCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("FCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parser/cmp/GCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parser/cmp/GCmp.java deleted file mode 100644 index 4c0e80f1d..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/parser/cmp/GCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.parser.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("g") -public class GCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("GCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/PreAndFinallySpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/PreAndFinallySpringbootTest.java deleted file mode 100644 index 8887ad1aa..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/PreAndFinallySpringbootTest.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.yomahub.liteflow.test.preAndFinally; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * springboot环境下pre节点和finally节点的测试 - * @author Bryan.Zhang - * @since 2.6.4 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/preAndFinally/application.properties") -@SpringBootTest(classes = PreAndFinallySpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.preAndFinally.cmp"}) -public class PreAndFinallySpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //测试普通的pre和finally节点 - @Test - public void testPreAndFinally1() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("p1==>p2==>a==>b==>c==>f1==>f2",response.getExecuteStepStr()); - } - - //测试pre和finally节点不放在开头和结尾的情况 - @Test - public void testPreAndFinally2() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain2", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("p1==>p2==>a==>b==>c==>f1==>f2",response.getExecuteStepStr()); - } - - //测试有节点报错是否还执行finally节点的情况,其中d节点会报错,但依旧执行f1,f2节点 - @Test - public void testPreAndFinally3() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain3", "arg"); - Assert.assertFalse(response.isSuccess()); - Assert.assertEquals("p1==>p2==>a==>d==>f1==>f2", response.getExecuteStepStr()); - } - - //测试在finally节点里是否能获取exception - @Test - public void testPreAndFinally4() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain4", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertFalse(response.isSuccess()); - Assert.assertTrue(context.getData("hasEx")); - } - - //测试嵌套结构pre和finally是否在各自的chain里打出 - @Test - public void testPreAndFinally5() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain5", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("p1==>p2==>p1==>p2==>a==>b==>c==>f1==>f2==>f1", response.getExecuteStepStrWithoutTime()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/ACmp.java deleted file mode 100644 index 1dcd75200..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/ACmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.preAndFinally.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("b") -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/CCmp.java deleted file mode 100644 index 9219d67ac..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/CCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.preAndFinally.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("c") -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/DCmp.java deleted file mode 100644 index 3f1216a7a..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/DCmp.java +++ /dev/null @@ -1,22 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.preAndFinally.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("d") -public class DCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - int i = 1/0; - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Finally1Cmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Finally1Cmp.java deleted file mode 100644 index f826fb5ed..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Finally1Cmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.preAndFinally.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("f1") -public class Finally1Cmp extends NodeComponent { - - @Override - public void process() { - System.out.println("Finally1Cmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Finally2Cmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Finally2Cmp.java deleted file mode 100644 index 92157678a..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Finally2Cmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.preAndFinally.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("f2") -public class Finally2Cmp extends NodeComponent { - - @Override - public void process() { - System.out.println("Finally2Cmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Finally3Cmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Finally3Cmp.java deleted file mode 100644 index 22c4d1d2e..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Finally3Cmp.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.preAndFinally.cmp; - -import cn.hutool.core.util.ObjectUtil; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; -import org.springframework.stereotype.Component; - -@Component("f3") -public class Finally3Cmp extends NodeComponent { - - @Override - public void process() throws Exception{ - Slot slot = this.getSlot(); - DefaultContext context = slot.getFirstContextBean(); - if (ObjectUtil.isNull(slot.getException())){ - context.setData("hasEx", false); - }else{ - context.setData("hasEx", true); - } - System.out.println("Finally3Cmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Pre1Cmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Pre1Cmp.java deleted file mode 100644 index 741e15d49..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Pre1Cmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.preAndFinally.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("p1") -public class Pre1Cmp extends NodeComponent { - - @Override - public void process() { - System.out.println("Pre1Cmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Pre2Cmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Pre2Cmp.java deleted file mode 100644 index 43cd71f17..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Pre2Cmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.preAndFinally.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("p2") -public class Pre2Cmp extends NodeComponent { - - @Override - public void process() { - System.out.println("Pre2Cmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/privateDelivery/PrivateDeliverySpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/privateDelivery/PrivateDeliverySpringbootTest.java deleted file mode 100644 index 67c630f1f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/privateDelivery/PrivateDeliverySpringbootTest.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.yomahub.liteflow.test.privateDelivery; - -import cn.hutool.core.collection.ConcurrentHashSet; -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; -import java.util.Set; - -/** - * springboot环境下隐私投递的测试 - * @author Bryan.Zhang - * @since 2.5.0 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/privateDelivery/application.properties") -@SpringBootTest(classes = PrivateDeliverySpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.privateDelivery.cmp"}) -public class PrivateDeliverySpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testPrivateDelivery() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - DefaultContext context = response.getFirstContextBean(); - ConcurrentHashSet set = context.getData("testSet"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals(100, set.size()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/privateDelivery/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/privateDelivery/cmp/ACmp.java deleted file mode 100644 index 253901045..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/privateDelivery/cmp/ACmp.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.privateDelivery.cmp; - -import cn.hutool.core.collection.ConcurrentHashSet; -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; - -import java.util.HashSet; - -@LiteflowComponent("a") -public class ACmp extends NodeComponent { - - @Override - public void process() { - System.out.println("ACmp executed!"); - DefaultContext context = this.getFirstContextBean(); - context.setData("testSet", new ConcurrentHashSet<>()); - - for (int i = 0; i < 100; i++) { - this.sendPrivateDeliveryData("b",i+1); - } - } -} - diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/privateDelivery/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/privateDelivery/cmp/BCmp.java deleted file mode 100644 index ab5de1a08..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/privateDelivery/cmp/BCmp.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.privateDelivery.cmp; - -import cn.hutool.core.collection.ConcurrentHashSet; -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import org.springframework.stereotype.Component; - -import java.util.Set; - -@LiteflowComponent("b") -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BCmp executed!"); - Integer value = this.getPrivateDeliveryData(); - DefaultContext context = this.getFirstContextBean(); - ConcurrentHashSet testSet = context.getData("testSet"); - testSet.add(value); - } -} - diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/privateDelivery/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/privateDelivery/cmp/CCmp.java deleted file mode 100644 index 8d79eb1bc..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/privateDelivery/cmp/CCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.privateDelivery.cmp; - -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.core.NodeComponent; - -@LiteflowComponent("d") -public class DCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/refreshRule/RefreshRuleSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/refreshRule/RefreshRuleSpringbootTest.java deleted file mode 100644 index f631f2c67..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/refreshRule/RefreshRuleSpringbootTest.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.yomahub.liteflow.test.refreshRule; - -import cn.hutool.core.io.resource.ResourceUtil; -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.enums.FlowParserTypeEnum; -import com.yomahub.liteflow.flow.FlowBus; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * springboot环境下重新加载规则测试 - * @author Bryan.Zhang - * @since 2.6.4 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/refreshRule/application.properties") -@SpringBootTest(classes = RefreshRuleSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.refreshRule.cmp"}) -public class RefreshRuleSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //测试普通刷新流程的场景 - @Test - public void testRefresh1() throws Exception{ - String content = ResourceUtil.readUtf8Str("classpath: /refreshRule/flow_update.xml"); - FlowBus.refreshFlowMetaData(FlowParserTypeEnum.TYPE_XML, content); - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - } - - //测试优雅刷新的场景 - @Test - public void testRefresh2() throws Exception{ - new Thread(() -> { - try { - Thread.sleep(3000L); - String content = ResourceUtil.readUtf8Str("classpath: /refreshRule/flow_update.xml"); - FlowBus.refreshFlowMetaData(FlowParserTypeEnum.TYPE_XML, content); - } catch (Exception e) { - e.printStackTrace(); - } - - }).start(); - - for (int i = 0; i < 500; i++) { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - try { - Thread.sleep(10L); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/refreshRule/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/refreshRule/cmp/ACmp.java deleted file mode 100644 index 96d599a5b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/refreshRule/cmp/ACmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.refreshRule.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("c") -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/reload/ReloadSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/reload/ReloadSpringbootTest.java deleted file mode 100644 index f18a20c2b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/reload/ReloadSpringbootTest.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.yomahub.liteflow.test.reload; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * springboot环境下重新加载规则测试 - * @author Bryan.Zhang - * @since 2.5.0 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/reload/application.properties") -@SpringBootTest(classes = ReloadSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.reload.cmp"}) -public class ReloadSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //用reloadRule去重新加载,这里如果配置是放在本地。如果想修改,则要去修改target下面的flow.xml - //这里的测试,手动打断点然后去修改,是ok的。但是整个测试,暂且只是为了测试这个功能是否能正常运行 - @Test - public void testReload() throws Exception{ - flowExecutor.reloadRule(); - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/reload/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/reload/cmp/ACmp.java deleted file mode 100644 index fcf6fed45..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/reload/cmp/ACmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.reload.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("b") -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/reload/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/reload/cmp/CCmp.java deleted file mode 100644 index 48620d98c..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/reload/cmp/CCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.reload.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("c") -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/removeChain/RemoveChainSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/removeChain/RemoveChainSpringbootTest.java deleted file mode 100644 index 13da53ec2..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/removeChain/RemoveChainSpringbootTest.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.yomahub.liteflow.test.removeChain; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.flow.FlowBus; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * springboot环境最普通的例子测试 - * @author Bryan.Zhang - * @since 2.6.4 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/removeChain/application.properties") -@SpringBootTest(classes = RemoveChainSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.removeChain.cmp"}) -public class RemoveChainSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testRemoveChain() throws Exception{ - LiteflowResponse response1 = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response1.isSuccess()); - FlowBus.removeChain("chain1"); - LiteflowResponse response2 = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertFalse(response2.isSuccess()); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/removeChain/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/removeChain/cmp/ACmp.java deleted file mode 100644 index 8640323d1..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/removeChain/cmp/ACmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

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

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.removeChain.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("d") -public class DCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/requestId/LiteflowRequestIdSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/requestId/LiteflowRequestIdSpringbootTest.java deleted file mode 100644 index a7f4962d2..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/requestId/LiteflowRequestIdSpringbootTest.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.yomahub.liteflow.test.requestId; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * @author tangkc - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/requestId/application.properties") -@SpringBootTest(classes = LiteflowRequestIdSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.requestId.cmp"}) -public class LiteflowRequestIdSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testRequestId() throws Exception { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("1", response.getSlot().getRequestId()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/requestId/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/requestId/cmp/ACmp.java deleted file mode 100644 index 9cbef6dc0..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/requestId/cmp/ACmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * - * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.requestId.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("a") -@LiteflowCmpDefine -public class ACmp { - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/requestId/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/requestId/cmp/BCmp.java deleted file mode 100644 index 01495457b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/requestId/cmp/BCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.requestId.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("b") -@LiteflowCmpDefine -public class BCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/requestId/config/CustomRequestIdGenerator.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/requestId/config/CustomRequestIdGenerator.java deleted file mode 100644 index fcaa9e84b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/requestId/config/CustomRequestIdGenerator.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.yomahub.liteflow.test.requestId.config; - -import com.yomahub.liteflow.flow.id.RequestIdGenerator; - -import java.util.concurrent.atomic.AtomicInteger; - -/** - * @author tangkc - */ -public class CustomRequestIdGenerator implements RequestIdGenerator { - - private final AtomicInteger atomicInteger = new AtomicInteger(0); - - @Override - public String generate() { - return atomicInteger.incrementAndGet() + ""; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/resizeSlot/ResizeSlotSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/resizeSlot/ResizeSlotSpringbootTest.java deleted file mode 100644 index 1f973aa07..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/resizeSlot/ResizeSlotSpringbootTest.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.yomahub.liteflow.test.resizeSlot; - -import cn.hutool.core.util.ReflectUtil; -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.slot.DataBus; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; -import java.lang.reflect.Field; -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.*; - -/** - * springboot环境下slot扩容测试 - * @author Bryan.Zhang - * @since 2.5.0 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/resizeSlot/application.properties") -@SpringBootTest(classes = ResizeSlotSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.resizeSlot.cmp"}) -public class ResizeSlotSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testResize() throws Exception{ - ExecutorService pool = Executors.newCachedThreadPool(); - - List> futureList = new ArrayList<>(); - for (int i = 0; i < 100; i++) { - Future future = pool.submit(() -> flowExecutor.execute2Resp("chain1", "arg")); - futureList.add(future); - } - - for(Future future : futureList){ - Assert.assertTrue(future.get().isSuccess()); - } - - //取到static的对象QUEUE - Field field = ReflectUtil.getField(DataBus.class, "QUEUE"); - ConcurrentLinkedQueue queue = (ConcurrentLinkedQueue) ReflectUtil.getStaticFieldValue(field); - - //因为初始slotSize是4,按照0.75的扩容比,要满足100个线程,应该扩容5~6次,5次=65,6次=114 - //为什么不是直接114呢? - //因为在单测中根据机器的性能,在多线程情况下,有些机器跑的慢一点,也就是说65个就足够了。有些机器跑的快一点,是能真正扩容到114个的 - Assert.assertTrue(queue.size() > 4); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/resizeSlot/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/resizeSlot/cmp/ACmp.java deleted file mode 100644 index 4f466e1c5..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/resizeSlot/cmp/ACmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.resizeSlot.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("b") -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/resizeSlot/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/resizeSlot/cmp/CCmp.java deleted file mode 100644 index 7dc427c11..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/resizeSlot/cmp/CCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.resizeSlot.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("c") -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/subflow/ImplicitSubFlowSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/subflow/ImplicitSubFlowSpringbootTest.java deleted file mode 100644 index 15591e164..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/subflow/ImplicitSubFlowSpringbootTest.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.yomahub.liteflow.test.subflow; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; -import java.util.HashSet; -import java.util.Set; - -/** - * 测试隐式调用子流程 - * 单元测试 - * - * @author justin.xu - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/subflow/application-implicit.properties") -@SpringBootTest(classes = ImplicitSubFlowSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.subflow.cmp2"}) -public class ImplicitSubFlowSpringbootTest extends BaseTest { - @Resource - private FlowExecutor flowExecutor; - - public static final Set RUN_TIME_SLOT = new HashSet<>(); - - //这里GCmp中隐式的调用chain4,从而执行了h,m - @Test - public void testImplicitSubFlow() { - LiteflowResponse response = flowExecutor.execute2Resp("chain3", "it's a request"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("f==>g==>h==>m", response.getExecuteStepStr()); - - // 传递了slotIndex,则set的size==1 - Assert.assertEquals(1, RUN_TIME_SLOT.size()); - // set中第一次设置的requestId和response中的requestId一致 - Assert.assertTrue(RUN_TIME_SLOT.contains(response.getSlot().getRequestId())); - //requestData的取值正确 - Assert.assertEquals("it's implicit subflow.", context.getData("innerRequest")); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/subflow/SubflowInDifferentConfigSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/subflow/SubflowInDifferentConfigSpringbootTest.java deleted file mode 100644 index 3eb708eda..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/subflow/SubflowInDifferentConfigSpringbootTest.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.yomahub.liteflow.test.subflow; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.exception.MultipleParsersException; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.ApplicationContext; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * 测试主流程与子流程在不同的配置文件的场景 - * - * @author Bryan.Zhang - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/subflow/application-subInDifferentConfig1.properties") -@SpringBootTest(classes = SubflowInDifferentConfigSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.subflow.cmp1","com.yomahub.liteflow.test.subflow.cmp2"}) -public class SubflowInDifferentConfigSpringbootTest extends BaseTest { - @Resource - private FlowExecutor flowExecutor; - - //是否按照流程定义配置执行 - @Test - public void testExplicitSubFlow1() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "it's a request"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a==>b==>b==>a==>e==>d", response.getExecuteStepStr()); - } - - @Autowired - private ApplicationContext context; - - //主要测试有不同的配置类型后会不会报出既定的错误 - @Test(expected = MultipleParsersException.class) - public void testExplicitSubFlow2() { - LiteflowConfig config = context.getBean(LiteflowConfig.class); - config.setRuleSource("subflow/flow-main.xml,subflow/flow-sub1.xml,subflow/flow-sub2.yml"); - flowExecutor.init(); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/subflow/SubflowJsonSpringBootTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/subflow/SubflowJsonSpringBootTest.java deleted file mode 100644 index 80b24197f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/subflow/SubflowJsonSpringBootTest.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.yomahub.liteflow.test.subflow; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * 测试显示调用子流程(json) - * 单元测试 - * - * @author justin.xu - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/subflow/application-json.properties") -@SpringBootTest(classes = SubflowJsonSpringBootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.subflow.cmp1"}) -public class SubflowJsonSpringBootTest extends BaseTest { - @Resource - private FlowExecutor flowExecutor; - - //是否按照流程定义配置执行 - @Test - public void testExplicitSubFlow() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "it's a request"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a==>b==>c==>b==>a==>e==>d", response.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/subflow/SubflowXMLSpringBootTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/subflow/SubflowXMLSpringBootTest.java deleted file mode 100644 index 700d05a5e..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/subflow/SubflowXMLSpringBootTest.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.yomahub.liteflow.test.subflow; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * 测试显示调用子流程(xml) - * 单元测试 - * - * @author justin.xu - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/subflow/application-xml.properties") -@SpringBootTest(classes = SubflowXMLSpringBootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.subflow.cmp1"}) -public class SubflowXMLSpringBootTest extends BaseTest { - @Resource - private FlowExecutor flowExecutor; - - //是否按照流程定义配置执行 - @Test - public void testExplicitSubFlow() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "it's a request"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a==>b==>c==>b==>a==>e==>d", response.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/subflow/SubflowYmlSpringBootTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/subflow/SubflowYmlSpringBootTest.java deleted file mode 100644 index 283c0d7cd..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/subflow/SubflowYmlSpringBootTest.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.yomahub.liteflow.test.subflow; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * 测试显示调用子流程(yml) - * 单元测试 - * - * @author justin.xu - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/subflow/application-yml.properties") -@SpringBootTest(classes = SubflowYmlSpringBootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.subflow.cmp1"}) -public class SubflowYmlSpringBootTest extends BaseTest { - @Resource - private FlowExecutor flowExecutor; - - //是否按照流程定义配置执行 - @Test - public void testExplicitSubFlowYml() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "it's a request"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a==>b==>c==>b==>a==>e==>d", response.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/ACmp.java deleted file mode 100644 index 75a7fb49b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/ACmp.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.yomahub.liteflow.test.subflow.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - - -@Component("a") -public class ACmp extends NodeComponent { - @Override - public void process() { - System.out.println("Acomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/BCmp.java deleted file mode 100644 index 9fb3c9326..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/BCmp.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.yomahub.liteflow.test.subflow.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - - -@Component("b") -public class BCmp extends NodeComponent { - @Override - public void process() { - System.out.println("Bcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/CCmp.java deleted file mode 100644 index ce8ea149f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/CCmp.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.yomahub.liteflow.test.subflow.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - - -@Component("c") -public class CCmp extends NodeComponent { - @Override - public void process() throws Exception { - System.out.println("Ccomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/DCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/DCmp.java deleted file mode 100644 index 309196e9b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/DCmp.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.yomahub.liteflow.test.subflow.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - - -@Component("d") -public class DCmp extends NodeComponent { - @Override - public void process() throws Exception { - System.out.println("Dcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/ECmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/ECmp.java deleted file mode 100644 index b855a1ae0..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/ECmp.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.yomahub.liteflow.test.subflow.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - - -@Component("e") -public class ECmp extends NodeComponent { - - @Override - public void process() throws Exception { - System.out.println("Ecomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/FCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/FCmp.java deleted file mode 100644 index cd352edd3..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/FCmp.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.yomahub.liteflow.test.subflow.cmp2; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import org.springframework.stereotype.Component; - -import static com.yomahub.liteflow.test.subflow.ImplicitSubFlowSpringbootTest.RUN_TIME_SLOT; - - -@Component("f") -public class FCmp extends NodeComponent { - @Override - public void process() throws Exception { - - RUN_TIME_SLOT.add(this.getSlot().getRequestId()); - - DefaultContext context = this.getFirstContextBean(); - context.setData("innerRequestData", "inner request"); - - System.out.println("Fcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/GCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/GCmp.java deleted file mode 100644 index 2fd252069..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/GCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.yomahub.liteflow.test.subflow.cmp2; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -import static com.yomahub.liteflow.test.subflow.ImplicitSubFlowSpringbootTest.RUN_TIME_SLOT; - - -@Component("g") -public class GCmp extends NodeComponent { - - @Override - public void process() throws Exception { - - RUN_TIME_SLOT.add(this.getSlot().getRequestId()); - - System.out.println("Gcmp executed!"); - - this.invoke("chain4", "it's implicit subflow."); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/HCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/HCmp.java deleted file mode 100644 index e594daf37..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/HCmp.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.yomahub.liteflow.test.subflow.cmp2; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import org.springframework.stereotype.Component; - -import static com.yomahub.liteflow.test.subflow.ImplicitSubFlowSpringbootTest.RUN_TIME_SLOT; - - -@Component("h") -public class HCmp extends NodeComponent { - @Override - public void process() throws Exception { - String requestData = this.getSubChainReqData(); - DefaultContext context = this.getFirstContextBean(); - context.setData("innerRequest", requestData); - - RUN_TIME_SLOT.add(this.getSlot().getRequestId()); - - System.out.println("Hcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/MCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/MCmp.java deleted file mode 100644 index 9e8d291df..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/MCmp.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.yomahub.liteflow.test.subflow.cmp2; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -import static com.yomahub.liteflow.test.subflow.ImplicitSubFlowSpringbootTest.RUN_TIME_SLOT; - - -@Component("m") -public class MCmp extends NodeComponent { - @Override - public void process() throws Exception { - - RUN_TIME_SLOT.add(this.getSlot().getRequestId()); - - System.out.println("Mcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/tag/NodeTagSpringbootJsonTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/tag/NodeTagSpringbootJsonTest.java deleted file mode 100644 index 31fb76114..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/tag/NodeTagSpringbootJsonTest.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.yomahub.liteflow.test.tag; - -import cn.hutool.core.collection.ConcurrentHashSet; -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * springboot环境下隐私投递的测试 - * @author Bryan.Zhang - * @since 2.5.0 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/tag/application-json.properties") -@SpringBootTest(classes = NodeTagSpringbootJsonTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.tag.cmp"}) -public class NodeTagSpringbootJsonTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testTag1() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("123",context.getData("test")); - } - - @Test - public void testTag2() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain2", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a==>a==>a==>c==>e", response.getExecuteStepStr()); - } - - //测试多线程when情况下的tag取值是否正确 - //这里循环多次的原因是,因为when多线程,有时候因为凑巧,可能正确。所以多次情况下在2.6.4版本肯定出错 - @Test - public void testTag3() throws Exception{ - for (int i = 0; i < 50; i++) { - LiteflowResponse response = flowExecutor.execute2Resp("chain3", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - ConcurrentHashSet testSet = context.getData("test"); - Assert.assertEquals(3, testSet.size()); - } - } - - //测试tag是否能在isAccess中起效 - @Test - public void testTag4() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain4", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("g", response.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/tag/NodeTagSpringbootXmlTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/tag/NodeTagSpringbootXmlTest.java deleted file mode 100644 index e7e0b58fd..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/tag/NodeTagSpringbootXmlTest.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.yomahub.liteflow.test.tag; - -import cn.hutool.core.collection.ConcurrentHashSet; -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * springboot环境下隐私投递的测试 - * @author Bryan.Zhang - * @since 2.5.0 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/tag/application-xml.properties") -@SpringBootTest(classes = NodeTagSpringbootXmlTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.tag.cmp"}) -public class NodeTagSpringbootXmlTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testTag1() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("123",context.getData("test")); - } - - @Test - public void testTag2() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain2", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a==>a==>a==>c==>e", response.getExecuteStepStr()); - } - - //测试多线程when情况下的tag取值是否正确 - //这里循环多次的原因是,因为when多线程,有时候因为凑巧,可能正确。所以多次情况下在2.6.4版本肯定出错 - @Test - public void testTag3() throws Exception{ - for (int i = 0; i < 50; i++) { - LiteflowResponse response = flowExecutor.execute2Resp("chain3", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - ConcurrentHashSet testSet = context.getData("test"); - Assert.assertEquals(3, testSet.size()); - } - } - - //测试tag是否能在isAccess中起效 - @Test - public void testTag4() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain4", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("g", response.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/tag/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/tag/cmp/ACmp.java deleted file mode 100644 index 6e2a73ffd..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/tag/cmp/ACmp.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.tag.cmp; - -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; - -@LiteflowComponent("a") -public class ACmp extends NodeComponent { - - @Override - public void process() { - String testKey = "test"; - - DefaultContext context = this.getFirstContextBean(); - if (context.getData(testKey) == null){ - context.setData(testKey,this.getTag()); - }else{ - String s = context.getData(testKey); - s += this.getTag(); - context.setData(testKey, s); - } - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/tag/cmp/B1Cmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/tag/cmp/B1Cmp.java deleted file mode 100644 index de3d6aba5..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/tag/cmp/B1Cmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.tag.cmp; - -import cn.hutool.core.collection.ConcurrentHashSet; -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; - -@LiteflowComponent("b1") -public class B1Cmp extends NodeComponent { - - @Override - public void process() { - DefaultContext context = this.getFirstContextBean(); - context.setData("test",new ConcurrentHashSet()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/tag/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/tag/cmp/BCmp.java deleted file mode 100644 index 58841874b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/tag/cmp/BCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.tag.cmp; - -import cn.hutool.core.collection.ConcurrentHashSet; -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; - -@LiteflowComponent("b") -public class BCmp extends NodeComponent { - - @Override - public void process() { - DefaultContext context = this.getFirstContextBean(); - ConcurrentHashSet testSet = context.getData("test"); - testSet.add(this.getTag()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/tag/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/tag/cmp/CCmp.java deleted file mode 100644 index ceedd8abe..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/tag/cmp/CCmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.tag.cmp; - -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.core.NodeSwitchComponent; - -@LiteflowComponent("c") -public class CCmp extends NodeSwitchComponent { - - @Override - public String processSwitch() throws Exception { - if(this.getTag().equals("2")){ - return "e"; - }else{ - return "d"; - } - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/tag/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/tag/cmp/DCmp.java deleted file mode 100644 index 572980b78..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/tag/cmp/DCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.tag.cmp; - -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.core.NodeComponent; - -@LiteflowComponent("e") -public class ECmp extends NodeComponent { - - @Override - public void process() { - System.out.println(this.getTag()); - System.out.println("ECmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/tag/cmp/FCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/tag/cmp/FCmp.java deleted file mode 100644 index 2f670578e..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/tag/cmp/FCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.tag.cmp; - -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.core.NodeComponent; - -@LiteflowComponent("f") -public class FCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("FCmp executed!"); - } - - @Override - public boolean isAccess() { - return Boolean.parseBoolean(this.getTag()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/tag/cmp/GCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/tag/cmp/GCmp.java deleted file mode 100644 index f6180b563..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/tag/cmp/GCmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.tag.cmp; - -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.core.NodeComponent; - -@LiteflowComponent("g") -public class GCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("GCmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/TestTL.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/TestTL.java deleted file mode 100644 index fee0055e5..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/TestTL.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.yomahub.liteflow.test.useTTLInWhen; - -import com.alibaba.ttl.TransmittableThreadLocal; - -public class TestTL { - - public static ThreadLocal tl = new TransmittableThreadLocal<>(); - - public static String get(){ - return tl.get(); - } - - public static void set(String value){ - tl.set(value); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/UseTTLInWhenSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/UseTTLInWhenSpringbootTest.java deleted file mode 100644 index dbfecb808..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/UseTTLInWhenSpringbootTest.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.yomahub.liteflow.test.useTTLInWhen; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * 在when异步节点的情况下去拿ThreadLocal里的测试场景 - * @author Bryan.Zhang - * @since 2.6.3 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/useTTLInWhen/application.properties") -@SpringBootTest(classes = UseTTLInWhenSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.useTTLInWhen.cmp"}) -public class UseTTLInWhenSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testUseTTLInWhen() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertEquals("hello,b", context.getData("b")); - Assert.assertEquals("hello,c", context.getData("c")); - Assert.assertEquals("hello,d", context.getData("d")); - Assert.assertEquals("hello,e", context.getData("e")); - Assert.assertEquals("hello,f", context.getData("f")); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/ACmp.java deleted file mode 100644 index bab445a4b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/ACmp.java +++ /dev/null @@ -1,22 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.useTTLInWhen.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.test.useTTLInWhen.TestTL; -import org.springframework.stereotype.Component; - -@Component("a") -public class ACmp extends NodeComponent { - - @Override - public void process() { - TestTL.set("hello"); - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/BCmp.java deleted file mode 100644 index 7597ad59c..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/BCmp.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.useTTLInWhen.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.useTTLInWhen.TestTL; -import org.springframework.stereotype.Component; - -@Component("b") -public class BCmp extends NodeComponent { - - @Override - public void process() { - String value = TestTL.get(); - DefaultContext context = this.getFirstContextBean(); - context.setData(this.getNodeId(),value+",b"); - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/CCmp.java deleted file mode 100644 index bc5c7ca69..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/CCmp.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.useTTLInWhen.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.useTTLInWhen.TestTL; -import org.springframework.stereotype.Component; - -@Component("c") -public class CCmp extends NodeComponent { - - @Override - public void process() { - String value = TestTL.get(); - DefaultContext context = this.getFirstContextBean(); - context.setData(this.getNodeId(),value+",c"); - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/DCmp.java deleted file mode 100644 index 1410921d8..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/DCmp.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.useTTLInWhen.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.useTTLInWhen.TestTL; -import org.springframework.stereotype.Component; - -@Component("d") -public class DCmp extends NodeComponent { - - @Override - public void process() { - String value = TestTL.get(); - DefaultContext context = this.getFirstContextBean(); - context.setData(this.getNodeId(),value+",d"); - System.out.println("DCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/ECmp.java deleted file mode 100644 index 6217dd6a9..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/ECmp.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.useTTLInWhen.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.useTTLInWhen.TestTL; -import org.springframework.stereotype.Component; - -@Component("e") -public class ECmp extends NodeComponent { - - @Override - public void process() { - String value = TestTL.get(); - DefaultContext context = this.getFirstContextBean(); - context.setData(this.getNodeId(),value+",e"); - System.out.println("ECmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/FCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/FCmp.java deleted file mode 100644 index 06380e58c..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/FCmp.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.useTTLInWhen.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.useTTLInWhen.TestTL; -import org.springframework.stereotype.Component; - -@Component("f") -public class FCmp extends NodeComponent { - - @Override - public void process() { - String value = TestTL.get(); - DefaultContext context = this.getFirstContextBean(); - context.setData(this.getNodeId(),value+",f"); - System.out.println("FCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/whenTimeOut/WhenTimeOutSpringbootTest1.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/whenTimeOut/WhenTimeOutSpringbootTest1.java deleted file mode 100644 index c85ea7521..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/whenTimeOut/WhenTimeOutSpringbootTest1.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.yomahub.liteflow.test.whenTimeOut; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.exception.WhenTimeoutException; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * springboot环境下异步线程超时日志打印测试 - * @author Bryan.Zhang - * @since 2.6.4 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/whenTimeOut/application1.properties") -@SpringBootTest(classes = WhenTimeOutSpringbootTest1.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.whenTimeOut.cmp"}) -public class WhenTimeOutSpringbootTest1 extends BaseTest { - - private final Logger log = LoggerFactory.getLogger(this.getClass()); - - @Resource - private FlowExecutor flowExecutor; - - //其中b和c在when情况下超时,所以抛出了WhenTimeoutException这个错 - @Test - public void testWhenTimeOut() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertFalse(response.isSuccess()); - Assert.assertEquals(WhenTimeoutException.class, response.getCause().getClass()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/whenTimeOut/WhenTimeOutSpringbootTest2.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/whenTimeOut/WhenTimeOutSpringbootTest2.java deleted file mode 100644 index e3377ef0a..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/whenTimeOut/WhenTimeOutSpringbootTest2.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.yomahub.liteflow.test.whenTimeOut; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * springboot环境下异步线程超时日志打印测试 - * @author Bryan.Zhang - * @since 2.6.4 - */ -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/whenTimeOut/application2.properties") -@SpringBootTest(classes = WhenTimeOutSpringbootTest2.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.whenTimeOut.cmp"}) -public class WhenTimeOutSpringbootTest2 extends BaseTest { - - private final Logger log = LoggerFactory.getLogger(this.getClass()); - - @Resource - private FlowExecutor flowExecutor; - - //其中d,e,f都sleep 4秒,其中def是不同的组,超时设置5秒 - @Test - public void testWhenTimeOut() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/ACmp.java deleted file mode 100644 index 19b0bc06d..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/ACmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.whenTimeOut.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("a") -public class ACmp extends NodeComponent { - - @Override - public void process() { - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/BCmp.java deleted file mode 100644 index fb8cd2a1c..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/BCmp.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.whenTimeOut.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("b") -public class BCmp extends NodeComponent { - - @Override - public void process() { - try { - Thread.sleep(4000); - }catch (Exception ignored){ - - } - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/CCmp.java deleted file mode 100644 index ee9fe9773..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/CCmp.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.whenTimeOut.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("c") -public class CCmp extends NodeComponent { - - @Override - public void process() { - try { - Thread.sleep(3500); - }catch (Exception ignored){ - - } - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/DCmp.java deleted file mode 100644 index 5f3c4b3fb..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/DCmp.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.whenTimeOut.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("d") -public class DCmp extends NodeComponent { - - @Override - public void process() { - try { - Thread.sleep(4000); - }catch (Exception ignored){ - - } - System.out.println("DCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/ECmp.java deleted file mode 100644 index 0e18aee71..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/ECmp.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.whenTimeOut.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("e") -public class ECmp extends NodeComponent { - - @Override - public void process() { - try { - Thread.sleep(4000); - }catch (Exception ignored){ - - } - System.out.println("ECmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/FCmp.java b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/FCmp.java deleted file mode 100644 index fad1d2d66..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/FCmp.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.whenTimeOut.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("f") -public class FCmp extends NodeComponent { - - @Override - public void process() { - try { - Thread.sleep(4000); - }catch (Exception ignored){ - - } - System.out.println("FCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/absoluteConfigPath/application.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/absoluteConfigPath/application.properties deleted file mode 100644 index 55fe91fd8..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/absoluteConfigPath/application.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=/usr/local/flow.xml \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/absoluteConfigPath/flow.xml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/absoluteConfigPath/flow.xml deleted file mode 100644 index a6fda5aa0..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/absoluteConfigPath/flow.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/aop/application.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/aop/application.properties deleted file mode 100644 index f9075d1c6..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/aop/application.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=aop/flow.xml \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/aop/flow.xml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/aop/flow.xml deleted file mode 100644 index 84e8d4588..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/aop/flow.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/asyncNode/application.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/asyncNode/application.properties deleted file mode 100644 index db0c76e72..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/asyncNode/application.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=asyncNode/flow.xml \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/asyncNode/flow.xml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/asyncNode/flow.xml deleted file mode 100644 index e81546bb6..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/asyncNode/flow.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/bannerPrint/application.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/bannerPrint/application.properties deleted file mode 100644 index 589d44e7b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/bannerPrint/application.properties +++ /dev/null @@ -1,2 +0,0 @@ -liteflow.rule-source=bannerPrint/flow.xml -liteflow.print-banner=true \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/bannerPrint/flow.xml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/bannerPrint/flow.xml deleted file mode 100644 index 22870d94f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/bannerPrint/flow.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/base/application.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/base/application.properties deleted file mode 100644 index cf3ccb24b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/base/application.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=base/flow.xml \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/base/flow.xml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/base/flow.xml deleted file mode 100644 index 123608049..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/base/flow.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/cmpRetry/application.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/cmpRetry/application.properties deleted file mode 100644 index bd5d04cdb..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/cmpRetry/application.properties +++ /dev/null @@ -1,3 +0,0 @@ -liteflow.rule-source=cmpRetry/flow.xml -liteflow.retry-count=3 -liteflow.slot-size=512 \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/cmpRetry/flow.xml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/cmpRetry/flow.xml deleted file mode 100644 index d44e3ee05..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/cmpRetry/flow.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/cmpStep/application.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/cmpStep/application.properties deleted file mode 100644 index e305266de..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/cmpStep/application.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=cmpStep/flow.xml \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/cmpStep/flow.xml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/cmpStep/flow.xml deleted file mode 100644 index cd127f1ab..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/cmpStep/flow.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/component/application.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/component/application.properties deleted file mode 100644 index d5b0e66d5..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/component/application.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=component/flow.xml \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/component/flow.xml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/component/flow.xml deleted file mode 100644 index 2a504fd01..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/component/flow.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/config/aaa/bbb/flow1.xml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/config/aaa/bbb/flow1.xml deleted file mode 100644 index ced398c9b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/config/aaa/bbb/flow1.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/config/aaa/flow0.xml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/config/aaa/flow0.xml deleted file mode 100644 index 22870d94f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/config/aaa/flow0.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/config/application1.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/config/application1.properties deleted file mode 100644 index 4ac6c4d63..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/config/application1.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=config/flow.yml \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/config/application2.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/config/application2.properties deleted file mode 100644 index 5079ac3d2..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/config/application2.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=config/**/flow*.xml \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/config/flow.yml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/config/flow.yml deleted file mode 100644 index 3cdaced3e..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/config/flow.yml +++ /dev/null @@ -1,6 +0,0 @@ -flow: - chain: - - name: chain1 - condition: - - type: then - value: 'a,b,c' diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/customNodes/application.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/customNodes/application.properties deleted file mode 100644 index ab7716a61..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/customNodes/application.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=customNodes/flow.xml \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/customNodes/flow.xml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/customNodes/flow.xml deleted file mode 100644 index ecc1abcd6..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/customNodes/flow.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/customWhenThreadPool/application.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/customWhenThreadPool/application.properties deleted file mode 100644 index 3447aaa3f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/customWhenThreadPool/application.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=customWhenThreadPool/flow.xml \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/customWhenThreadPool/flow.xml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/customWhenThreadPool/flow.xml deleted file mode 100644 index c6f199ddb..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/customWhenThreadPool/flow.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/deadLoopChain/application.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/deadLoopChain/application.properties deleted file mode 100644 index 8e35187c2..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/deadLoopChain/application.properties +++ /dev/null @@ -1,2 +0,0 @@ -liteflow.rule-source=deadLoopChain/flow.xml -liteflow.parse-on-start=false \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/deadLoopChain/flow.xml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/deadLoopChain/flow.xml deleted file mode 100644 index ca6e1c3f7..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/deadLoopChain/flow.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/emptyFlow/application.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/emptyFlow/application.properties deleted file mode 100644 index 953c02066..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/emptyFlow/application.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=emptyFlow/flow.xml \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/emptyFlow/flow.xml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/emptyFlow/flow.xml deleted file mode 100644 index e69de29bb..000000000 diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/enable/application.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/enable/application.properties deleted file mode 100644 index 64bcf0011..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/enable/application.properties +++ /dev/null @@ -1,2 +0,0 @@ -liteflow.enable=false -liteflow.rule-source=enable/flow.xml diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/enable/flow.xml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/enable/flow.xml deleted file mode 100644 index 22870d94f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/enable/flow.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/event/application.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/event/application.properties deleted file mode 100644 index 332edb934..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/event/application.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=event/flow.xml \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/event/flow.xml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/event/flow.xml deleted file mode 100644 index a1f50587a..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/event/flow.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/exception/application.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/exception/application.properties deleted file mode 100644 index 79b39156f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/exception/application.properties +++ /dev/null @@ -1,2 +0,0 @@ -liteflow.rule-source=exception/flow.xml -liteflow.when-max-wait-seconds=1 \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/exception/flow-exception.xml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/exception/flow-exception.xml deleted file mode 100644 index 662226def..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/exception/flow-exception.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/exception/flow.xml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/exception/flow.xml deleted file mode 100644 index 328a6cb14..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/exception/flow.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/execute2Future/application.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/execute2Future/application.properties deleted file mode 100644 index 1545d0a13..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/execute2Future/application.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=execute2Future/flow.xml \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/execute2Future/flow.xml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/execute2Future/flow.xml deleted file mode 100644 index a7517a2cf..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/execute2Future/flow.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/flowmeta/application.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/flowmeta/application.properties deleted file mode 100644 index 83834c85b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/flowmeta/application.properties +++ /dev/null @@ -1,2 +0,0 @@ -liteflow.rule-source=flowmeta/flow.xml -liteflow.parse-on-start=false \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/flowmeta/flow.xml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/flowmeta/flow.xml deleted file mode 100644 index 7153add87..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/flowmeta/flow.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/lazy/application.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/lazy/application.properties deleted file mode 100644 index 372a320c8..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/lazy/application.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=lazy/flow.xml \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/lazy/flow.xml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/lazy/flow.xml deleted file mode 100644 index 22870d94f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/lazy/flow.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/lfCmpAnno/application.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/lfCmpAnno/application.properties deleted file mode 100644 index 1085d3200..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/lfCmpAnno/application.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=lfCmpAnno/flow.xml \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/lfCmpAnno/flow.xml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/lfCmpAnno/flow.xml deleted file mode 100644 index 62def0c37..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/lfCmpAnno/flow.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/monitor/application.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/monitor/application.properties deleted file mode 100644 index ee78cdf43..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/monitor/application.properties +++ /dev/null @@ -1,5 +0,0 @@ -liteflow.rule-source=monitor/flow.xml -liteflow.monitor.enable-log=true -liteflow.monitor.queue-limit=200 -liteflow.monitor.delay=5000 -liteflow.monitor.period=5000 \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/monitor/flow.xml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/monitor/flow.xml deleted file mode 100644 index e8ea83f95..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/monitor/flow.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/multiContext/application.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/multiContext/application.properties deleted file mode 100644 index 195b78559..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/multiContext/application.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=multiContext/flow.xml \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/multiContext/flow.xml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/multiContext/flow.xml deleted file mode 100644 index 7068d6cee..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/multiContext/flow.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/multipleType/application.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/multipleType/application.properties deleted file mode 100644 index a6da8abe5..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/multipleType/application.properties +++ /dev/null @@ -1,2 +0,0 @@ -liteflow.support-multiple-type=true -liteflow.rule-source=multipleType/flow.xml,multipleType/flow.yml \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/multipleType/flow.xml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/multipleType/flow.xml deleted file mode 100644 index 38b703214..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/multipleType/flow.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/multipleType/flow.yml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/multipleType/flow.yml deleted file mode 100644 index 4c1d8375a..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/multipleType/flow.yml +++ /dev/null @@ -1,6 +0,0 @@ -flow: - chain: - - name: chain3 - condition: - - type: then - value: 'a,b,c' diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/nodeExecutor/application.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/nodeExecutor/application.properties deleted file mode 100644 index b2ca1d088..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/nodeExecutor/application.properties +++ /dev/null @@ -1,4 +0,0 @@ -liteflow.rule-source=nodeExecutor/flow.xml -liteflow.retry-count=3 -liteflow.slot-size=512 -liteflow.node-executor-class=com.yomahub.liteflow.test.nodeExecutor.CustomerDefaultNodeExecutor \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/nodeExecutor/flow.xml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/nodeExecutor/flow.xml deleted file mode 100644 index 6b867c5bc..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/nodeExecutor/flow.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/nullParam/application.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/nullParam/application.properties deleted file mode 100644 index 7f320b595..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/nullParam/application.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=nullParam/flow.xml diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/nullParam/flow.xml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/nullParam/flow.xml deleted file mode 100644 index eb30c8e40..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/nullParam/flow.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/parsecustom/application-custom-json.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/parsecustom/application-custom-json.properties deleted file mode 100644 index 989a199c9..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/parsecustom/application-custom-json.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=com.yomahub.liteflow.test.parsecustom.parser.CustomJsonFlowParser \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/parsecustom/application-custom-xml.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/parsecustom/application-custom-xml.properties deleted file mode 100644 index c1763fe16..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/parsecustom/application-custom-xml.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=com.yomahub.liteflow.test.parsecustom.parser.CustomXmlFlowParser \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/parsecustom/application-custom-yml.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/parsecustom/application-custom-yml.properties deleted file mode 100644 index 263e0666c..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/parsecustom/application-custom-yml.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=com.yomahub.liteflow.test.parsecustom.parser.CustomYmlFlowParser \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/parser/application-json.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/parser/application-json.properties deleted file mode 100644 index e8b247226..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/parser/application-json.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=parser/flow.json \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/parser/application-springEL.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/parser/application-springEL.properties deleted file mode 100644 index 7db93206b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/parser/application-springEL.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=parser/**/*.xml \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/parser/application-xml.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/parser/application-xml.properties deleted file mode 100644 index d8aacc36c..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/parser/application-xml.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=parser/flow.xml \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/parser/application-yml.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/parser/application-yml.properties deleted file mode 100644 index e0680a12c..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/parser/application-yml.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=parser/flow.yml \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/parser/flow.json b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/parser/flow.json deleted file mode 100644 index 52d0d05c0..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/parser/flow.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "flow": { - "nodes": { - "node": [ - { - "id": "a", - "class": "com.yomahub.liteflow.test.parser.cmp.ACmp" - }, - { - "id": "b", - "class": "com.yomahub.liteflow.test.parser.cmp.BCmp" - }, - { - "id": "c", - "class": "com.yomahub.liteflow.test.parser.cmp.CCmp" - }, - { - "id": "d", - "class": "com.yomahub.liteflow.test.parser.cmp.DCmp" - }, - { - "id": "e", - "class": "com.yomahub.liteflow.test.parser.cmp.ECmp" - }, - { - "id": "f", - "class": "com.yomahub.liteflow.test.parser.cmp.FCmp" - }, - { - "id": "g", - "class": "com.yomahub.liteflow.test.parser.cmp.GCmp" - } - ] - }, - "chain": [ - { - "name": "chain2", - "condition": [ - {"type": "then", "value": "c,g,f"} - ] - }, - { - "name": "chain1", - "condition": [ - {"type": "then", "value": "a,c"}, - {"type": "when", "value": "b,d,e(f|g)"}, - {"type": "then", "value": "chain2"} - ] - } - ] - } -} \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/parser/flow.xml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/parser/flow.xml deleted file mode 100644 index 0775c5ec1..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/parser/flow.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/parser/flow.yml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/parser/flow.yml deleted file mode 100644 index 814f59d54..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/parser/flow.yml +++ /dev/null @@ -1,30 +0,0 @@ -flow: - nodes: - node: - - id: a - class: com.yomahub.liteflow.test.parser.cmp.ACmp - - id: b - class: com.yomahub.liteflow.test.parser.cmp.BCmp - - id: c - class: com.yomahub.liteflow.test.parser.cmp.CCmp - - id: d - class: com.yomahub.liteflow.test.parser.cmp.DCmp - - id: e - class: com.yomahub.liteflow.test.parser.cmp.ECmp - - id: f - class: com.yomahub.liteflow.test.parser.cmp.FCmp - - id: g - class: com.yomahub.liteflow.test.parser.cmp.GCmp - chain: - - name: chain1 - condition: - - type: then - value: 'a,c' - - type: when - value: 'b,d,e(f|g)' - - type: then - value: 'chain2' - - name: chain2 - condition: - - type: then - value: 'c,g,f' diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/parser/subFoder1/subFoder2/flow1.xml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/parser/subFoder1/subFoder2/flow1.xml deleted file mode 100644 index de73569cd..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/parser/subFoder1/subFoder2/flow1.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/parser/subFoder1/subFoder2/flow2.xml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/parser/subFoder1/subFoder2/flow2.xml deleted file mode 100644 index c77305d52..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/parser/subFoder1/subFoder2/flow2.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/parser/subFoder1/subFoder2/flow3.xml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/parser/subFoder1/subFoder2/flow3.xml deleted file mode 100644 index 8eedecef6..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/parser/subFoder1/subFoder2/flow3.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/preAndFinally/application.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/preAndFinally/application.properties deleted file mode 100644 index 9ea8432e6..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/preAndFinally/application.properties +++ /dev/null @@ -1 +0,0 @@ -liteflow.rule-source=preAndFinally/flow.xml \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/preAndFinally/flow.xml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/preAndFinally/flow.xml deleted file mode 100644 index 78e263d19..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/preAndFinally/flow.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - -
-        
-        
-    
-
-    
-        
-        
-        
-        
-    
-
-    
-        
-        
-        
-    
-
-    
-        
-        
-    
-
-    
-        
-        
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/privateDelivery/application.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/privateDelivery/application.properties
deleted file mode 100644
index c515ad389..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/privateDelivery/application.properties
+++ /dev/null
@@ -1 +0,0 @@
-liteflow.rule-source=privateDelivery/flow.xml
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/privateDelivery/flow.xml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/privateDelivery/flow.xml
deleted file mode 100644
index bf7146217..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/privateDelivery/flow.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-    
-        
-        
-        
-        
-        
-        
-        
-        
-        
-        
-        
-        
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/refreshRule/application.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/refreshRule/application.properties
deleted file mode 100644
index 174501a6c..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/refreshRule/application.properties
+++ /dev/null
@@ -1 +0,0 @@
-liteflow.rule-source=refreshRule/flow.xml
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/refreshRule/flow.xml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/refreshRule/flow.xml
deleted file mode 100644
index 22870d94f..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/refreshRule/flow.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/refreshRule/flow_update.xml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/refreshRule/flow_update.xml
deleted file mode 100644
index 29090f04a..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/refreshRule/flow_update.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/reload/application.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/reload/application.properties
deleted file mode 100644
index 5150bc23e..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/reload/application.properties
+++ /dev/null
@@ -1 +0,0 @@
-liteflow.rule-source=reload/flow.xml
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/reload/flow.xml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/reload/flow.xml
deleted file mode 100644
index 22870d94f..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/reload/flow.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/removeChain/application.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/removeChain/application.properties
deleted file mode 100644
index 729879505..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/removeChain/application.properties
+++ /dev/null
@@ -1 +0,0 @@
-liteflow.rule-source=removeChain/flow.xml
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/removeChain/flow.xml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/removeChain/flow.xml
deleted file mode 100644
index c89c44473..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/removeChain/flow.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-    
-        
-        
-    
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/requestId/application.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/requestId/application.properties
deleted file mode 100644
index feaedeff1..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/requestId/application.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-liteflow.rule-source=requestId/flow.xml
-liteflow.request-id-generator-class=com.yomahub.liteflow.test.requestId.config.CustomRequestIdGenerator
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/requestId/flow.xml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/requestId/flow.xml
deleted file mode 100644
index cd988fe71..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/requestId/flow.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/resizeSlot/application.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/resizeSlot/application.properties
deleted file mode 100644
index 6bea4bd1c..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/resizeSlot/application.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-liteflow.rule-source=resizeSlot/flow.xml
-liteflow.slot-size=4
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/resizeSlot/flow.xml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/resizeSlot/flow.xml
deleted file mode 100644
index 22870d94f..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/resizeSlot/flow.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/subflow/application-implicit.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/subflow/application-implicit.properties
deleted file mode 100644
index 3fc4f024e..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/subflow/application-implicit.properties
+++ /dev/null
@@ -1 +0,0 @@
-liteflow.rule-source=subflow/flow-implicit.xml
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/subflow/application-json.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/subflow/application-json.properties
deleted file mode 100644
index 7ca7b7bec..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/subflow/application-json.properties
+++ /dev/null
@@ -1 +0,0 @@
-liteflow.rule-source=subflow/flow.json
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/subflow/application-subInDifferentConfig1.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/subflow/application-subInDifferentConfig1.properties
deleted file mode 100644
index 8c77ba82c..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/subflow/application-subInDifferentConfig1.properties
+++ /dev/null
@@ -1 +0,0 @@
-liteflow.rule-source=subflow/flow-main.xml,subflow/flow-sub1.xml,subflow/flow-sub2.xml
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/subflow/application-subInDifferentConfig2.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/subflow/application-subInDifferentConfig2.properties
deleted file mode 100644
index e02c3b6a9..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/subflow/application-subInDifferentConfig2.properties
+++ /dev/null
@@ -1 +0,0 @@
-liteflow.rule-source=subflow/flow-main.xml,subflow/flow-sub1.xml,subflow/flow-sub2.yml
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/subflow/application-xml.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/subflow/application-xml.properties
deleted file mode 100644
index 1abd50496..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/subflow/application-xml.properties
+++ /dev/null
@@ -1 +0,0 @@
-liteflow.rule-source=subflow/flow.xml
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/subflow/application-yml.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/subflow/application-yml.properties
deleted file mode 100644
index 72074ec82..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/subflow/application-yml.properties
+++ /dev/null
@@ -1 +0,0 @@
-liteflow.rule-source=subflow/flow.yml
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/subflow/flow-implicit.xml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/subflow/flow-implicit.xml
deleted file mode 100644
index 5baca7072..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/subflow/flow-implicit.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-    
-         
-    
-
-    
-        
-    
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/subflow/flow-main.xml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/subflow/flow-main.xml
deleted file mode 100644
index 0adf54fc4..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/subflow/flow-main.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-    
-        
-         
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/subflow/flow-sub1.xml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/subflow/flow-sub1.xml
deleted file mode 100644
index 471dee3fe..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/subflow/flow-sub1.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-    
-        
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/subflow/flow-sub2.xml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/subflow/flow-sub2.xml
deleted file mode 100644
index 63dd964bf..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/subflow/flow-sub2.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/subflow/flow-sub2.yml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/subflow/flow-sub2.yml
deleted file mode 100644
index 8ba43c102..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/subflow/flow-sub2.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-flow:
-  chain:
-    - name: chain3
-      condition:
-        - type: then
-          value: 'e,d'
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/subflow/flow.json b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/subflow/flow.json
deleted file mode 100644
index 143589315..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/subflow/flow.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
-  "flow": {
-    "chain": [
-      {
-        "name": "chain3",
-        "condition": [
-          {"type": "then", "value": "e,d"}
-        ]
-      },
-      {
-        "name": "chain2",
-        "condition": [
-          {"type": "then", "value": "b,a"},
-          {"type": "then", "value": "chain3"}
-        ]
-      },
-      {
-        "name": "chain1",
-        "condition": [
-          {"type": "then", "value": "a,b"},
-          {"type": "then", "value": "c"},
-          {"type": "then", "value": "chain2"}
-        ]
-      },
-      {
-        "name": "c",
-        "condition": [
-          {"type": "then", "value": "d,e"}
-        ]
-      }
-    ]
-  }
-}
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/subflow/flow.xml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/subflow/flow.xml
deleted file mode 100644
index 03cf81299..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/subflow/flow.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-    
-        
-           
-         
-    
-
-    
-        
-    
-
-    
-        
-        
-    
-
-    
-        
-    
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/subflow/flow.yml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/subflow/flow.yml
deleted file mode 100644
index cdd8de74b..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/subflow/flow.yml
+++ /dev/null
@@ -1,24 +0,0 @@
-flow:
-  chain:
-    - name: chain3
-      condition:
-        - type: then
-          value: 'e,d'
-    - name: chain1
-      condition:
-        - type: then
-          value: 'a,b'
-        - type: then
-          value: 'c'
-        - type: then
-          value: 'chain2'
-    - name: c
-      condition:
-        - type: then
-          value: 'd,e'
-    - name: chain2
-      condition:
-        - type: then
-          value: 'b,a'
-        - type: then
-          value: 'chain3'
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/tag/application-json.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/tag/application-json.properties
deleted file mode 100644
index 2f9c09d4e..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/tag/application-json.properties
+++ /dev/null
@@ -1 +0,0 @@
-liteflow.rule-source=tag/flow.json
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/tag/application-xml.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/tag/application-xml.properties
deleted file mode 100644
index cc52d7cbc..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/tag/application-xml.properties
+++ /dev/null
@@ -1 +0,0 @@
-liteflow.rule-source=tag/flow.xml
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/tag/flow.json b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/tag/flow.json
deleted file mode 100644
index 49c902e4a..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/tag/flow.json
+++ /dev/null
@@ -1,31 +0,0 @@
-{
-  "flow": {
-    "chain": [
-      {
-        "name": "chain1",
-        "condition": [
-          {"type": "then", "value": "a[1],a[2],a[3]"}
-        ]
-      },
-      {
-        "name": "chain2",
-        "condition": [
-          {"type": "then", "value": "a[1],a[2],a[3],c[2](d[5]|e[6])"}
-        ]
-      },
-      {
-        "name": "chain3",
-        "condition": [
-          {"type": "then", "value": "b1"},
-          {"type": "when", "value": "b[1],b[2],b[3]"}
-        ]
-      },
-      {
-        "name": "chain4",
-        "condition": [
-          {"type": "then", "value": "f[false],g"}
-        ]
-      }
-    ]
-  }
-}
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/tag/flow.xml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/tag/flow.xml
deleted file mode 100644
index b7ceb903d..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/tag/flow.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-    
-        
-    
-
-    
-        
-    
-
-    
-        
-        
-    
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/useTTLInWhen/application.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/useTTLInWhen/application.properties
deleted file mode 100644
index 58d40f9ab..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/useTTLInWhen/application.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-liteflow.rule-source=useTTLInWhen/flow.xml
-liteflow.when-max-workers=2
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/useTTLInWhen/flow.xml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/useTTLInWhen/flow.xml
deleted file mode 100644
index af6d2ef54..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/useTTLInWhen/flow.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-    
-        
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/whenTimeOut/application1.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/whenTimeOut/application1.properties
deleted file mode 100644
index 05eb9ab0e..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/whenTimeOut/application1.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-liteflow.rule-source=whenTimeOut/flow1.xml
-liteflow.when-max-wait-seconds=3
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/whenTimeOut/application2.properties b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/whenTimeOut/application2.properties
deleted file mode 100644
index b90ff9c36..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/whenTimeOut/application2.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-liteflow.rule-source=whenTimeOut/flow2.xml
-liteflow.when-max-wait-seconds=5
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/whenTimeOut/flow1.xml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/whenTimeOut/flow1.xml
deleted file mode 100644
index 657f64cc3..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/whenTimeOut/flow1.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/whenTimeOut/flow2.xml b/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/whenTimeOut/flow2.xml
deleted file mode 100644
index 6586ab0b8..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springboot/src/test/resources/whenTimeOut/flow2.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-    
-        
-        
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/pom.xml b/liteflow-testcase-old/liteflow-testcase-springnative/pom.xml
deleted file mode 100644
index 7cef82fa3..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springnative/pom.xml
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-    
-        liteflow-testcase-old
-        com.yomahub
-        ${revision}
-        ../pom.xml
-    
-    4.0.0
-
-    liteflow-testcase-springnative
-
-    
-        
-            com.yomahub
-            liteflow-spring
-            ${revision}
-        
-
-        
-            ch.qos.logback
-            logback-classic
-        
-
-        
-            org.springframework
-            spring-test
-        
-        
-            org.springframework
-            spring-beans
-        
-        
-            org.springframework
-            spring-context
-        
-        
-            junit
-            junit
-            test
-        
-        
-            org.aspectj
-            aspectjweaver
-        
-    
-
-    
-        
-            
-                org.apache.maven.plugins
-                maven-deploy-plugin
-                2.8.2
-                
-                    true
-                
-            
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/BaseTest.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/BaseTest.java
deleted file mode 100644
index 64886670f..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/BaseTest.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package com.yomahub.liteflow.test;
-
-import com.yomahub.liteflow.flow.FlowBus;
-import com.yomahub.liteflow.property.LiteflowConfigGetter;
-import com.yomahub.liteflow.spi.holder.SpiFactoryCleaner;
-import com.yomahub.liteflow.spring.ComponentScanner;
-import com.yomahub.liteflow.thread.ExecutorHelper;
-import org.junit.AfterClass;
-
-public class BaseTest {
-
-    @AfterClass
-    public static void cleanScanCache(){
-        ComponentScanner.cleanCache();
-        FlowBus.cleanCache();
-        ExecutorHelper.loadInstance().clearExecutorServiceMap();
-        SpiFactoryCleaner.clean();
-        LiteflowConfigGetter.clean();
-    }
-}
diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/AbsoluteConfigPathSpringTest.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/AbsoluteConfigPathSpringTest.java
deleted file mode 100644
index d02f37c91..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/AbsoluteConfigPathSpringTest.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package com.yomahub.liteflow.test.absoluteConfigPath;
-
-import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.flow.LiteflowResponse;
-import com.yomahub.liteflow.slot.DefaultContext;
-import com.yomahub.liteflow.test.BaseTest;
-import org.junit.Assert;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringRunner;
-
-import javax.annotation.Resource;
-
-@RunWith(SpringRunner.class)
-@ContextConfiguration("classpath:/absoluteConfigPath/application.xml")
-public class AbsoluteConfigPathSpringTest extends BaseTest {
-
-    @Resource
-    private FlowExecutor flowExecutor;
-
-    @Test
-    public void testAbsoluteConfig(){
-        LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg");
-        Assert.assertTrue(response.isSuccess());
-    }
-}
diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/ACmp.java
deleted file mode 100644
index 74091479f..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/ACmp.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/**
- * 

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.absoluteConfigPath.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("a") -public class ACmp extends NodeComponent { - - @Override - public void process() { - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/BCmp.java deleted file mode 100644 index 0f162d805..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/BCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.absoluteConfigPath.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("b") -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/CCmp.java deleted file mode 100644 index 2da1ea352..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/CCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.absoluteConfigPath.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("c") -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/CustomAOPSpringTest.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/CustomAOPSpringTest.java deleted file mode 100644 index fe75264bf..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/CustomAOPSpringTest.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.yomahub.liteflow.test.aop; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * 切面场景单元测试 - * @author Bryan.Zhang - */ -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:/aop/application-custom.xml") -public class CustomAOPSpringTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //测试自定义AOP,串行场景 - @Test - public void testCustomAopS() { - LiteflowResponse response= flowExecutor.execute2Resp("chain1", "it's a request"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("before_after", context.getData("a")); - Assert.assertEquals("before_after", context.getData("b")); - Assert.assertEquals("before_after", context.getData("c")); - } - - //测试自定义AOP,并行场景 - @Test - public void testCustomAopP() { - LiteflowResponse response= flowExecutor.execute2Resp("chain2", "it's a request"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("before_after", context.getData("a")); - Assert.assertEquals("before_after", context.getData("b")); - Assert.assertEquals("before_after", context.getData("c")); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/GlobalAOPSpringTest.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/GlobalAOPSpringTest.java deleted file mode 100644 index 5493621eb..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/GlobalAOPSpringTest.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.yomahub.liteflow.test.aop; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.spring.ComponentScanner; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * 切面场景单元测试 - * @author Bryan.Zhang - */ - -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:/aop/application-global.xml") -public class GlobalAOPSpringTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //测试全局AOP,串行场景 - @Test - public void testGlobalAopS() { - LiteflowResponse response= flowExecutor.execute2Resp("chain1", "it's a request"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("before_after", context.getData("a")); - Assert.assertEquals("before_after", context.getData("b")); - Assert.assertEquals("before_after", context.getData("c")); - Assert.assertEquals("before_after", context.getData("d")); - Assert.assertEquals("before_after", context.getData("e")); - } - - //测试全局AOP,并行场景 - @Test - public void testGlobalAopP() { - LiteflowResponse response= flowExecutor.execute2Resp("chain2", "it's a request"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("before_after", context.getData("a")); - Assert.assertEquals("before_after", context.getData("b")); - Assert.assertEquals("before_after", context.getData("c")); - Assert.assertEquals("before_after", context.getData("d")); - Assert.assertEquals("before_after", context.getData("e")); - } - - @Test - public void testGlobalAopException() { - LiteflowResponse response= flowExecutor.execute2Resp("chain3", "it's a request"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertFalse(response.isSuccess()); - Assert.assertEquals("before_after", context.getData("a")); - Assert.assertEquals("before_after", context.getData("b")); - Assert.assertEquals("before_after", context.getData("c")); - Assert.assertEquals("before_after", context.getData("f")); - } - - @AfterClass - public static void cleanScanCache(){ - BaseTest.cleanScanCache(); - ComponentScanner.cmpAroundAspect = null; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/aspect/CmpAspect.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/aspect/CmpAspect.java deleted file mode 100644 index 3704a146d..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/aspect/CmpAspect.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.yomahub.liteflow.test.aop.aspect; - -import cn.hutool.core.util.StrUtil; -import com.yomahub.liteflow.aop.ICmpAroundAspect; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; - -public class CmpAspect implements ICmpAroundAspect { - @Override - public void beforeProcess(String nodeId, Slot slot) { - DefaultContext context = slot.getFirstContextBean(); - context.setData(nodeId, "before"); - } - - @Override - public void afterProcess(String nodeId, Slot slot) { - DefaultContext context = slot.getFirstContextBean(); - context.setData(nodeId, StrUtil.format("{}_{}", context.getData(nodeId), "after")); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/aspect/CustomAspect.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/aspect/CustomAspect.java deleted file mode 100644 index b2fc0f86a..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/aspect/CustomAspect.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.yomahub.liteflow.test.aop.aspect; - -import cn.hutool.core.util.StrUtil; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; -import org.aspectj.lang.ProceedingJoinPoint; -import org.aspectj.lang.annotation.Around; -import org.aspectj.lang.annotation.Aspect; -import org.aspectj.lang.annotation.Pointcut; - -@Aspect -public class CustomAspect { - - @Pointcut("execution(* com.yomahub.liteflow.test.aop.cmp1.*.process())") - public void cut() { - } - - @Around("cut()") - public Object around(ProceedingJoinPoint jp) throws Throwable { - NodeComponent cmp = (NodeComponent) jp.getThis(); - DefaultContext context = cmp.getFirstContextBean(); - context.setData(cmp.getNodeId(), "before"); - Object returnObj = jp.proceed(); - context.setData(cmp.getNodeId(), StrUtil.format("{}_{}", context.getData(cmp.getNodeId()), "after")); - return returnObj; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/cmp1/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/cmp1/ACmp.java deleted file mode 100644 index 7fd947163..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/cmp1/ACmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.aop.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("a") -public class ACmp extends NodeComponent { - - @Override - public void process() { - System.out.println("Acomp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/cmp1/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/cmp1/BCmp.java deleted file mode 100644 index d99d2a1e6..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/cmp1/BCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.aop.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("b") -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("Bcomp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/cmp1/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/cmp1/CCmp.java deleted file mode 100644 index 7a2181438..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/cmp1/CCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.aop.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("c") -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("Ccomp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/cmp2/DCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/cmp2/DCmp.java deleted file mode 100644 index eb8ae7648..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/cmp2/DCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.aop.cmp2; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("d") -public class DCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("Dcomp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/cmp2/ECmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/cmp2/ECmp.java deleted file mode 100644 index ce0319d44..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/cmp2/ECmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.aop.cmp2; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("e") -public class ECmp extends NodeComponent { - - @Override - public void process() { - System.out.println("Ecomp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/cmp2/FCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/cmp2/FCmp.java deleted file mode 100644 index 0fa254ffe..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/cmp2/FCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.aop.cmp2; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("f") -public class FCmp extends NodeComponent { - - @Override - public void process() { - throw new RuntimeException("test error"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/AsyncNodeSpringTest.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/AsyncNodeSpringTest.java deleted file mode 100644 index a5231d06e..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/AsyncNodeSpringTest.java +++ /dev/null @@ -1,133 +0,0 @@ -package com.yomahub.liteflow.test.asyncNode; - -import cn.hutool.core.collection.ListUtil; -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import com.yomahub.liteflow.test.asyncNode.exception.TestException; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * 测试隐式调用子流程 - * 单元测试 - * - * @author ssss - */ -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:/asyncNode/application.xml") -public class AsyncNodeSpringTest extends BaseTest { - @Resource - private FlowExecutor flowExecutor; - - /***** - * 标准chain 嵌套选择 嵌套子chain进行执行 - * 验证了when情况下 多个node是并行执行 - * 验证了默认参数情况下 when可以加载执行 - * **/ - @Test - public void testAsyncFlow1() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "it's a base request"); - Assert.assertTrue(response.isSuccess()); - System.out.println(response.getExecuteStepStr()); - } - - //这个和test1有点类似,只不过进一步验证了步骤 - @Test - public void testAsyncFlow2() { - LiteflowResponse response = flowExecutor.execute2Resp("chain2", "it's a base request"); - Assert.assertTrue(ListUtil.toList("b==>j==>g==>f==>h","b==>j==>g==>h==>f", - "b==>j==>h==>g==>f","b==>j==>h==>f==>g", - "b==>j==>f==>h==>g","b==>j==>f==>g==>h" - ).contains(response.getExecuteStepStr())); - } - - //测试errorResume,默认的errorResume为false,这里测试默认的 - @Test - public void testAsyncFlow3_1() { - LiteflowResponse response = flowExecutor.execute2Resp("chain3-1", "it's a base request"); - Assert.assertFalse(response.isSuccess()); - Assert.assertEquals(response.getSlot().getException().getClass(), TestException.class); - } - - //测试errorResume,默认的errorResume为false,这里设置为true - @Test - public void testAsyncFlow3_2() { - LiteflowResponse response = flowExecutor.execute2Resp("chain3-2", "it's a base request"); - Assert.assertTrue(response.isSuccess()); - } - - //相同group的并行组,会合并,并且errorResume根据第一个when来,这里第一个when配置了不抛错 - @Test - public void testAsyncFlow4() { - LiteflowResponse response = flowExecutor.execute2Resp("chain4", "it's a base request"); - DefaultContext context = response.getFirstContextBean(); - //因为不记录错误,所以最终结果是true - Assert.assertTrue(response.isSuccess()); - //因为是并行组,所以即便抛错了,其他组件也会执行,i在流程里配置了2遍,i抛错,但是也执行了2遍,这里验证下 - Integer count = context.getData("count"); - Assert.assertEquals(new Integer(2), count); - //因为配置了不抛错,所以response里的cause应该为null - Assert.assertNull(response.getCause()); - } - - //相同group的并行组,会合并,并且errorResume根据第一个when来,这里第一个when配置了会抛错 - @Test - public void testAsyncFlow5() throws Exception { - LiteflowResponse response = flowExecutor.execute2Resp("chain5", "it's a base request"); - DefaultContext context = response.getFirstContextBean(); - //整个并行组是报错的,所以最终结果是false - Assert.assertFalse(response.isSuccess()); - //因为是并行组,所以即便抛错了,其他组件也会执行,i在流程里配置了2遍,i抛错,但是也执行了2遍,这里验证下 - Integer count = context.getData("count"); - Assert.assertEquals(new Integer(2), count); - //因为第一个when配置了会报错,所以response里的cause里应该会有TestException - Assert.assertEquals(TestException.class, response.getCause().getClass()); - } - - //不同group的并行组,不会合并,第一个when的errorResume是false,会抛错,那第二个when就不会执行 - @Test - public void testAsyncFlow6() throws Exception { - LiteflowResponse response = flowExecutor.execute2Resp("chain6", "it's a base request"); - DefaultContext context = response.getFirstContextBean(); - //第一个when会抛错,所以最终结果是false - Assert.assertFalse(response.isSuccess()); - //因为是不同组并行组,第一组的when里的i就抛错了,所以i就执行了1遍 - Integer count = context.getData("count"); - Assert.assertEquals(new Integer(1), count); - //第一个when会报错,所以最终response的cause里应该会有TestException - Assert.assertEquals(TestException.class, response.getCause().getClass()); - } - - //不同group的并行组,不会合并,第一个when的errorResume是true,不会报错,那第二个when还会继续执行,但是第二个when的errorResume是false,所以第二个when会报错 - @Test - public void testAsyncFlow7() throws Exception { - LiteflowResponse response = flowExecutor.execute2Resp("chain7", "it's a base request"); - DefaultContext context = response.getFirstContextBean(); - //第二个when会抛错,所以最终结果是false - Assert.assertFalse(response.isSuccess()); - // 传递了slotIndex,则set的size==2 - Integer count = context.getData("count"); - Assert.assertEquals(new Integer(2), count); - //第一个when会报错,所以最终response的cause里应该会有TestException - Assert.assertEquals(TestException.class, response.getCause().getClass()); - } - - //测试任意异步一个执行完即继续的场景 - //d g h并行,配置了any=true,其中d耗时1秒,g耗时0.5秒,其他都不设耗时 - //最终执行效果应该是h先返回,然后执行abc,最后gd - //这里要注意的是,由于step是先加入,所以step的打印顺序并不是这样的。但是实际执行是正确的 - @Test - public void testAsyncFlow8() throws Exception { - LiteflowResponse response = flowExecutor.execute2Resp("chain8", "it's a base request"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - Assert.assertTrue(context.getData("check").toString().startsWith("habc")); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ACmp.java deleted file mode 100644 index 01afc5856..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ACmp.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.yomahub.liteflow.test.asyncNode.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; -import org.springframework.stereotype.Component; - - -@Component("a") -public class ACmp extends NodeComponent { - @Override - public void process() { - DefaultContext context = this.getFirstContextBean(); - synchronized (NodeComponent.class){ - if (context.hasData("check")){ - String str = context.getData("check"); - str += this.getNodeId(); - context.setData("check", str); - }else{ - context.setData("check", this.getNodeId()); - } - } - System.out.println("Acomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/BCmp.java deleted file mode 100644 index 73c27c742..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/BCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.yomahub.liteflow.test.asyncNode.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; -import org.springframework.stereotype.Component; - - -@Component("b") -public class BCmp extends NodeComponent { - @Override - public void process() { - DefaultContext context = this.getFirstContextBean(); - synchronized (NodeComponent.class){ - if (context.hasData("check")){ - String str = context.getData("check"); - str += this.getNodeId(); - context.setData("check", str); - }else{ - context.setData("check", this.getNodeId()); - } - } - System.out.println("Bcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/CCmp.java deleted file mode 100644 index 253447f81..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/CCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.yomahub.liteflow.test.asyncNode.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; -import org.springframework.stereotype.Component; - - -@Component("c") -public class CCmp extends NodeComponent { - @Override - public void process() throws Exception { - DefaultContext context = this.getFirstContextBean(); - synchronized (NodeComponent.class){ - if (context.hasData("check")){ - String str = context.getData("check"); - str += this.getNodeId(); - context.setData("check", str); - }else{ - context.setData("check", this.getNodeId()); - } - } - System.out.println("Ccomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/DCmp.java deleted file mode 100644 index 6203d92da..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/DCmp.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.yomahub.liteflow.test.asyncNode.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; -import org.springframework.stereotype.Component; - - -@Component("d") -public class DCmp extends NodeComponent { - @Override - public void process() throws Exception { - Thread.sleep(1000); - DefaultContext context = this.getFirstContextBean(); - synchronized (NodeComponent.class){ - if (context.hasData("check")){ - String str = context.getData("check"); - str += this.getNodeId(); - context.setData("check", str); - }else{ - context.setData("check", this.getNodeId()); - } - } - System.out.println("Dcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ECmp.java deleted file mode 100644 index caff1beb8..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ECmp.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.yomahub.liteflow.test.asyncNode.cmp; - -import com.yomahub.liteflow.core.NodeSwitchComponent; -import org.springframework.stereotype.Component; - - -@Component("e") -public class ECmp extends NodeSwitchComponent { - - @Override - public String processSwitch() throws Exception { - System.out.println("Ecomp executed!"); - return "g"; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/FCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/FCmp.java deleted file mode 100644 index eb9322c81..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/FCmp.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.yomahub.liteflow.test.asyncNode.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - - -@Component("f") -public class FCmp extends NodeComponent { - - @Override - public void process() throws Exception { - System.out.println("Fcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/GCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/GCmp.java deleted file mode 100644 index 66fd659cc..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/GCmp.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.yomahub.liteflow.test.asyncNode.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; -import org.springframework.stereotype.Component; - - -@Component("g") -public class GCmp extends NodeComponent { - - @Override - public void process() throws Exception { - Thread.sleep(500); - DefaultContext context = this.getFirstContextBean(); - synchronized (NodeComponent.class){ - if (context.hasData("check")){ - String str = context.getData("check"); - str += this.getNodeId(); - context.setData("check", str); - }else{ - context.setData("check", this.getNodeId()); - } - } - System.out.println("Gcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/HCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/HCmp.java deleted file mode 100644 index dd211dfa3..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/HCmp.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.yomahub.liteflow.test.asyncNode.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; -import org.springframework.stereotype.Component; - - -@Component("h") -public class HCmp extends NodeComponent { - - @Override - public void process() throws Exception { - DefaultContext context = this.getFirstContextBean(); - synchronized (NodeComponent.class){ - if (context.hasData("check")){ - String str = context.getData("check"); - str += this.getNodeId(); - context.setData("check", str); - }else{ - context.setData("check", this.getNodeId()); - } - } - - System.out.println("Hcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ICmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ICmp.java deleted file mode 100644 index d85b775e8..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ICmp.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.yomahub.liteflow.test.asyncNode.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; -import com.yomahub.liteflow.test.asyncNode.exception.TestException; -import org.springframework.stereotype.Component; - - -@Component("i") -public class ICmp extends NodeComponent { - - @Override - public void process() throws Exception { - DefaultContext context = this.getFirstContextBean(); - synchronized (ICmp.class){ - if (context.hasData("count")){ - Integer count = context.getData("count"); - context.setData("count", ++count); - } else{ - context.setData("count", 1); - } - } - System.out.println("Icomp executed! throw Exception!"); - throw new TestException(); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/JCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/JCmp.java deleted file mode 100644 index 66bb9cab9..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/JCmp.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.yomahub.liteflow.test.asyncNode.cmp; - -import com.yomahub.liteflow.core.NodeSwitchComponent; -import org.springframework.stereotype.Component; - - -@Component("j") -public class JCmp extends NodeSwitchComponent { - - @Override - public String processSwitch() throws Exception { - System.out.println("Jcomp executed!"); - return "chain3"; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/exception/TestException.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/exception/TestException.java deleted file mode 100644 index e786e9f86..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/exception/TestException.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.yomahub.liteflow.test.asyncNode.exception; - -public class TestException extends Exception{ -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/base/BaseCommonSpringTest.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/base/BaseCommonSpringTest.java deleted file mode 100644 index e30b14758..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/base/BaseCommonSpringTest.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.yomahub.liteflow.test.base; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:/base/application.xml") -public class BaseCommonSpringTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testBaseCommon(){ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a==>b==>c==>d", response.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/base/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/base/cmp/ACmp.java deleted file mode 100644 index c33792217..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/base/cmp/ACmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.base.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("a") -public class ACmp extends NodeComponent { - - @Override - public void process() { - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/base/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/base/cmp/BCmp.java deleted file mode 100644 index f537308c7..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/base/cmp/BCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.base.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("b") -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/base/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/base/cmp/CCmp.java deleted file mode 100644 index 6b6f84b41..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/base/cmp/CCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.base.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("c") -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/base/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/base/cmp/DCmp.java deleted file mode 100644 index ab0317f69..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/base/cmp/DCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.base.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("d") -public class DCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/builder/BuilderSpringTest1.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/builder/BuilderSpringTest1.java deleted file mode 100644 index b646d3b07..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/builder/BuilderSpringTest1.java +++ /dev/null @@ -1,211 +0,0 @@ -package com.yomahub.liteflow.test.builder; - -import com.yomahub.liteflow.builder.LiteFlowChainBuilder; -import com.yomahub.liteflow.builder.LiteFlowConditionBuilder; -import com.yomahub.liteflow.builder.LiteFlowNodeBuilder; -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.builder.entity.ExecutableEntity; -import com.yomahub.liteflow.enums.NodeTypeEnum; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import com.yomahub.liteflow.test.builder.cmp1.*; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -//基于builder模式的单元测试 -//这里只是最基本的builder模式的测试,只是为了验证在spring模式下的正常性 -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:/builder/application1.xml") -public class BuilderSpringTest1 extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //基于普通组件的builder模式测试 - @Test - public void testBuilder() throws Exception { - LiteFlowNodeBuilder.createNode().setId("a") - .setName("组件A") - .setType(NodeTypeEnum.COMMON) - .setClazz("com.yomahub.liteflow.test.builder.cmp1.ACmp") - .build(); - LiteFlowNodeBuilder.createNode().setId("b") - .setName("组件B") - .setType(NodeTypeEnum.COMMON) - .setClazz("com.yomahub.liteflow.test.builder.cmp1.BCmp") - .build(); - LiteFlowNodeBuilder.createNode().setId("c") - .setName("组件C") - .setType(NodeTypeEnum.COMMON) - .setClazz("com.yomahub.liteflow.test.builder.cmp1.CCmp") - .build(); - LiteFlowNodeBuilder.createNode().setId("d") - .setName("组件D") - .setType(NodeTypeEnum.COMMON) - .setClazz("com.yomahub.liteflow.test.builder.cmp1.DCmp") - .build(); - LiteFlowNodeBuilder.createNode().setId("e") - .setName("组件E") - .setType(NodeTypeEnum.SWITCH) - .setClazz("com.yomahub.liteflow.test.builder.cmp1.ECmp") - .build(); - LiteFlowNodeBuilder.createNode().setId("f") - .setName("组件F") - .setType(NodeTypeEnum.COMMON) - .setClazz("com.yomahub.liteflow.test.builder.cmp1.FCmp") - .build(); - LiteFlowNodeBuilder.createNode().setId("g") - .setName("组件G") - .setType(NodeTypeEnum.COMMON) - .setClazz("com.yomahub.liteflow.test.builder.cmp1.GCmp") - .build(); - - - LiteFlowChainBuilder.createChain().setChainName("chain2").setCondition( - LiteFlowConditionBuilder.createThenCondition().setValue("c,d").build() - ).build(); - - LiteFlowChainBuilder.createChain().setChainName("chain1").setCondition( - LiteFlowConditionBuilder - .createWhenCondition() - .setValue("a,b").build() - ).setCondition( - LiteFlowConditionBuilder.createWhenCondition() - .setValue("e(f|g|chain2)").build() - ).build(); - - LiteflowResponse response = flowExecutor.execute2Resp("chain1"); - Assert.assertTrue(response.isSuccess()); - } - - - //基于普通组件的builder模式测试 - @Test - public void testBuilderForClassAndCode() throws Exception { - LiteFlowNodeBuilder.createNode().setId("a") - .setName("组件A") - .setType(NodeTypeEnum.COMMON) - .setClazz(ACmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("b") - .setName("组件B") - .setType(NodeTypeEnum.COMMON) - .setClazz(BCmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("c") - .setName("组件C") - .setType(NodeTypeEnum.COMMON) - .setClazz(CCmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("d") - .setName("组件D") - .setType(NodeTypeEnum.COMMON) - .setClazz(DCmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("e") - .setName("组件E") - .setType(NodeTypeEnum.SWITCH) - .setClazz(ECmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("f") - .setName("组件F") - .setType(NodeTypeEnum.COMMON) - .setClazz(FCmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("g") - .setName("组件G") - .setType(NodeTypeEnum.COMMON) - .setClazz(GCmp.class) - .build(); - - - LiteFlowChainBuilder.createChain().setChainName("chain2").setCondition( - LiteFlowConditionBuilder.createThenCondition().setValue("c,d").build() - ).build(); - - LiteFlowChainBuilder.createChain().setChainName("chain1").setCondition( - LiteFlowConditionBuilder - .createWhenCondition() - .setValue("a[hello],b").build() - ).setCondition( - LiteFlowConditionBuilder.createWhenCondition() - .setValue("e(f|g|chain2)").build() - ).build(); - - LiteflowResponse response = flowExecutor.execute2Resp("chain1"); - Assert.assertTrue(response.isSuccess()); - } - - //基于普通组件的builder模式测试 - @Test - public void testBuilderForConditionNode() throws Exception { - LiteFlowNodeBuilder.createNode().setId("a") - .setName("组件A") - .setType(NodeTypeEnum.COMMON) - .setClazz(ACmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("b") - .setName("组件B") - .setType(NodeTypeEnum.COMMON) - .setClazz(BCmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("c") - .setName("组件C") - .setType(NodeTypeEnum.COMMON) - .setClazz(CCmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("d") - .setName("组件D") - .setType(NodeTypeEnum.COMMON) - .setClazz(DCmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("e") - .setName("组件E") - .setType(NodeTypeEnum.SWITCH) - .setClazz(ECmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("f") - .setName("组件F") - .setType(NodeTypeEnum.COMMON) - .setClazz(FCmp.class) - .build(); - LiteFlowNodeBuilder.createNode().setId("g") - .setName("组件G") - .setType(NodeTypeEnum.COMMON) - .setClazz(GCmp.class) - .build(); - - - LiteFlowChainBuilder.createChain().setChainName("chain2").setCondition( - LiteFlowConditionBuilder.createThenCondition() - .setExecutable(new ExecutableEntity().setId("c")) - .setExecutable(new ExecutableEntity().setId("d")) - .build() - ).build(); - - LiteFlowChainBuilder.createChain().setChainName("chain1").setCondition( - LiteFlowConditionBuilder - .createWhenCondition() - .setExecutable(new ExecutableEntity().setId("a").setTag("hello")) - .setExecutable(new ExecutableEntity().setId("b")) - .build() - ).setCondition( - LiteFlowConditionBuilder.createWhenCondition() - .setExecutable( - new ExecutableEntity().setId("e") - .addNodeCondComponent(new ExecutableEntity().setId("f").setTag("FHello")) - .addNodeCondComponent(new ExecutableEntity().setId("g")) - .addNodeCondComponent(new ExecutableEntity().setId("chain2") - )).build() - ).build(); - - LiteflowResponse response = flowExecutor.execute2Resp("chain1"); - Assert.assertTrue(response.isSuccess()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/builder/BuilderSpringTest2.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/builder/BuilderSpringTest2.java deleted file mode 100644 index f80d4a559..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/builder/BuilderSpringTest2.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.yomahub.liteflow.test.builder; - -import com.yomahub.liteflow.builder.LiteFlowChainBuilder; -import com.yomahub.liteflow.builder.LiteFlowConditionBuilder; -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -//基于builder模式的单元测试 -//这里测试的是通过spring去扫描,但是通过代码去构建chain的用例 -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:/builder/application2.xml") -public class BuilderSpringTest2 extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //通过spring去扫描组件,通过代码去构建chain - @Test - public void testBuilder() throws Exception { - LiteFlowChainBuilder.createChain().setChainName("chain1").setCondition( - LiteFlowConditionBuilder.createThenCondition().setValue("h,i,j").build() - ).build(); - - LiteflowResponse response = flowExecutor.execute2Resp("chain1"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("h==>i==>j", response.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/builder/cmp1/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/builder/cmp1/ACmp.java deleted file mode 100644 index ed0e7458d..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/builder/cmp1/ACmp.java +++ /dev/null @@ -1,18 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.builder.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; - -public class ACmp extends NodeComponent { - - @Override - public void process() { - System.out.println(getTag() + ",ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/builder/cmp1/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/builder/cmp1/BCmp.java deleted file mode 100644 index 80568e476..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/builder/cmp1/BCmp.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.builder.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; - -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/builder/cmp1/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/builder/cmp1/CCmp.java deleted file mode 100644 index 595bc33b8..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/builder/cmp1/CCmp.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.builder.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; - -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/builder/cmp1/DCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/builder/cmp1/DCmp.java deleted file mode 100644 index 7ab4fee26..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/builder/cmp1/DCmp.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.builder.cmp1; - -import com.yomahub.liteflow.core.NodeSwitchComponent; - -public class ECmp extends NodeSwitchComponent { - - @Override - public String processSwitch() throws Exception { - System.out.println("ECmp executed!"); - return "chain2"; - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/builder/cmp1/FCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/builder/cmp1/FCmp.java deleted file mode 100644 index 6cd712581..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/builder/cmp1/FCmp.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.builder.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; - -public class FCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("FCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/builder/cmp1/GCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/builder/cmp1/GCmp.java deleted file mode 100644 index 577a21edc..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/builder/cmp1/GCmp.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.builder.cmp2; - -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.core.NodeComponent; - -@LiteflowComponent("h") -public class HCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("HCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/builder/cmp2/ICmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/builder/cmp2/ICmp.java deleted file mode 100644 index 7f803a9fe..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/builder/cmp2/ICmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.builder.cmp2; - -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.core.NodeComponent; - -@LiteflowComponent("i") -public class ICmp extends NodeComponent { - - @Override - public void process() { - System.out.println("ICmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/builder/cmp2/JCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/builder/cmp2/JCmp.java deleted file mode 100644 index 78a8c0c89..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/builder/cmp2/JCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.builder.cmp2; - -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.core.NodeComponent; - -@LiteflowComponent("j") -public class JCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("JCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/cmpRetry/LiteflowRetrySpringTest.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/cmpRetry/LiteflowRetrySpringTest.java deleted file mode 100644 index a68df34ad..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/cmpRetry/LiteflowRetrySpringTest.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.yomahub.liteflow.test.cmpRetry; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - - -/** - * 测试spring下的节点重试 - * @author Bryan.Zhang - * @since 2.5.10 - */ -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:/cmpRetry/application.xml") -@ComponentScan({"com.yomahub.liteflow.test.cmpRetry.cmp"}) -public class LiteflowRetrySpringTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //全局重试配置测试 - @Test - public void testRetry1() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a==>b==>b==>b", response.getExecuteStepStr()); - } - - //单个组件重试配置测试 - @Test - public void testRetry2() { - LiteflowResponse response = flowExecutor.execute2Resp("chain2", "arg"); - Assert.assertFalse(response.isSuccess()); - Assert.assertEquals("c==>c==>c==>c==>c==>c", response.getExecuteStepStr()); - } - - //单个组件指定异常,但抛出的并不是指定异常的场景测试 - @Test - public void testRetry3() { - LiteflowResponse response = flowExecutor.execute2Resp("chain3", "arg"); - Assert.assertFalse(response.isSuccess()); - } - - //单个组件指定异常重试,抛出的是指定异常或者 - @Test - public void testRetry4() { - LiteflowResponse response = flowExecutor.execute2Resp("chain4", "arg"); - Assert.assertFalse(response.isSuccess()); - Assert.assertEquals("e==>e==>e==>e==>e==>e", response.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/ACmp.java deleted file mode 100644 index a1b1b3fb4..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/ACmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.cmpRetry.cmp; - -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.core.NodeComponent; - -@LiteflowComponent("b") -public class BCmp extends NodeComponent { - - private int flag = 0; - - @Override - public void process() { - System.out.println("BCmp executed!"); - if (flag < 2){ - flag++; - throw new RuntimeException("demo exception"); - } - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/CCmp.java deleted file mode 100644 index 89c59fba9..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/CCmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.cmpRetry.cmp; - -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.annotation.LiteflowRetry; -import com.yomahub.liteflow.core.NodeComponent; - -@LiteflowComponent("c") -@LiteflowRetry(5) -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - throw new RuntimeException("demo exception"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/DCmp.java deleted file mode 100644 index b9232e5ae..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/DCmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.cmpRetry.cmp; - -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.annotation.LiteflowRetry; -import com.yomahub.liteflow.core.NodeComponent; - -@LiteflowComponent("d") -@LiteflowRetry(retry = 5, forExceptions = {NullPointerException.class}) -public class DCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("DCmp executed!"); - throw new RuntimeException("demo exception"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/ECmp.java deleted file mode 100644 index ba3f92d65..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/ECmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.cmpRetry.cmp; - -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.annotation.LiteflowRetry; -import com.yomahub.liteflow.core.NodeComponent; - -@LiteflowComponent("e") -@LiteflowRetry(retry = 5, forExceptions = {NullPointerException.class}) -public class ECmp extends NodeComponent { - - @Override - public void process() { - System.out.println("ECmp executed!"); - throw new NullPointerException("demo null exception"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/cmpStep/CmpStepSpringTest.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/cmpStep/CmpStepSpringTest.java deleted file mode 100644 index 21e19828f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/cmpStep/CmpStepSpringTest.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.yomahub.liteflow.test.cmpStep; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:/cmpStep/application.xml") -public class CmpStepSpringTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testStep1(){ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertFalse(response.isSuccess()); - Assert.assertTrue(response.getExecuteSteps().get("a").isSuccess()); - Assert.assertTrue(response.getExecuteSteps().get("b").isSuccess()); - Assert.assertFalse(response.getExecuteSteps().get("c").isSuccess()); - Assert.assertFalse(response.getExecuteSteps().get("d").isSuccess()); - Assert.assertTrue(response.getExecuteSteps().get("c").getTimeSpent() >= 2000); - Assert.assertEquals(RuntimeException.class, response.getExecuteSteps().get("c").getException().getClass()); - Assert.assertEquals(RuntimeException.class, response.getExecuteSteps().get("d").getException().getClass()); - } - - @Test - public void testStep2() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain2", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a==>b", response.getExecuteStepStrWithoutTime()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/ACmp.java deleted file mode 100644 index 6c1573f4e..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/ACmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.cmpStep.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("a") -public class ACmp extends NodeComponent { - - @Override - public void process() throws Exception{ - Thread.sleep(5000L); - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/BCmp.java deleted file mode 100644 index aa0e7d3dd..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/BCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.cmpStep.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("b") -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/CCmp.java deleted file mode 100644 index 34f7792be..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/CCmp.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.cmpStep.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("c") -public class CCmp extends NodeComponent { - - @Override - public void process() throws Exception{ - System.out.println("CCmp executed!"); - Thread.sleep(2000); - throw new RuntimeException("test error c"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/DCmp.java deleted file mode 100644 index 7814a2ba4..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/DCmp.java +++ /dev/null @@ -1,22 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.cmpStep.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("d") -public class DCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - throw new RuntimeException("test error d"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/ECmp.java deleted file mode 100644 index f78b42399..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/ECmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.cmpStep.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("e") -public class ECmp extends NodeComponent { - - @Override - public void process() { - System.out.println("ECmp executed!"); - } - - @Override - public boolean isAccess() { - return false; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/component/ComponentSpringTest.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/component/ComponentSpringTest.java deleted file mode 100644 index eb89da349..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/component/ComponentSpringTest.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.yomahub.liteflow.test.component; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.util.ReflectionUtils; - -import javax.annotation.Resource; - -/** - * 组件功能点测试 - * 单元测试 - * - * @author donguo.tao - */ -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:/component/application.xml") -public class ComponentSpringTest extends BaseTest { - private static final Logger LOG = LoggerFactory.getLogger(ComponentSpringTest.class); - - @Resource - private FlowExecutor flowExecutor; - - //isAccess方法的功能测试 - @Test - public void testIsAccess() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", 101); - Assert.assertTrue(response.isSuccess()); - Assert.assertNotNull(response.getSlot().getResponseData()); - } - - //组件抛错的功能点测试 - @Test(expected = ArithmeticException.class) - public void testComponentException() throws Exception { - LiteflowResponse response = flowExecutor.execute2Resp("chain2", 0); - Assert.assertFalse(response.isSuccess()); - Assert.assertEquals("/ by zero", response.getMessage()); - ReflectionUtils.rethrowException(response.getCause()); - } - - //isContinueOnError方法的功能点测试 - @Test - public void testIsContinueOnError() throws Exception { - LiteflowResponse response = flowExecutor.execute2Resp("chain3", 0); - Assert.assertTrue(response.isSuccess()); - Assert.assertNull(response.getCause()); - } - - //isEnd方法的功能点测试 - @Test - public void testIsEnd() throws Exception { - LiteflowResponse response = flowExecutor.execute2Resp("chain4", 10); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("d",response.getExecuteStepStr()); - } - - //setIsEnd方法的功能点测试 - @Test - public void testSetIsEnd1() throws Exception { - LiteflowResponse response = flowExecutor.execute2Resp("chain5", 10); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("e",response.getExecuteStepStr()); - } - - //条件组件的功能点测试 - @Test - public void testNodeCondComponent() { - LiteflowResponse response = flowExecutor.execute2Resp("chain6", 0); - Assert.assertTrue(response.isSuccess()); - } - - //测试setIsEnd如果为true,continueError也为true,那不应该continue了 - @Test - public void testSetIsEnd2() throws Exception { - LiteflowResponse response = flowExecutor.execute2Resp("chain7", 10); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("g",response.getExecuteStepStr()); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/component/cmp1/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/component/cmp1/ACmp.java deleted file mode 100644 index 3f125d17d..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/component/cmp1/ACmp.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.yomahub.liteflow.test.component.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -import java.util.Objects; - - -@Component("a") -public class ACmp extends NodeComponent { - @Override - public void process() { - System.out.println("AComp executed!"); - this.getSlot().setResponseData("AComp executed!"); - } - - @Override - public boolean isAccess() { - Integer requestData = this.getRequestData(); - if (Objects.nonNull(requestData) && requestData > 100){ - return true; - } - System.out.println("AComp isAccess false."); - return false; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/component/cmp1/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/component/cmp1/BCmp.java deleted file mode 100644 index 6d5db7fc9..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/component/cmp1/BCmp.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.yomahub.liteflow.test.component.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -import java.util.Objects; - - -@Component("b") -public class BCmp extends NodeComponent { - @Override - public void process() { - System.out.println("BComp executed!"); - Integer requestData = this.getRequestData(); - Integer divisor = 130; - Integer result = divisor / requestData; - this.getSlot().setResponseData(result); - } - - @Override - public boolean isAccess() { - Integer requestData = this.getRequestData(); - if (Objects.nonNull(requestData)){ - return true; - } - return false; - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/component/cmp1/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/component/cmp1/CCmp.java deleted file mode 100644 index dc4620e4a..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/component/cmp1/CCmp.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.yomahub.liteflow.test.component.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -import java.util.Objects; - - -@Component("c") -public class CCmp extends NodeComponent { - @Override - public void process() { - System.out.println("CComp executed!"); - Integer requestData = this.getRequestData(); - Integer divisor = 130; - Integer result = divisor / requestData; - this.getSlot().setResponseData(result); - System.out.println("responseData="+Integer.parseInt(this.getSlot().getResponseData())); - } - - @Override - public boolean isContinueOnError() { - Integer requestData = this.getRequestData(); - if (Objects.nonNull(requestData)){ - return true; - } - return false; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/component/cmp1/DCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/component/cmp1/DCmp.java deleted file mode 100644 index c28a41e34..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/component/cmp1/DCmp.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.yomahub.liteflow.test.component.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -import java.util.Objects; - - -@Component("d") -public class DCmp extends NodeComponent { - @Override - public void process() throws Exception { - System.out.println("DComp executed!"); - } - - @Override - public boolean isEnd() { - //组件的process执行完之后才会执行isEnd - Object requestData = this.getSlot().getResponseData(); - if (Objects.isNull(requestData)){ - System.out.println("DComp flow isEnd, because of responseData is null."); - return true; - } - return false; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/component/cmp1/ECmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/component/cmp1/ECmp.java deleted file mode 100644 index 9103080a4..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/component/cmp1/ECmp.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.yomahub.liteflow.test.component.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.util.JsonUtil; -import org.springframework.stereotype.Component; - -import java.util.Objects; - - -@Component("e") -public class ECmp extends NodeComponent { - - @Override - public void process() throws Exception { - System.out.println("EComp executed!"); - Object responseData = this.getSlot().getResponseData(); - if (Objects.isNull(responseData)){ - System.out.println("EComp responseData flow must be set end ."); - //执行到某个条件时,手动结束流程。 - this.setIsEnd(true); - } - System.out.println("EComp responseData responseData=" + JsonUtil.toJsonString(responseData)); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/component/cmp1/GCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/component/cmp1/GCmp.java deleted file mode 100644 index f7917cfae..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/component/cmp1/GCmp.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.component.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("g") -public class GCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("GCmp executed!"); - this.setIsEnd(true); - } - - @Override - public boolean isContinueOnError() { - return true; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/component/cmp1/HCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/component/cmp1/HCmp.java deleted file mode 100644 index df41a9c13..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/component/cmp1/HCmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.component.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("h") -public class HCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("HCmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/component/cmp2/FSwitchCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/component/cmp2/FSwitchCmp.java deleted file mode 100644 index 5f4951f54..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/component/cmp2/FSwitchCmp.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.yomahub.liteflow.test.component.cmp2; - -import com.yomahub.liteflow.core.NodeSwitchComponent; -import org.springframework.stereotype.Component; - -import java.util.Objects; - - -@Component("f") -public class FSwitchCmp extends NodeSwitchComponent { - @Override - public String processSwitch() { - Integer requestData = this.getRequestData(); - if (Objects.isNull(requestData)){ - return "d"; - } else if(requestData == 0){ - return "c"; - } else { - return "b"; - } - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/config/LiteflowConfigSpringTest.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/config/LiteflowConfigSpringTest.java deleted file mode 100644 index ad6730eae..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/config/LiteflowConfigSpringTest.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.yomahub.liteflow.test.config; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.ApplicationContext; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * spring环境下参数单元测试 - * @author zendwang - * @since 2.5.0 - */ -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:/config/application-local.xml") -public class LiteflowConfigSpringTest extends BaseTest { - @Resource - private FlowExecutor flowExecutor; - - @Autowired - private ApplicationContext context; - - @Test - public void testConfig() throws Exception { - LiteflowConfig config = context.getBean(LiteflowConfig.class); - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("config/flow.json", config.getRuleSource()); - Assert.assertEquals(15, config.getWhenMaxWaitSeconds().intValue()); - Assert.assertEquals(200, config.getQueueLimit().intValue()); - Assert.assertEquals(300000L, config.getDelay().longValue()); - Assert.assertEquals(300000L, config.getPeriod().longValue()); - Assert.assertFalse(config.getEnableLog()); - // Assert.assertEquals(Runtime.getRuntime().availableProcessors() * 2, config.getWhenMaxWorkers().longValue()); - Assert.assertEquals(512, config.getWhenQueueLimit().longValue()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/config/LocalRuleSourcePatternMatchSpringTest.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/config/LocalRuleSourcePatternMatchSpringTest.java deleted file mode 100644 index af8017823..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/config/LocalRuleSourcePatternMatchSpringTest.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.yomahub.liteflow.test.config; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * spring环境下 rule-source 参数支持通配符,支持模式匹配 - * @author zendwang - * @since 2.5.0 - */ -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:/config/local-rule-source-pattern-match.xml") -public class LocalRuleSourcePatternMatchSpringTest extends BaseTest { - - @Resource - private FlowExecutor executor; - - /** - * 匹配的文件 - * config/springgroup0/flow0.json - * config/springgroup1/flow0.json - */ - @Test - public void testLocalJsonRuleSourcePatternMatch() { - LiteflowResponse response0 = executor.execute2Resp("chain1", "arg"); - Assert.assertEquals("a==>b==>c", response0.getExecuteStepStr()); - LiteflowResponse response1 = executor.execute2Resp("chain3", "arg"); - Assert.assertEquals("a==>c==>f==>g", response1.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/config/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/config/cmp/ACmp.java deleted file mode 100644 index 89be97ac8..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/config/cmp/ACmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.config.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("a") -public class ACmp extends NodeComponent { - - @Override - public void process() { - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/config/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/config/cmp/BCmp.java deleted file mode 100644 index 86bf75320..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/config/cmp/BCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.config.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("b") -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/config/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/config/cmp/CCmp.java deleted file mode 100644 index 9867bac45..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/config/cmp/CCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.config.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("c") -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/config/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/config/cmp/DCmp.java deleted file mode 100644 index ee710d1d6..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/config/cmp/DCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.config.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("d") -public class DCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("DCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/config/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/config/cmp/ECmp.java deleted file mode 100644 index eceb073cd..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/config/cmp/ECmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.config.cmp; - -import com.yomahub.liteflow.core.NodeSwitchComponent; -import org.springframework.stereotype.Component; - -@Component("e") -public class ECmp extends NodeSwitchComponent { - - @Override - public String processSwitch() throws Exception { - return "g"; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/config/cmp/FCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/config/cmp/FCmp.java deleted file mode 100644 index dfa32d344..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/config/cmp/FCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.config.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("f") -public class FCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("FCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/config/cmp/GCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/config/cmp/GCmp.java deleted file mode 100644 index dd7ba071d..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/config/cmp/GCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.config.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("g") -public class GCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("GCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/customNodes/CustomNodesSpringTest.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/customNodes/CustomNodesSpringTest.java deleted file mode 100644 index 678191fc0..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/customNodes/CustomNodesSpringTest.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.yomahub.liteflow.test.customNodes; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * spring环境下自定义声明节点的测试 - * @author Bryan.Zhang - * @since 2.6.4 - */ -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:/customNodes/application.xml") -public class CustomNodesSpringTest extends BaseTest { - - private final Logger log = LoggerFactory.getLogger(this.getClass()); - - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testCustomNodes() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - response = flowExecutor.execute2Resp("chain2", "arg"); - Assert.assertTrue(response.isSuccess()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/ACmp.java deleted file mode 100644 index d7cf0644f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/ACmp.java +++ /dev/null @@ -1,18 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.customNodes.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.test.customNodes.domain.DemoDomain; - -import javax.annotation.Resource; - -public class BCmp extends NodeComponent { - - @Resource - private DemoDomain demoDomain; - - @Override - public void process() { - demoDomain.sayHi(); - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/CCmp.java deleted file mode 100644 index 9913ec102..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/CCmp.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.customNodes.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class DCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("DCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/ECmp.java deleted file mode 100644 index 697ab62e3..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/ECmp.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.customNodes.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.test.customNodes.domain.DemoDomain; - -import javax.annotation.Resource; - -public class ECmp extends NodeComponent { - - @Resource - private DemoDomain demoDomain; - - @Override - public void process() { - demoDomain.sayHi(); - System.out.println("ECmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/FCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/FCmp.java deleted file mode 100644 index de5c0820d..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/FCmp.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.customNodes.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class FCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("FCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/customNodes/domain/DemoDomain.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/customNodes/domain/DemoDomain.java deleted file mode 100644 index d0b10dc0b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/customNodes/domain/DemoDomain.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.yomahub.liteflow.test.customNodes.domain; - -import org.springframework.stereotype.Component; - -@Component -public class DemoDomain { - - public void sayHi(){ - System.out.println("hi"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor1.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor1.java deleted file mode 100644 index eef8b3d36..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor1.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.yomahub.liteflow.test.customWhenThreadPool; - -import cn.hutool.core.util.ObjectUtil; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.spi.holder.ContextAwareHolder; -import com.yomahub.liteflow.thread.ExecutorBuilder; - -import java.util.concurrent.ExecutorService; - -public class CustomThreadExecutor1 implements ExecutorBuilder { - - @Override - public ExecutorService buildExecutor() { - LiteflowConfig liteflowConfig = ContextAwareHolder.loadContextAware().getBean(LiteflowConfig.class); - //只有在非spring的场景下liteflowConfig才会为null - if (ObjectUtil.isNull(liteflowConfig)) { - liteflowConfig = new LiteflowConfig(); - } - return buildDefaultExecutor( - liteflowConfig.getWhenMaxWorkers(), - liteflowConfig.getWhenMaxWorkers(), - liteflowConfig.getWhenQueueLimit(), - "customer-when-1-thead-"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor2.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor2.java deleted file mode 100644 index a05de79e6..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor2.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.yomahub.liteflow.test.customWhenThreadPool; - -import cn.hutool.core.util.ObjectUtil; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.spi.holder.ContextAwareHolder; -import com.yomahub.liteflow.thread.ExecutorBuilder; - -import java.util.concurrent.ExecutorService; - -public class CustomThreadExecutor2 implements ExecutorBuilder { - @Override - public ExecutorService buildExecutor() { - LiteflowConfig liteflowConfig = ContextAwareHolder.loadContextAware().getBean(LiteflowConfig.class); - //只有在非spring的场景下liteflowConfig才会为null - if (ObjectUtil.isNull(liteflowConfig)) { - liteflowConfig = new LiteflowConfig(); - } - return buildDefaultExecutor( - liteflowConfig.getWhenMaxWorkers(), - liteflowConfig.getWhenMaxWorkers(), - liteflowConfig.getWhenQueueLimit(), - "customer-when-2-thead-"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor3.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor3.java deleted file mode 100644 index 71aac9822..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor3.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.yomahub.liteflow.test.customWhenThreadPool; - -import cn.hutool.core.util.ObjectUtil; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.spi.holder.ContextAwareHolder; -import com.yomahub.liteflow.thread.ExecutorBuilder; - -import java.util.concurrent.ExecutorService; - -public class CustomThreadExecutor3 implements ExecutorBuilder { - @Override - public ExecutorService buildExecutor() { - LiteflowConfig liteflowConfig = ContextAwareHolder.loadContextAware().getBean(LiteflowConfig.class); - //只有在非spring的场景下liteflowConfig才会为null - if (ObjectUtil.isNull(liteflowConfig)) { - liteflowConfig = new LiteflowConfig(); - } - return buildDefaultExecutor( - liteflowConfig.getWhenMaxWorkers(), - liteflowConfig.getWhenMaxWorkers(), - liteflowConfig.getWhenQueueLimit(), - "customer-when-3-thead-"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomWhenThreadPoolSpringTest.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomWhenThreadPoolSpringTest.java deleted file mode 100644 index f00691452..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomWhenThreadPoolSpringTest.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.yomahub.liteflow.test.customWhenThreadPool; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * spring环境下异步线程超时日志打印测试 - * - * @author Bryan.Zhang - * @since 2.6.4 - */ -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:/customWhenThreadPool/application.xml") -public class CustomWhenThreadPoolSpringTest extends BaseTest { - - private final Logger log = LoggerFactory.getLogger(this.getClass()); - - @Resource - private FlowExecutor flowExecutor; - - /** - * 测试全局线程池配置 - */ - @Test - public void testGlobalThreadPool() { - LiteflowResponse response = flowExecutor.execute2Resp("chain", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - Assert.assertTrue(context.getData("threadName").toString().startsWith("lf-when-thead")); - } - - /** - * 测试全局和when上自定义线程池-优先以when上为准 - */ - @Test - public void testGlobalAndCustomWhenThreadPool() { - LiteflowResponse response1 = flowExecutor.execute2Resp("chain1", "arg"); - DefaultContext context = response1.getFirstContextBean(); - Assert.assertTrue(response1.isSuccess()); - Assert.assertTrue(context.getData("threadName").toString().startsWith("customer-when-1-thead")); - } - - - /** - * when配置的线程池可以共用 - */ - @Test - public void testCustomWhenThreadPool() { - // 使用when - thread1 - testGlobalAndCustomWhenThreadPool(); - // chain配置同一个thead1 - LiteflowResponse response2 = flowExecutor.execute2Resp("chain2", "arg"); - DefaultContext context = response2.getFirstContextBean(); - Assert.assertTrue(response2.isSuccess()); - Assert.assertTrue(context.getData("threadName").toString().startsWith("customer-when-1-thead")); - - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/ACmp.java deleted file mode 100644 index f47c972da..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/ACmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.customWhenThreadPool.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("a") -public class ACmp extends NodeComponent { - - @Override - public void process() { - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/BCmp.java deleted file mode 100644 index 66bc03a45..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/BCmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.customWhenThreadPool.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import org.springframework.stereotype.Component; - -@Component("b") -public class BCmp extends NodeComponent { - - @Override - public void process() { - DefaultContext context = this.getFirstContextBean(); - context.setData("threadName", Thread.currentThread().getName()); - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/CCmp.java deleted file mode 100644 index 809d4429a..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/CCmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.customWhenThreadPool.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import org.springframework.stereotype.Component; - -@Component("c") -public class CCmp extends NodeComponent { - - @Override - public void process() { - DefaultContext context = this.getFirstContextBean(); - context.setData("threadName", Thread.currentThread().getName()); - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/DCmp.java deleted file mode 100644 index 07d5a53dd..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/DCmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.customWhenThreadPool.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import org.springframework.stereotype.Component; - -@Component("d") -public class DCmp extends NodeComponent { - - @Override - public void process() { - DefaultContext context = this.getFirstContextBean(); - context.setData("threadName", Thread.currentThread().getName()); - System.out.println("DCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/ECmp.java deleted file mode 100644 index 6e96482bf..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/ECmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.customWhenThreadPool.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import org.springframework.stereotype.Component; - -@Component("e") -public class ECmp extends NodeComponent { - - @Override - public void process() { - DefaultContext context = this.getFirstContextBean(); - context.setData("threadName", Thread.currentThread().getName()); - System.out.println("ECmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/FCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/FCmp.java deleted file mode 100644 index 7091b7316..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/FCmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.customWhenThreadPool.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import org.springframework.stereotype.Component; - -@Component("f") -public class FCmp extends NodeComponent { - - @Override - public void process() { - DefaultContext context = this.getFirstContextBean(); - context.setData("threadName", Thread.currentThread().getName()); - System.out.println("FCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/emptyflow/EmptyFlowSpringTest.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/emptyflow/EmptyFlowSpringTest.java deleted file mode 100644 index f9cb41f60..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/emptyflow/EmptyFlowSpringTest.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.yomahub.liteflow.test.emptyflow; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * 切面场景单元测试 - * @author Bryan.Zhang - */ -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:/emptyFlow/application.xml") -public class EmptyFlowSpringTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //测试空flow的情况下,liteflow是否能正常启动 - @Test - public void testEmptyFlow() { - //不做任何事,为的是能正常启动 - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/enable/LiteflowEnableSpringTest.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/enable/LiteflowEnableSpringTest.java deleted file mode 100644 index c840cf4e0..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/enable/LiteflowEnableSpringTest.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.yomahub.liteflow.test.enable; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.property.LiteflowConfigGetter; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * spring环境下enable参数 - * - * @author qjwyss - * @since 2.6.0 - */ -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:/enable/application-local.xml") -public class LiteflowEnableSpringTest extends BaseTest { - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testEnable() throws Exception { - LiteflowConfig config = LiteflowConfigGetter.get(); - Boolean enable = config.getEnable(); - if (enable) { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - return; - } - - Assert.assertFalse(enable); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/enable/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/enable/cmp/ACmp.java deleted file mode 100644 index 1028beae5..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/enable/cmp/ACmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.enable.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("a") -public class ACmp extends NodeComponent { - - @Override - public void process() { - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/enable/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/enable/cmp/BCmp.java deleted file mode 100644 index e4ed668c4..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/enable/cmp/BCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.enable.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("b") -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/enable/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/enable/cmp/CCmp.java deleted file mode 100644 index f4c86c323..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/enable/cmp/CCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.enable.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("c") -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/event/EventSpringTest.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/event/EventSpringTest.java deleted file mode 100644 index f09d215c7..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/event/EventSpringTest.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.yomahub.liteflow.test.event; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:/event/application.xml") -public class EventSpringTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //测试组件成功事件 - @Test - public void testEvent1() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("abc", context.getData("test")); - } - - //测试组件失败事件 - @Test - public void testEvent2() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain2", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertFalse(response.isSuccess()); - Assert.assertEquals(NullPointerException.class, response.getCause().getClass()); - Assert.assertEquals("ab", context.getData("test")); - Assert.assertEquals("error:d", context.getData("error")); - } - - //测试组件失败事件本身抛出异常 - @Test - public void testEvent3() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain3", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertFalse(response.isSuccess()); - Assert.assertEquals(NullPointerException.class, response.getCause().getClass()); - Assert.assertEquals("a", context.getData("test")); - Assert.assertEquals("error:e", context.getData("error")); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/event/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/event/cmp/ACmp.java deleted file mode 100644 index 11c7509ba..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/event/cmp/ACmp.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.event.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import org.springframework.stereotype.Component; - -@Component("a") -public class ACmp extends NodeComponent { - - @Override - public void process() { - DefaultContext context = this.getFirstContextBean(); - context.setData("test",""); - System.out.println("ACmp executed!"); - } - - @Override - public void onSuccess() throws Exception { - DefaultContext context = this.getFirstContextBean(); - String str = context.getData("test"); - str += this.getNodeId(); - context.setData("test", str); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/event/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/event/cmp/BCmp.java deleted file mode 100644 index 7fc1b3538..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/event/cmp/BCmp.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.event.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import org.springframework.stereotype.Component; - -@Component("b") -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BCmp executed!"); - } - - @Override - public void onSuccess() throws Exception { - DefaultContext context = this.getFirstContextBean(); - String str = context.getData("test"); - str += this.getNodeId(); - context.setData("test", str); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/event/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/event/cmp/CCmp.java deleted file mode 100644 index f87eeed18..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/event/cmp/CCmp.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.event.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import org.springframework.stereotype.Component; - -@Component("c") -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - - @Override - public void onSuccess() throws Exception { - DefaultContext context = this.getFirstContextBean(); - String str = context.getData("test"); - str += this.getNodeId(); - context.setData("test", str); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/event/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/event/cmp/DCmp.java deleted file mode 100644 index 1865b83ed..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/event/cmp/DCmp.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.event.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import org.springframework.stereotype.Component; - -@Component("d") -public class DCmp extends NodeComponent { - - @Override - public void process() throws Exception{ - System.out.println("CCmp executed!"); - throw new NullPointerException(); - } - - @Override - public void onError() throws Exception { - DefaultContext context = this.getFirstContextBean(); - context.setData("error","error:"+this.getNodeId()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/event/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/event/cmp/ECmp.java deleted file mode 100644 index 600f16321..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/event/cmp/ECmp.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.event.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import org.springframework.stereotype.Component; - -@Component("e") -public class ECmp extends NodeComponent { - - @Override - public void process() throws Exception{ - System.out.println("CCmp executed!"); - throw new NullPointerException(); - } - - @Override - public void onError() throws Exception { - DefaultContext context = this.getFirstContextBean(); - context.setData("error","error:"+this.getNodeId()); - throw new IllegalAccessException("错误事件回调本身抛出异常"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/exception/CustomStatefulException.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/exception/CustomStatefulException.java deleted file mode 100644 index 11441ab58..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/exception/CustomStatefulException.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.yomahub.liteflow.test.exception; - -import com.yomahub.liteflow.exception.LiteFlowException; - -/** - * 用户自定义带状态码的异常 - */ -public class CustomStatefulException extends LiteFlowException { - public CustomStatefulException(String code, String message) { - super(code, message); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/exception/Exception1SpringTest.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/exception/Exception1SpringTest.java deleted file mode 100644 index 673cfc3a7..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/exception/Exception1SpringTest.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.yomahub.liteflow.test.exception; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.exception.ChainDuplicateException; -import com.yomahub.liteflow.exception.ConfigErrorException; -import com.yomahub.liteflow.exception.FlowExecutorNotInitException; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.property.LiteflowConfigGetter; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * 流程执行异常 - * 单元测试 - * - * @author zendwang - */ -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:/exception/application1.xml") -public class Exception1SpringTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - /** - * 验证 chain 节点重复的异常 - */ - @Test(expected = ChainDuplicateException.class) - public void testChainDuplicateException() { - LiteflowConfig config = LiteflowConfigGetter.get(); - config.setRuleSource("exception/flow-exception.xml"); - flowExecutor.init(); - } - - @Test(expected = ConfigErrorException.class) - public void testConfigErrorException() { - flowExecutor.setLiteflowConfig(null); - flowExecutor.init(); - } - - @Test(expected = FlowExecutorNotInitException.class) - public void testFlowExecutorNotInitException() { - LiteflowConfig config = LiteflowConfigGetter.get(); - config.setRuleSource("error/flow.txt"); - flowExecutor.init(); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/exception/Exception2SpringTest.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/exception/Exception2SpringTest.java deleted file mode 100644 index 179ad0b47..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/exception/Exception2SpringTest.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.yomahub.liteflow.test.exception; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.exception.LiteFlowException; -import com.yomahub.liteflow.exception.NoSwitchTargetNodeException; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.exception.ChainNotFoundException; -import com.yomahub.liteflow.exception.FlowSystemException; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.util.ReflectionUtils; - -import javax.annotation.Resource; - -/** - * 流程执行异常 - * 单元测试 - * - * @author zendwang - */ -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:/exception/application2.xml") -public class Exception2SpringTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - @Test(expected = ChainNotFoundException.class) - public void testChainNotFoundException() throws Exception { - flowExecutor.execute("chain0", "it's a request"); - } - - @Test(expected = RuntimeException.class) - public void testComponentCustomException() throws Exception { - flowExecutor.execute("chain1", "exception"); - } - - @Test(expected = FlowSystemException.class) - public void testNoConditionInChainException() throws Exception { - LiteflowResponse response = flowExecutor.execute2Resp("chain2", "test"); - Assert.assertFalse(response.isSuccess()); - Assert.assertEquals("no conditionList in this chain[chain2]", response.getMessage()); - ReflectionUtils.rethrowException(response.getCause()); - } - - @Test - public void testGetSlotFromResponseWhenException() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain4", "test"); - Assert.assertFalse(response.isSuccess()); - Assert.assertNotNull(response.getCause()); - Assert.assertNotNull(response.getSlot()); - } - - @Test(expected = NoSwitchTargetNodeException.class) - public void testNoTargetFindException() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain5", "test"); - Assert.assertFalse(response.isSuccess()); - throw response.getCause(); - } - - @Test - public void testInvokeCustomStatefulException() { - LiteflowResponse response = flowExecutor.execute2Resp("chain6", "custom-stateful-exception"); - Assert.assertFalse(response.isSuccess()); - Assert.assertEquals("300", response.getCode()); - Assert.assertNotNull(response.getCause()); - Assert.assertTrue(response.getCause() instanceof LiteFlowException); - Assert.assertNotNull(response.getSlot()); - } - - @Test - public void testNotInvokeCustomStatefulException() { - LiteflowResponse response = flowExecutor.execute2Resp("chain6", "test"); - Assert.assertTrue(response.isSuccess()); - Assert.assertNull(response.getCode()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/exception/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/exception/cmp/ACmp.java deleted file mode 100644 index d637fab7b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/exception/cmp/ACmp.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.exception.cmp; - -import cn.hutool.core.util.StrUtil; -import com.yomahub.liteflow.core.NodeComponent; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; - -@Component("a") -public class ACmp extends NodeComponent { - - private static final Logger LOG = LoggerFactory.getLogger(ACmp.class); - - @Override - public void process() { - String str = this.getRequestData(); - if(StrUtil.isNotBlank(str) && str.equals("exception")) { - throw new RuntimeException("chain execute execption"); - } - LOG.info("Acomp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/exception/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/exception/cmp/BCmp.java deleted file mode 100644 index 0f7411c9b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/exception/cmp/BCmp.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.exception.cmp; - -import cn.hutool.core.util.StrUtil; -import com.yomahub.liteflow.core.NodeComponent; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; - -@Component("b") -public class BCmp extends NodeComponent { - - private static final Logger LOG = LoggerFactory.getLogger(BCmp.class); - - @Override - public void process() throws InterruptedException { - String str = this.getRequestData(); - if(StrUtil.isNotBlank(str) && str.equals("when")) { - try { - LOG.info("Bcomp sleep begin"); - Thread.sleep(3000); - LOG.info("Bcomp sleep end"); - } catch (InterruptedException e) { - throw e; - } - } - LOG.info("Bcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/exception/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/exception/cmp/CCmp.java deleted file mode 100644 index ab1759ade..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/exception/cmp/CCmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.exception.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; - -@Component("c") -public class CCmp extends NodeComponent { - - private static final Logger LOG = LoggerFactory.getLogger(CCmp.class); - - @Override - public void process() { - LOG.info("Ccomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/exception/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/exception/cmp/DCmp.java deleted file mode 100644 index 3aebcc420..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/exception/cmp/DCmp.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.exception.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; - -@Component("d") -public class DCmp extends NodeComponent { - - private static final Logger LOG = LoggerFactory.getLogger(DCmp.class); - - @Override - public void process() { - if(1==1){ - int a = 1/0; - } - LOG.info("Dcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/exception/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/exception/cmp/ECmp.java deleted file mode 100644 index 5911c2e3f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/exception/cmp/ECmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.exception.cmp; - -import com.yomahub.liteflow.core.NodeSwitchComponent; -import org.springframework.stereotype.Component; - -@Component("e") -public class ECmp extends NodeSwitchComponent { - - @Override - public String processSwitch() throws Exception { - return "a"; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/exception/cmp/FCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/exception/cmp/FCmp.java deleted file mode 100644 index c0b3917ac..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/exception/cmp/FCmp.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.exception.cmp; - -import cn.hutool.core.util.StrUtil; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.test.exception.CustomStatefulException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; - -@Component("f") -public class FCmp extends NodeComponent { - - private static final Logger LOG = LoggerFactory.getLogger(FCmp.class); - - @Override - public void process() { - String str = this.getRequestData(); - if(StrUtil.isNotBlank(str) && str.equals("custom-stateful-exception")) { - throw new CustomStatefulException("300", "chain execute custom stateful execption"); - } - LOG.info("Fcomp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/exception/cmp/GCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/exception/cmp/GCmp.java deleted file mode 100644 index 0c1120aa0..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/exception/cmp/GCmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.exception.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; - -@Component("g") -public class GCmp extends NodeComponent { - - private static final Logger LOG = LoggerFactory.getLogger(GCmp.class); - - @Override - public void process() { - LOG.info("Gcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/execute2Future/Executor2FutureSpringTest.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/execute2Future/Executor2FutureSpringTest.java deleted file mode 100644 index 50c8b9310..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/execute2Future/Executor2FutureSpringTest.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.yomahub.liteflow.test.execute2Future; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; -import java.util.concurrent.Future; - -/** - * spring环境执行返回future的例子 - * @author Bryan.Zhang - * @since 2.6.13 - */ -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:/execute2Future/application.xml") -public class Executor2FutureSpringTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testFuture() throws Exception{ - Future future = flowExecutor.execute2Future("chain1", "arg", DefaultContext.class); - LiteflowResponse response = future.get(); - Assert.assertTrue(response.isSuccess()); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/execute2Future/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/execute2Future/cmp/ACmp.java deleted file mode 100644 index 05dabbd3d..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/execute2Future/cmp/ACmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.execute2Future.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("a") -public class ACmp extends NodeComponent { - - @Override - public void process() { - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/execute2Future/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/execute2Future/cmp/BCmp.java deleted file mode 100644 index 8683ad9e1..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/execute2Future/cmp/BCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.execute2Future.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("b") -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/execute2Future/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/execute2Future/cmp/CCmp.java deleted file mode 100644 index bfb159206..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/execute2Future/cmp/CCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.execute2Future.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("c") -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/execute2Future/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/execute2Future/cmp/DCmp.java deleted file mode 100644 index b92003006..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/execute2Future/cmp/DCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.execute2Future.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("d") -public class DCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/flowmeta/FlowMetaSpringTest.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/flowmeta/FlowMetaSpringTest.java deleted file mode 100644 index 8be9d8618..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/flowmeta/FlowMetaSpringTest.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.yomahub.liteflow.test.flowmeta; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.flow.FlowBus; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import com.yomahub.liteflow.test.flowmeta.cmp2.DCmp; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:/flowmeta/application.xml") -public class FlowMetaSpringTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //测试动态添加元信息节点 - @Test - public void testFlowMeta() { - FlowBus.addCommonNode("d", "d组件", DCmp.class); - LiteflowResponse response= flowExecutor.execute2Resp("chain1", "it's a request"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a==>b==>c==>d[d组件]", response.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/flowmeta/cmp1/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/flowmeta/cmp1/ACmp.java deleted file mode 100644 index 4df6c78fa..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/flowmeta/cmp1/ACmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.flowmeta.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("a") -public class ACmp extends NodeComponent { - - @Override - public void process() { - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/flowmeta/cmp1/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/flowmeta/cmp1/BCmp.java deleted file mode 100644 index f6ef80cb6..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/flowmeta/cmp1/BCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.flowmeta.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("b") -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/flowmeta/cmp1/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/flowmeta/cmp1/CCmp.java deleted file mode 100644 index ed599b642..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/flowmeta/cmp1/CCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.flowmeta.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("c") -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/flowmeta/cmp2/DCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/flowmeta/cmp2/DCmp.java deleted file mode 100644 index 9ed261058..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/flowmeta/cmp2/DCmp.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.flowmeta.cmp2; - -import com.yomahub.liteflow.core.NodeComponent; - -public class DCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("Dcomp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/lazy/LazySpringTest.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/lazy/LazySpringTest.java deleted file mode 100644 index 7c1350c06..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/lazy/LazySpringTest.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.yomahub.liteflow.test.lazy; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:/base/application.xml") -public class LazySpringTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testLazy() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/lazy/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/lazy/cmp/ACmp.java deleted file mode 100644 index 9d3dacbca..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/lazy/cmp/ACmp.java +++ /dev/null @@ -1,22 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.lazy.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.context.annotation.Lazy; -import org.springframework.stereotype.Component; - -@Lazy -@Component("a") -public class ACmp extends NodeComponent { - - @Override - public void process() { - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/lazy/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/lazy/cmp/BCmp.java deleted file mode 100644 index 13bfe6725..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/lazy/cmp/BCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.lazy.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("b") -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/lazy/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/lazy/cmp/CCmp.java deleted file mode 100644 index 3f45e86a6..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/lazy/cmp/CCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.lazy.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("c") -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/lfCmpAnno/LiteflowComponentSpringTest.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/lfCmpAnno/LiteflowComponentSpringTest.java deleted file mode 100644 index 4d8aa54ce..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/lfCmpAnno/LiteflowComponentSpringTest.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.yomahub.liteflow.test.lfCmpAnno; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - - -/** - * 测试@LiteflowComponent标注 - * @author Bryan.Zhang - * @since 2.5.10 - */ -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:/lfCmpAnno/application.xml") -public class LiteflowComponentSpringTest extends BaseTest { - - @Autowired - private FlowExecutor flowExecutor; - - @Test - public void testConfig() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a[A组件]==>b[B组件]==>c[C组件]==>b[B组件]==>a[A组件]==>d", response.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/lfCmpAnno/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/lfCmpAnno/cmp/ACmp.java deleted file mode 100644 index 6c4fc23ad..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/lfCmpAnno/cmp/ACmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.lfCmpAnno.cmp; - -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.core.NodeComponent; - -@LiteflowComponent(id = "a", name = "A组件") -public class ACmp extends NodeComponent { - - @Override - public void process() { - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/lfCmpAnno/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/lfCmpAnno/cmp/BCmp.java deleted file mode 100644 index 991003cc4..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/lfCmpAnno/cmp/BCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.lfCmpAnno.cmp; - -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.core.NodeComponent; - -@LiteflowComponent(id = "b", name = "B组件") -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/lfCmpAnno/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/lfCmpAnno/cmp/CCmp.java deleted file mode 100644 index 1fbea2522..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/lfCmpAnno/cmp/CCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.lfCmpAnno.cmp; - -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.core.NodeComponent; - -@LiteflowComponent(id = "c", name = "C组件") -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/lfCmpAnno/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/lfCmpAnno/cmp/DCmp.java deleted file mode 100644 index 42efc228b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/lfCmpAnno/cmp/DCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.lfCmpAnno.cmp; - -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.core.NodeComponent; - -@LiteflowComponent("d") -public class DCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("DCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/monitor/MonitorSpringTest.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/monitor/MonitorSpringTest.java deleted file mode 100644 index 585fd6323..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/monitor/MonitorSpringTest.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.yomahub.liteflow.test.monitor; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.monitor.MonitorBus; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.spi.holder.ContextAwareHolder; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * spring环境下监控的测试 - * @author Bryan.Zhang - * @since 2.6.4 - */ -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:/monitor/application.xml") -public class MonitorSpringTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testMonitor() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - - Thread.sleep(10000); - } - - @AfterClass - public static void clean(){ - MonitorBus monitorBus = ContextAwareHolder.loadContextAware().getBean(MonitorBus.class); - monitorBus.closeScheduler(); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/monitor/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/monitor/cmp/ACmp.java deleted file mode 100644 index d5f2438af..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/monitor/cmp/ACmp.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.monitor.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -import java.util.Random; - -@Component("a") -public class ACmp extends NodeComponent { - - @Override - public void process() { - try { - Thread.sleep(new Random().nextInt(2000)); - }catch (Exception e){ - e.printStackTrace(); - } - - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/monitor/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/monitor/cmp/BCmp.java deleted file mode 100644 index a5a3f44e0..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/monitor/cmp/BCmp.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.monitor.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -import java.util.Random; - -@Component("b") -public class BCmp extends NodeComponent { - - @Override - public void process() { - try { - Thread.sleep(new Random().nextInt(2000)); - }catch (Exception e){ - e.printStackTrace(); - } - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/monitor/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/monitor/cmp/CCmp.java deleted file mode 100644 index 6a44bb60a..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/monitor/cmp/CCmp.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.monitor.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -import java.util.Random; - -@Component("c") -public class CCmp extends NodeComponent { - - @Override - public void process() { - try { - Thread.sleep(new Random().nextInt(2000)); - }catch (Exception e){ - e.printStackTrace(); - } - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/multipleType/LiteflowMultipleTypeSpringTest.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/multipleType/LiteflowMultipleTypeSpringTest.java deleted file mode 100644 index 98964374d..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/multipleType/LiteflowMultipleTypeSpringTest.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.yomahub.liteflow.test.multipleType; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - - -/** - * 测试spring下混合格式规则的场景 - * @author Bryan.Zhang - * @since 2.5.10 - */ -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:/multipleType/application.xml") -public class LiteflowMultipleTypeSpringTest extends BaseTest { - - @Autowired - private FlowExecutor flowExecutor; - - @Test - public void testMultipleType() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a==>b==>c==>b==>a", response.getExecuteStepStr()); - response = flowExecutor.execute2Resp("chain3", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a==>b==>c", response.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/multipleType/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/multipleType/cmp/ACmp.java deleted file mode 100644 index 343dd85e8..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/multipleType/cmp/ACmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.multipleType.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("a") -public class ACmp extends NodeComponent { - - @Override - public void process() { - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/multipleType/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/multipleType/cmp/BCmp.java deleted file mode 100644 index 65ac7a70f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/multipleType/cmp/BCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.multipleType.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("b") -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/multipleType/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/multipleType/cmp/CCmp.java deleted file mode 100644 index dff3388b9..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/multipleType/cmp/CCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.multipleType.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("c") -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/nodeExecutor/CustomerDefaultNodeExecutor.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/nodeExecutor/CustomerDefaultNodeExecutor.java deleted file mode 100644 index 0ced9da9f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/nodeExecutor/CustomerDefaultNodeExecutor.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.yomahub.liteflow.test.nodeExecutor; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DataBus; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; -import com.yomahub.liteflow.flow.executor.NodeExecutor; - -/** - * 自定义默认的节点执行器 - */ -public class CustomerDefaultNodeExecutor extends NodeExecutor { - @Override - public void execute(NodeComponent instance) throws Exception { - DefaultContext context = instance.getFirstContextBean(); - LOG.info("使用customerDefaultNodeExecutor进行执行"); - context.setData("customerDefaultNodeExecutor", this.getClass()); - super.execute(instance); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/nodeExecutor/CustomerNodeExecutor.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/nodeExecutor/CustomerNodeExecutor.java deleted file mode 100644 index 5a9f2e58d..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/nodeExecutor/CustomerNodeExecutor.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.yomahub.liteflow.test.nodeExecutor; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DataBus; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; -import com.yomahub.liteflow.flow.executor.NodeExecutor; - -/** - * 自定义节点执行器 - */ -public class CustomerNodeExecutor extends NodeExecutor { - @Override - public void execute(NodeComponent instance) throws Exception { - DefaultContext context = instance.getFirstContextBean(); - LOG.info("使用customerNodeExecutor进行执行"); - context.setData("customerNodeExecutor", this.getClass()); - super.execute(instance); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/nodeExecutor/CustomerNodeExecutorAndCustomRetry.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/nodeExecutor/CustomerNodeExecutorAndCustomRetry.java deleted file mode 100644 index 003d33319..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/nodeExecutor/CustomerNodeExecutorAndCustomRetry.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.yomahub.liteflow.test.nodeExecutor; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DataBus; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; -import com.yomahub.liteflow.flow.executor.NodeExecutor; - -import java.util.concurrent.TimeUnit; - -/** - * 自定义节点执行器 - */ -public class CustomerNodeExecutorAndCustomRetry extends NodeExecutor { - @Override - public void execute(NodeComponent instance) throws Exception { - DefaultContext context = instance.getFirstContextBean(); - LOG.info("使用customerNodeExecutorAndCustomRetry进行执行"); - context.setData("customerNodeExecutorAndCustomRetry", this.getClass()); - super.execute(instance); - } - - @Override - protected void retry(NodeComponent instance, int currentRetryCount) throws Exception { - TimeUnit.MICROSECONDS.sleep(20L); - DefaultContext context = instance.getFirstContextBean(); - context.setData("retryLogic", this.getClass()); - super.retry(instance, currentRetryCount); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/nodeExecutor/LiteflowNodeExecutorSpringTest.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/nodeExecutor/LiteflowNodeExecutorSpringTest.java deleted file mode 100644 index 68afc4cd4..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/nodeExecutor/LiteflowNodeExecutorSpringTest.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.yomahub.liteflow.test.nodeExecutor; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - - -/** - * 测试spring下的组件重试 - * - * @author Bryan.Zhang - * @since 2.5.10 - */ -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:/nodeExecutor/application.xml") -public class LiteflowNodeExecutorSpringTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - // 默认执行器测试 - @Test - public void testCustomerDefaultNodeExecutor() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals(CustomerDefaultNodeExecutor.class, context.getData("customerDefaultNodeExecutor")); - Assert.assertEquals("a", response.getExecuteStepStr()); - } - - //默认执行器测试+全局重试配置测试 - @Test - public void testDefaultExecutorForRetry() { - LiteflowResponse response = flowExecutor.execute2Resp("chain2", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals(CustomerDefaultNodeExecutor.class, context.getData("customerDefaultNodeExecutor")); - Assert.assertEquals("b==>b==>b", response.getExecuteStepStr()); - } - - //自定义执行器测试 - @Test - public void testCustomerExecutor() { - LiteflowResponse response = flowExecutor.execute2Resp("chain3", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("c", response.getExecuteStepStr()); - } - - //自定义执行器测试+全局重试配置测试 - @Test - public void testCustomExecutorForRetry() { - LiteflowResponse response = flowExecutor.execute2Resp("chain4", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertFalse(response.isSuccess()); - Assert.assertEquals(CustomerNodeExecutorAndCustomRetry.class, context.getData("retryLogic")); - Assert.assertEquals("d==>d==>d==>d==>d==>d", response.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/nodeExecutor/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/nodeExecutor/cmp/ACmp.java deleted file mode 100644 index 8fd765bb1..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/nodeExecutor/cmp/ACmp.java +++ /dev/null @@ -1,22 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.nodeExecutor.cmp; - -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.core.NodeComponent; - -@LiteflowComponent("b") -public class BCmp extends NodeComponent { - - private int flag = 0; - - @Override - public void process() { - System.out.println("BCmp executed!"); - if (flag < 2){ - flag++; - throw new RuntimeException("demo exception"); - } - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/nodeExecutor/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/nodeExecutor/cmp/CCmp.java deleted file mode 100644 index f800c08b2..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/nodeExecutor/cmp/CCmp.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.nodeExecutor.cmp; - -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.annotation.LiteflowRetry; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.flow.executor.NodeExecutor; -import com.yomahub.liteflow.test.nodeExecutor.CustomerNodeExecutor; - -@LiteflowComponent("c") -@LiteflowRetry(5) -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - - @Override - public Class getNodeExecutorClass() { - return CustomerNodeExecutor.class; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/nodeExecutor/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/nodeExecutor/cmp/DCmp.java deleted file mode 100644 index bc99b47a9..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/nodeExecutor/cmp/DCmp.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * - * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.nodeExecutor.cmp; - -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.annotation.LiteflowRetry; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.flow.executor.NodeExecutor; -import com.yomahub.liteflow.test.nodeExecutor.CustomerNodeExecutorAndCustomRetry; - -@LiteflowComponent("d") -@LiteflowRetry(retry = 5, forExceptions = {NullPointerException.class}) -public class DCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("DCmp executed!"); - throw new NullPointerException("demo exception"); - } - - @Override - public Class getNodeExecutorClass() { - return CustomerNodeExecutorAndCustomRetry.class; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/nullParam/NullParamTest.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/nullParam/NullParamTest.java deleted file mode 100644 index 05a6b3524..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/nullParam/NullParamTest.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.yomahub.liteflow.test.nullParam; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * 单元测试:传递null param导致NPE的优化代码 - * @author LeoLee - * @since 2.6.6 - **/ -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:/nullParam/application-local.xml") -public class NullParamTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - /** - * 支持无参的flow执行,以及param 为null时的异常抛出 - */ - @Test - public void testNullParam() throws Exception { - LiteflowResponse response = flowExecutor.execute2Resp("chain1"); - Assert.assertTrue(response.isSuccess()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/nullParam/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/nullParam/cmp/ACmp.java deleted file mode 100644 index e518efd8c..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/nullParam/cmp/ACmp.java +++ /dev/null @@ -1,22 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.nullParam.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("a") -public class ACmp extends NodeComponent { - - @Override - public void process() { - System.out.println("ACmp executed!"); - System.out.println("get request data:" + this.getRequestData()); - this.getSlot().setInput("BCmp", "param for BCmp"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/nullParam/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/nullParam/cmp/BCmp.java deleted file mode 100644 index 52bdc4633..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/nullParam/cmp/BCmp.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.nullParam.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("b") -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BCmp executed!"); - System.out.println("BCmp param:" + this.getSlot().getInput("BCmp")); - this.getSlot().setOutput("CCmp", "param for CCmp"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/nullParam/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/nullParam/cmp/CCmp.java deleted file mode 100644 index 5707caf27..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/nullParam/cmp/CCmp.java +++ /dev/null @@ -1,22 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.nullParam.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("c") -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - System.out.println("CCmp param:" + this.getSlot().getOutput("CCmp")); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomJsonFlowParser.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomJsonFlowParser.java deleted file mode 100644 index a08e8cf98..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomJsonFlowParser.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.yomahub.liteflow.test.parsecustom; - -import com.yomahub.liteflow.parser.ClassJsonFlowParser; - -/** - * 模拟用户自定义源解析 - * @author dongguo.tao - * @date 2021/4/7 - */ -public class CustomJsonFlowParser extends ClassJsonFlowParser { - @Override - public String parseCustom() { - //模拟自定义解析结果 - String content = "{\"flow\":{\"nodes\":{\"node\":[{\"id\":\"a\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.ACmp\"},{\"id\":\"b\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.BCmp\"},{\"id\":\"c\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.CCmp\"},{\"id\":\"d\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.DCmp\"},{\"id\":\"e\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.ECmp\"},{\"id\":\"f\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.FCmp\"},{\"id\":\"g\",\"class\":\"com.yomahub.liteflow.test.parsecustom.cmp.GCmp\"}]},\"chain\":[{\"name\":\"chain2\",\"condition\":[{\"type\":\"then\",\"value\":\"c,g,f\"}]},{\"name\":\"chain1\",\"condition\":[{\"type\":\"then\",\"value\":\"a,c\"},{\"type\":\"when\",\"value\":\"b,d,e(f|g)\"},{\"type\":\"then\",\"value\":\"chain2\"}]}]}}"; - return content; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomParserJsonSpringTest.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomParserJsonSpringTest.java deleted file mode 100644 index d2344bf88..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parsecustom/CustomParserJsonSpringTest.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.yomahub.liteflow.test.parsecustom; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * spring环境的自定义json parser单元测试 - * @author dongguo.tao - * @since 2.5.0 - */ -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:/parsecustom/application.xml") -public class CustomParserJsonSpringTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //测试spring场景的自定义json parser - @Test - public void testJsonCustomParser() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "args"); - Assert.assertTrue(response.isSuccess()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/ACmp.java deleted file mode 100644 index 071d43853..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/ACmp.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author dongguo.tao - * @email taodongguo@foxmail.com - * @Date 2020/4/7 - */ -package com.yomahub.liteflow.test.parsecustom.cmp; - -import cn.hutool.core.util.StrUtil; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.exception.FlowSystemException; -import org.springframework.stereotype.Component; - -@Component("a") -public class ACmp extends NodeComponent { - - @Override - public void process() { - String str = this.getRequestData(); - if(StrUtil.isNotBlank(str) && str.equals("exception")) { - throw new FlowSystemException("chain execute execption"); - } - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/BCmp.java deleted file mode 100644 index 5ab76db33..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/BCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author dongguo.tao - * @email taodongguo@foxmail.com - * @Date 2020/4/7 - */ -package com.yomahub.liteflow.test.parsecustom.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("b") -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/CCmp.java deleted file mode 100644 index 58e9c86ee..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/CCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author dongguo.tao - * @email taodongguo@foxmail.com - * @Date 2020/4/7 - */ -package com.yomahub.liteflow.test.parsecustom.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("c") -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/DCmp.java deleted file mode 100644 index c7e7a6355..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/DCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author dongguo.tao - * @email taodongguo@foxmail.com - * @Date 2020/4/7 - */ -package com.yomahub.liteflow.test.parsecustom.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("d") -public class DCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("DCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/ECmp.java deleted file mode 100644 index 44d672a9a..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/ECmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author dongguo.tao - * @email taodongguo@foxmail.com - * @Date 2020/4/7 - */ -package com.yomahub.liteflow.test.parsecustom.cmp; - -import com.yomahub.liteflow.core.NodeSwitchComponent; -import org.springframework.stereotype.Component; - -@Component("e") -public class ECmp extends NodeSwitchComponent { - - @Override - public String processSwitch() throws Exception { - return "g"; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/FCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/FCmp.java deleted file mode 100644 index 84444012b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/FCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author dongguo.tao - * @email taodongguo@foxmail.com - * @Date 2020/4/7 - */ -package com.yomahub.liteflow.test.parsecustom.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("f") -public class FCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("FCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/GCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/GCmp.java deleted file mode 100644 index 510e9932e..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parsecustom/cmp/GCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author dongguo.tao - * @email taodongguo@foxmail.com - * @Date 2020/4/7 - */ -package com.yomahub.liteflow.test.parsecustom.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("g") -public class GCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("GCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parser/LFParserJsonNoSpringTest.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parser/LFParserJsonNoSpringTest.java deleted file mode 100644 index 36d554e7a..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parser/LFParserJsonNoSpringTest.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.yomahub.liteflow.test.parser; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; - -/** - * 无spring环境的json parser单元测试 - * @author Bryan.Zhang - * @since 2.5.0 - */ -public class LFParserJsonNoSpringTest extends BaseTest { - - //测试无spring场景的json parser - @Test - public void testNoSpring() { - LiteflowConfig liteflowConfig = new LiteflowConfig(); - liteflowConfig.setRuleSource("parser/flow.json"); - FlowExecutor executor = new FlowExecutor(liteflowConfig); - LiteflowResponse response = executor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parser/LFParserJsonSpringTest.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parser/LFParserJsonSpringTest.java deleted file mode 100644 index 6e724a374..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parser/LFParserJsonSpringTest.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.yomahub.liteflow.test.parser; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * spring环境的json parser单元测试 - * @author Bryan.Zhang - * @since 2.5.0 - */ -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:/parser/application-json.xml") -public class LFParserJsonSpringTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //测试spring场景的xml parser - @Test - public void testJsonParser() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parser/LFParserXmlNoSpringTest.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parser/LFParserXmlNoSpringTest.java deleted file mode 100644 index 8220d6397..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parser/LFParserXmlNoSpringTest.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.yomahub.liteflow.test.parser; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; - -/** - * 无spring环境的xml parser单元测试 - * @author Bryan.Zhang - * @since 2.5.0 - */ -public class LFParserXmlNoSpringTest extends BaseTest { - - //测试无spring场景的xml parser - @Test - public void testNoSpring() { - LiteflowConfig liteflowConfig = new LiteflowConfig(); - liteflowConfig.setRuleSource("parser/flow.xml"); - FlowExecutor executor = new FlowExecutor(liteflowConfig); - LiteflowResponse response = executor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parser/LFParserXmlSpringTest.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parser/LFParserXmlSpringTest.java deleted file mode 100644 index 0b72d2681..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parser/LFParserXmlSpringTest.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.yomahub.liteflow.test.parser; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * spring环境的xml parser单元测试 - * @author Bryan.Zhang - * @since 2.5.0 - */ -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:/parser/application-xml.xml") -public class LFParserXmlSpringTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //测试spring场景的xml parser - @Test - public void testXmlParser() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parser/LFParserYmlNoSpringTest.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parser/LFParserYmlNoSpringTest.java deleted file mode 100644 index 79d7d858c..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parser/LFParserYmlNoSpringTest.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.yomahub.liteflow.test.parser; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; - -/** - * 无spring环境的yml parser单元测试 - * @author Bryan.Zhang - * @since 2.5.0 - */ -public class LFParserYmlNoSpringTest extends BaseTest { - - //测试无spring场景的yml parser - @Test - public void testNoSpring() { - LiteflowConfig liteflowConfig = new LiteflowConfig(); - liteflowConfig.setRuleSource("parser/flow.yml"); - FlowExecutor executor = new FlowExecutor(liteflowConfig); - LiteflowResponse response = executor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parser/LFParserYmlSpringTest.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parser/LFParserYmlSpringTest.java deleted file mode 100644 index d60c99699..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parser/LFParserYmlSpringTest.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.yomahub.liteflow.test.parser; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * spring环境的xml parser单元测试 - * @author Bryan.Zhang - * @since 2.5.0 - */ -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:/parser/application-yml.xml") -public class LFParserYmlSpringTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //测试spring场景的xml parser - @Test - public void testYmlParser() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parser/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parser/cmp/ACmp.java deleted file mode 100644 index 61056f6b0..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parser/cmp/ACmp.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.parser.cmp; - -import cn.hutool.core.util.StrUtil; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.exception.FlowSystemException; -import org.springframework.stereotype.Component; - -@Component("a") -public class ACmp extends NodeComponent { - - @Override - public void process() { - String str = this.getRequestData(); - if(StrUtil.isNotBlank(str) && str.equals("exception")) { - throw new FlowSystemException("chain execute execption"); - } - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parser/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parser/cmp/BCmp.java deleted file mode 100644 index ee283f0ef..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parser/cmp/BCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.parser.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("b") -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parser/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parser/cmp/CCmp.java deleted file mode 100644 index 7be4d1b56..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parser/cmp/CCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.parser.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("c") -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parser/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parser/cmp/DCmp.java deleted file mode 100644 index 8b7bd0a0e..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parser/cmp/DCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.parser.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("d") -public class DCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("DCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parser/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parser/cmp/ECmp.java deleted file mode 100644 index e86aca5dc..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parser/cmp/ECmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.parser.cmp; - -import com.yomahub.liteflow.core.NodeSwitchComponent; -import org.springframework.stereotype.Component; - -@Component("e") -public class ECmp extends NodeSwitchComponent { - - @Override - public String processSwitch() throws Exception { - return "g"; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parser/cmp/FCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parser/cmp/FCmp.java deleted file mode 100644 index c4ce4ffde..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parser/cmp/FCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.parser.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("f") -public class FCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("FCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parser/cmp/GCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parser/cmp/GCmp.java deleted file mode 100644 index 4c0e80f1d..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/parser/cmp/GCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.parser.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("g") -public class GCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("GCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/preAndFinally/PreAndFinallySpringTest.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/preAndFinally/PreAndFinallySpringTest.java deleted file mode 100644 index 7a2566b70..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/preAndFinally/PreAndFinallySpringTest.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.yomahub.liteflow.test.preAndFinally; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * spring环境下pre节点和finally节点的测试 - * @author Bryan.Zhang - * @since 2.6.4 - */ -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:/preAndFinally/application.xml") -public class PreAndFinallySpringTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //测试普通的pre和finally节点 - @Test - public void testPreAndFinally1() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("p1==>p2==>a==>b==>c==>f1==>f2",response.getExecuteStepStr()); - } - - //测试pre和finally节点不放在开头和结尾的情况 - @Test - public void testPreAndFinally2() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain2", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("p1==>p2==>a==>b==>c==>f1==>f2",response.getExecuteStepStr()); - } - - //测试有节点报错是否还执行finally节点的情况,其中d节点会报错,但依旧执行f1,f2节点 - @Test - public void testPreAndFinally3() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain3", "arg"); - Assert.assertFalse(response.isSuccess()); - Assert.assertEquals("p1==>p2==>a==>d==>f1==>f2", response.getExecuteStepStr()); - } - - //测试在finally节点里是否能获取exception - @Test - public void testPreAndFinally4() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain4", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertFalse(response.isSuccess()); - Assert.assertTrue(context.getData("hasEx")); - } - - //测试嵌套结构pre和finally是否在各自的chain里打出 - @Test - public void testPreAndFinally5() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain5", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("p1==>p2==>p1==>p2==>a==>b==>c==>f1==>f2==>f1", response.getExecuteStepStrWithoutTime()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/ACmp.java deleted file mode 100644 index 1dcd75200..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/ACmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.preAndFinally.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("a") -public class ACmp extends NodeComponent { - - @Override - public void process() { - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/BCmp.java deleted file mode 100644 index ac7b830ef..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/BCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.preAndFinally.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("b") -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/CCmp.java deleted file mode 100644 index 9219d67ac..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/CCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.preAndFinally.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("c") -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/DCmp.java deleted file mode 100644 index 3f1216a7a..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/DCmp.java +++ /dev/null @@ -1,22 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.preAndFinally.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("d") -public class DCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - int i = 1/0; - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Finally1Cmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Finally1Cmp.java deleted file mode 100644 index f826fb5ed..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Finally1Cmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.preAndFinally.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("f1") -public class Finally1Cmp extends NodeComponent { - - @Override - public void process() { - System.out.println("Finally1Cmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Finally2Cmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Finally2Cmp.java deleted file mode 100644 index 92157678a..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Finally2Cmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.preAndFinally.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("f2") -public class Finally2Cmp extends NodeComponent { - - @Override - public void process() { - System.out.println("Finally2Cmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Finally3Cmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Finally3Cmp.java deleted file mode 100644 index 22c4d1d2e..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Finally3Cmp.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.preAndFinally.cmp; - -import cn.hutool.core.util.ObjectUtil; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; -import org.springframework.stereotype.Component; - -@Component("f3") -public class Finally3Cmp extends NodeComponent { - - @Override - public void process() throws Exception{ - Slot slot = this.getSlot(); - DefaultContext context = slot.getFirstContextBean(); - if (ObjectUtil.isNull(slot.getException())){ - context.setData("hasEx", false); - }else{ - context.setData("hasEx", true); - } - System.out.println("Finally3Cmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Pre1Cmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Pre1Cmp.java deleted file mode 100644 index 741e15d49..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Pre1Cmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.preAndFinally.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("p1") -public class Pre1Cmp extends NodeComponent { - - @Override - public void process() { - System.out.println("Pre1Cmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Pre2Cmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Pre2Cmp.java deleted file mode 100644 index 43cd71f17..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/preAndFinally/cmp/Pre2Cmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.preAndFinally.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("p2") -public class Pre2Cmp extends NodeComponent { - - @Override - public void process() { - System.out.println("Pre2Cmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/privateDelivery/PrivateDeliverySpringTest.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/privateDelivery/PrivateDeliverySpringTest.java deleted file mode 100644 index 866a58691..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/privateDelivery/PrivateDeliverySpringTest.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.yomahub.liteflow.test.privateDelivery; - -import cn.hutool.core.collection.ConcurrentHashSet; -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; -import java.util.Set; - -/** - * spring环境下隐私投递的测试 - * @author Bryan.Zhang - * @since 2.5.0 - */ -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:/privateDelivery/application.xml") -public class PrivateDeliverySpringTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testPrivateDelivery() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - DefaultContext context = response.getFirstContextBean(); - ConcurrentHashSet set = context.getData("testSet"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals(100, set.size()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/privateDelivery/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/privateDelivery/cmp/ACmp.java deleted file mode 100644 index 253901045..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/privateDelivery/cmp/ACmp.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.privateDelivery.cmp; - -import cn.hutool.core.collection.ConcurrentHashSet; -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; - -import java.util.HashSet; - -@LiteflowComponent("a") -public class ACmp extends NodeComponent { - - @Override - public void process() { - System.out.println("ACmp executed!"); - DefaultContext context = this.getFirstContextBean(); - context.setData("testSet", new ConcurrentHashSet<>()); - - for (int i = 0; i < 100; i++) { - this.sendPrivateDeliveryData("b",i+1); - } - } -} - diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/privateDelivery/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/privateDelivery/cmp/BCmp.java deleted file mode 100644 index 2bd78c299..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/privateDelivery/cmp/BCmp.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.privateDelivery.cmp; - -import cn.hutool.core.collection.ConcurrentHashSet; -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; - -import java.util.Set; - -@LiteflowComponent("b") -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BCmp executed!"); - DefaultContext context = this.getFirstContextBean(); - Integer value = this.getPrivateDeliveryData(); - ConcurrentHashSet testSet = context.getData("testSet"); - testSet.add(value); - } -} - diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/privateDelivery/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/privateDelivery/cmp/CCmp.java deleted file mode 100644 index 8d79eb1bc..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/privateDelivery/cmp/CCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.privateDelivery.cmp; - -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.core.NodeComponent; - -@LiteflowComponent("d") -public class DCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/refreshRule/RefreshRuleSpringTest.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/refreshRule/RefreshRuleSpringTest.java deleted file mode 100644 index 015012282..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/refreshRule/RefreshRuleSpringTest.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.yomahub.liteflow.test.refreshRule; - -import cn.hutool.core.io.resource.ResourceUtil; -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.enums.FlowParserTypeEnum; -import com.yomahub.liteflow.flow.FlowBus; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * spring环境下重新加载规则测试 - * @author Bryan.Zhang - * @since 2.6.4 - */ -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:/refreshRule/application.xml") -public class RefreshRuleSpringTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //测试普通刷新流程的场景 - @Test - public void testRefresh1() throws Exception{ - String content = ResourceUtil.readUtf8Str("classpath: /refreshRule/flow_update.xml"); - FlowBus.refreshFlowMetaData(FlowParserTypeEnum.TYPE_XML, content); - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - } - - //测试优雅刷新的场景 - @Test - public void testRefresh2() throws Exception{ - new Thread(() -> { - try { - Thread.sleep(3000L); - String content = ResourceUtil.readUtf8Str("classpath: /refreshRule/flow_update.xml"); - FlowBus.refreshFlowMetaData(FlowParserTypeEnum.TYPE_XML, content); - } catch (Exception e) { - e.printStackTrace(); - } - - }).start(); - - for (int i = 0; i < 500; i++) { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - try { - Thread.sleep(10L); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/refreshRule/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/refreshRule/cmp/ACmp.java deleted file mode 100644 index 96d599a5b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/refreshRule/cmp/ACmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.refreshRule.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("a") -public class ACmp extends NodeComponent { - - @Override - public void process() { - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/refreshRule/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/refreshRule/cmp/BCmp.java deleted file mode 100644 index 8930ff9d0..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/refreshRule/cmp/BCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.refreshRule.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("b") -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/refreshRule/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/refreshRule/cmp/CCmp.java deleted file mode 100644 index b15889a00..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/refreshRule/cmp/CCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.refreshRule.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("c") -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/reload/ReloadSpringTest.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/reload/ReloadSpringTest.java deleted file mode 100644 index c05b09dae..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/reload/ReloadSpringTest.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.yomahub.liteflow.test.reload; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * spring环境下重新加载规则测试 - * @author Bryan.Zhang - * @since 2.5.0 - */ -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:/reload/application.xml") -public class ReloadSpringTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - //用reloadRule去重新加载,这里如果配置是放在本地。如果想修改,则要去修改target下面的flow.xml - //这里的测试,手动打断点然后去修改,是ok的。但是整个测试,暂且只是为了测试这个功能是否能正常运行 - @Test - public void testReload() throws Exception{ - flowExecutor.reloadRule(); - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/reload/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/reload/cmp/ACmp.java deleted file mode 100644 index fcf6fed45..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/reload/cmp/ACmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.reload.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("a") -public class ACmp extends NodeComponent { - - @Override - public void process() { - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/reload/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/reload/cmp/BCmp.java deleted file mode 100644 index 978235c62..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/reload/cmp/BCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.reload.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("b") -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/reload/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/reload/cmp/CCmp.java deleted file mode 100644 index 48620d98c..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/reload/cmp/CCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.reload.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("c") -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/removeChain/RemoveChainSpringTest.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/removeChain/RemoveChainSpringTest.java deleted file mode 100644 index 77dfe5279..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/removeChain/RemoveChainSpringTest.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.yomahub.liteflow.test.removeChain; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.flow.FlowBus; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:/removeChain/application.xml") -public class RemoveChainSpringTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testRemoveChain(){ - LiteflowResponse response1 = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response1.isSuccess()); - FlowBus.removeChain("chain1"); - LiteflowResponse response2 = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertFalse(response2.isSuccess()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/removeChain/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/removeChain/cmp/ACmp.java deleted file mode 100644 index 8640323d1..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/removeChain/cmp/ACmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.removeChain.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("a") -public class ACmp extends NodeComponent { - - @Override - public void process() { - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/removeChain/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/removeChain/cmp/BCmp.java deleted file mode 100644 index 3a81b5a66..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/removeChain/cmp/BCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.removeChain.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("b") -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/removeChain/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/removeChain/cmp/CCmp.java deleted file mode 100644 index e6ef9f22d..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/removeChain/cmp/CCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.removeChain.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("c") -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/removeChain/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/removeChain/cmp/DCmp.java deleted file mode 100644 index 51f9407fe..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/removeChain/cmp/DCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.removeChain.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("d") -public class DCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/requestId/LiteflowRequestIdSpringbootTest.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/requestId/LiteflowRequestIdSpringbootTest.java deleted file mode 100644 index 30ea53438..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/requestId/LiteflowRequestIdSpringbootTest.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.yomahub.liteflow.test.requestId; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * @author tangkc - */ -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:/requestId/application.xml") -@ComponentScan({"com.yomahub.liteflow.test.requestId.cmp"}) -public class LiteflowRequestIdSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testRequestId() throws Exception { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("1", response.getSlot().getRequestId()); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/requestId/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/requestId/cmp/ACmp.java deleted file mode 100644 index 9cbef6dc0..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/requestId/cmp/ACmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * - * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.requestId.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("a") -@LiteflowCmpDefine -public class ACmp { - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/requestId/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/requestId/cmp/BCmp.java deleted file mode 100644 index 01495457b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/requestId/cmp/BCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.requestId.cmp; - -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -@Component("b") -@LiteflowCmpDefine -public class BCmp{ - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/requestId/config/CustomRequestIdGenerator.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/requestId/config/CustomRequestIdGenerator.java deleted file mode 100644 index fcaa9e84b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/requestId/config/CustomRequestIdGenerator.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.yomahub.liteflow.test.requestId.config; - -import com.yomahub.liteflow.flow.id.RequestIdGenerator; - -import java.util.concurrent.atomic.AtomicInteger; - -/** - * @author tangkc - */ -public class CustomRequestIdGenerator implements RequestIdGenerator { - - private final AtomicInteger atomicInteger = new AtomicInteger(0); - - @Override - public String generate() { - return atomicInteger.incrementAndGet() + ""; - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/resizeSlot/ResizeSlotSpringTest.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/resizeSlot/ResizeSlotSpringTest.java deleted file mode 100644 index ccfeb93ca..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/resizeSlot/ResizeSlotSpringTest.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.yomahub.liteflow.test.resizeSlot; - -import cn.hutool.core.util.ReflectUtil; -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.slot.DataBus; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; -import java.lang.reflect.Field; -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.ConcurrentLinkedQueue; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.Future; - -/** - * springboot环境下slot扩容测试 - * @author Bryan.Zhang - * @since 2.5.0 - */ -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:/resizeSlot/application.xml") -public class ResizeSlotSpringTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testResize() throws Exception{ - ExecutorService pool = Executors.newCachedThreadPool(); - - List> futureList = new ArrayList<>(); - for (int i = 0; i < 100; i++) { - Future future = pool.submit(() -> flowExecutor.execute2Resp("chain1", "arg")); - futureList.add(future); - } - - for(Future future : futureList){ - Assert.assertTrue(future.get().isSuccess()); - } - - //取到static的对象QUEUE - Field field = ReflectUtil.getField(DataBus.class, "QUEUE"); - ConcurrentLinkedQueue queue = (ConcurrentLinkedQueue) ReflectUtil.getStaticFieldValue(field); - - //因为初始slotSize是4,按照0.75的扩容比,要满足100个线程,应该扩容5~6次,5次=65,6次=114 - //为什么不是直接114呢? - //因为在单测中根据机器的性能,在多线程情况下,有些机器跑的慢一点,也就是说65个就足够了。有些机器跑的快一点,是能真正扩容到114个的 - Assert.assertTrue(queue.size() > 4); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/resizeSlot/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/resizeSlot/cmp/ACmp.java deleted file mode 100644 index 4f466e1c5..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/resizeSlot/cmp/ACmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.resizeSlot.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("a") -public class ACmp extends NodeComponent { - - @Override - public void process() { - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/resizeSlot/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/resizeSlot/cmp/BCmp.java deleted file mode 100644 index 0c76deae4..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/resizeSlot/cmp/BCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.resizeSlot.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("b") -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/resizeSlot/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/resizeSlot/cmp/CCmp.java deleted file mode 100644 index 7dc427c11..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/resizeSlot/cmp/CCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.resizeSlot.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("c") -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/subflow/ImplicitSubFlowSpringTest.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/subflow/ImplicitSubFlowSpringTest.java deleted file mode 100644 index 20c8b7f0f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/subflow/ImplicitSubFlowSpringTest.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.yomahub.liteflow.test.subflow; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; -import java.util.HashSet; -import java.util.Set; - -/** - * 测试隐式调用子流程 - * 单元测试 - * - * @author justin.xu - */ -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:/subflow/application-implicit.xml") -public class ImplicitSubFlowSpringTest extends BaseTest { - @Resource - private FlowExecutor flowExecutor; - - public static final Set RUN_TIME_SLOT = new HashSet<>(); - - //这里GCmp中隐式的调用chain4,从而执行了h,m - @Test - public void testImplicitSubFlow() { - LiteflowResponse response = flowExecutor.execute2Resp("chain3", "it's a request"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("f==>g==>h==>m", response.getExecuteStepStr()); - - // 传递了slotIndex,则set的size==1 - Assert.assertEquals(1, RUN_TIME_SLOT.size()); - // set中第一次设置的requestId和response中的requestId一致 - Assert.assertTrue(RUN_TIME_SLOT.contains(response.getSlot().getRequestId())); - //requestData的取值正确 - Assert.assertEquals("it's implicit subflow.", context.getData("innerRequest")); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/subflow/SubflowInDifferentConfigSpringTest.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/subflow/SubflowInDifferentConfigSpringTest.java deleted file mode 100644 index 20db8947f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/subflow/SubflowInDifferentConfigSpringTest.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.yomahub.liteflow.test.subflow; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.exception.MultipleParsersException; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.property.LiteflowConfigGetter; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * 测试主流程与子流程在不同的配置文件的场景 - * - * @author Bryan.Zhang - */ -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:/subflow/application-subInDifferentConfig1.xml") -public class SubflowInDifferentConfigSpringTest extends BaseTest { - @Resource - private FlowExecutor flowExecutor; - - //是否按照流程定义配置执行 - @Test - public void testExplicitSubFlow1() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "it's a request"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a==>b==>b==>a==>e==>d", response.getExecuteStepStr()); - } - - //主要测试有不同的配置类型后会不会报出既定的错误 - @Test(expected = MultipleParsersException.class) - public void testExplicitSubFlow2() { - LiteflowConfig config = LiteflowConfigGetter.get(); - config.setRuleSource("subflow/flow-main.xml,subflow/flow-sub1.xml,subflow/flow-sub2.yml"); - flowExecutor.init(); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/subflow/SubflowJsonSpringTest.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/subflow/SubflowJsonSpringTest.java deleted file mode 100644 index d858befa4..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/subflow/SubflowJsonSpringTest.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.yomahub.liteflow.test.subflow; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * 测试显示调用子流程(json) - * 单元测试 - * - * @author justin.xu - */ -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:/subflow/application-json.xml") -public class SubflowJsonSpringTest extends BaseTest { - @Resource - private FlowExecutor flowExecutor; - - //是否按照流程定义配置执行 - @Test - public void testExplicitSubFlow() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "it's a request"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a==>b==>c==>b==>a==>e==>d", response.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/subflow/SubflowXMLSpringTest.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/subflow/SubflowXMLSpringTest.java deleted file mode 100644 index 3bcf02975..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/subflow/SubflowXMLSpringTest.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.yomahub.liteflow.test.subflow; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * 测试显示调用子流程(xml) - * 单元测试 - * - * @author justin.xu - */ -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:/subflow/application-xml.xml") -public class SubflowXMLSpringTest extends BaseTest { - @Resource - private FlowExecutor flowExecutor; - - //是否按照流程定义配置执行 - @Test - public void testExplicitSubFlow() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "it's a request"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a==>b==>c==>b==>a==>e==>d", response.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/subflow/SubflowYmlSpringTest.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/subflow/SubflowYmlSpringTest.java deleted file mode 100644 index 2df39e9e1..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/subflow/SubflowYmlSpringTest.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.yomahub.liteflow.test.subflow; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * 测试显示调用子流程(yml) - * 单元测试 - * - * @author justin.xu - */ -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:/subflow/application-yml.xml") -public class SubflowYmlSpringTest extends BaseTest { - @Resource - private FlowExecutor flowExecutor; - - //是否按照流程定义配置执行 - @Test - public void testExplicitSubFlowYml() { - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "it's a request"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a==>b==>c==>b==>a==>e==>d", response.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/ACmp.java deleted file mode 100644 index 75a7fb49b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/ACmp.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.yomahub.liteflow.test.subflow.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - - -@Component("a") -public class ACmp extends NodeComponent { - @Override - public void process() { - System.out.println("Acomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/BCmp.java deleted file mode 100644 index 9fb3c9326..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/BCmp.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.yomahub.liteflow.test.subflow.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - - -@Component("b") -public class BCmp extends NodeComponent { - @Override - public void process() { - System.out.println("Bcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/CCmp.java deleted file mode 100644 index ce8ea149f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/CCmp.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.yomahub.liteflow.test.subflow.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - - -@Component("c") -public class CCmp extends NodeComponent { - @Override - public void process() throws Exception { - System.out.println("Ccomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/DCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/DCmp.java deleted file mode 100644 index 309196e9b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/DCmp.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.yomahub.liteflow.test.subflow.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - - -@Component("d") -public class DCmp extends NodeComponent { - @Override - public void process() throws Exception { - System.out.println("Dcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/ECmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/ECmp.java deleted file mode 100644 index b855a1ae0..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/subflow/cmp1/ECmp.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.yomahub.liteflow.test.subflow.cmp1; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - - -@Component("e") -public class ECmp extends NodeComponent { - - @Override - public void process() throws Exception { - System.out.println("Ecomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/FCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/FCmp.java deleted file mode 100644 index 23e07e275..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/FCmp.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.yomahub.liteflow.test.subflow.cmp2; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -import static com.yomahub.liteflow.test.subflow.ImplicitSubFlowSpringTest.RUN_TIME_SLOT; - - -@Component("f") -public class FCmp extends NodeComponent { - @Override - public void process() throws Exception { - - RUN_TIME_SLOT.add(this.getSlot().getRequestId()); - - System.out.println("Fcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/GCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/GCmp.java deleted file mode 100644 index 422774520..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/GCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.yomahub.liteflow.test.subflow.cmp2; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -import static com.yomahub.liteflow.test.subflow.ImplicitSubFlowSpringTest.RUN_TIME_SLOT; - - -@Component("g") -public class GCmp extends NodeComponent { - - @Override - public void process() throws Exception { - - RUN_TIME_SLOT.add(this.getSlot().getRequestId()); - - System.out.println("Gcmp executed!"); - - this.invoke("chain4", "it's implicit subflow."); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/HCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/HCmp.java deleted file mode 100644 index f21e2db88..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/HCmp.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.yomahub.liteflow.test.subflow.cmp2; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import org.springframework.stereotype.Component; - -import static com.yomahub.liteflow.test.subflow.ImplicitSubFlowSpringTest.RUN_TIME_SLOT; - - -@Component("h") -public class HCmp extends NodeComponent { - @Override - public void process() throws Exception { - String requestData = this.getSubChainReqData(); - DefaultContext context = this.getFirstContextBean(); - context.setData("innerRequest", requestData); - - RUN_TIME_SLOT.add(this.getSlot().getRequestId()); - - System.out.println("Hcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/MCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/MCmp.java deleted file mode 100644 index 16aa57e86..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/subflow/cmp2/MCmp.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.yomahub.liteflow.test.subflow.cmp2; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -import static com.yomahub.liteflow.test.subflow.ImplicitSubFlowSpringTest.RUN_TIME_SLOT; - - -@Component("m") -public class MCmp extends NodeComponent { - @Override - public void process() throws Exception { - - RUN_TIME_SLOT.add(this.getSlot().getRequestId()); - - System.out.println("Mcomp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/tag/NodeTagSpringJsonTest.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/tag/NodeTagSpringJsonTest.java deleted file mode 100644 index e1a644b30..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/tag/NodeTagSpringJsonTest.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.yomahub.liteflow.test.tag; - -import cn.hutool.core.collection.ConcurrentHashSet; -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * springboot环境下隐私投递的测试 - * @author Bryan.Zhang - * @since 2.5.0 - */ -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:/tag/application-json.xml") -public class NodeTagSpringJsonTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testTag1() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("123",context.getData("test")); - } - - @Test - public void testTag2() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain2", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a==>a==>a==>c==>e", response.getExecuteStepStr()); - } - - //测试多线程when情况下的tag取值是否正确 - //这里循环多次的原因是,因为when多线程,有时候因为凑巧,可能正确。所以多次情况下在2.6.4版本肯定出错 - @Test - public void testTag3() throws Exception{ - for (int i = 0; i < 50; i++) { - LiteflowResponse response = flowExecutor.execute2Resp("chain3", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - ConcurrentHashSet testSet = context.getData("test"); - Assert.assertEquals(3, testSet.size()); - } - } - - //测试tag是否能在isAccess中起效 - @Test - public void testTag4() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain4", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("g", response.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/tag/NodeTagSpringXmlTest.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/tag/NodeTagSpringXmlTest.java deleted file mode 100644 index 75cc97811..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/tag/NodeTagSpringXmlTest.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.yomahub.liteflow.test.tag; - -import cn.hutool.core.collection.ConcurrentHashSet; -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * springboot环境下隐私投递的测试 - * @author Bryan.Zhang - * @since 2.5.0 - */ -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:/tag/application-xml.xml") -public class NodeTagSpringXmlTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testTag1() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("123",context.getData("test")); - } - - @Test - public void testTag2() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain2", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("a==>a==>a==>c==>e", response.getExecuteStepStr()); - } - - //测试多线程when情况下的tag取值是否正确 - //这里循环多次的原因是,因为when多线程,有时候因为凑巧,可能正确。所以多次情况下在2.6.4版本肯定出错 - @Test - public void testTag3() throws Exception{ - for (int i = 0; i < 50; i++) { - LiteflowResponse response = flowExecutor.execute2Resp("chain3", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - ConcurrentHashSet testSet = context.getData("test"); - Assert.assertEquals(3, testSet.size()); - } - } - - //测试tag是否能在isAccess中起效 - @Test - public void testTag4() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain4", "arg"); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals("g", response.getExecuteStepStr()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/tag/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/tag/cmp/ACmp.java deleted file mode 100644 index 57868b288..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/tag/cmp/ACmp.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.tag.cmp; - -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; - -@LiteflowComponent("a") -public class ACmp extends NodeComponent { - - @Override - public void process() { - String testKey = "test"; - DefaultContext context = this.getFirstContextBean(); - if (context.getData(testKey) == null){ - context.setData(testKey,this.getTag()); - }else{ - String s = context.getData(testKey); - s += this.getTag(); - context.setData(testKey, s); - } - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/tag/cmp/B1Cmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/tag/cmp/B1Cmp.java deleted file mode 100644 index de3d6aba5..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/tag/cmp/B1Cmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.tag.cmp; - -import cn.hutool.core.collection.ConcurrentHashSet; -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; - -@LiteflowComponent("b1") -public class B1Cmp extends NodeComponent { - - @Override - public void process() { - DefaultContext context = this.getFirstContextBean(); - context.setData("test",new ConcurrentHashSet()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/tag/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/tag/cmp/BCmp.java deleted file mode 100644 index 58841874b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/tag/cmp/BCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.tag.cmp; - -import cn.hutool.core.collection.ConcurrentHashSet; -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.slot.Slot; - -@LiteflowComponent("b") -public class BCmp extends NodeComponent { - - @Override - public void process() { - DefaultContext context = this.getFirstContextBean(); - ConcurrentHashSet testSet = context.getData("test"); - testSet.add(this.getTag()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/tag/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/tag/cmp/CCmp.java deleted file mode 100644 index ceedd8abe..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/tag/cmp/CCmp.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.tag.cmp; - -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.core.NodeSwitchComponent; - -@LiteflowComponent("c") -public class CCmp extends NodeSwitchComponent { - - @Override - public String processSwitch() throws Exception { - if(this.getTag().equals("2")){ - return "e"; - }else{ - return "d"; - } - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/tag/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/tag/cmp/DCmp.java deleted file mode 100644 index 572980b78..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/tag/cmp/DCmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.tag.cmp; - -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.core.NodeComponent; - -@LiteflowComponent("d") -public class DCmp extends NodeComponent { - - @Override - public void process() { - System.out.println(this.getTag()); - System.out.println("DCmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/tag/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/tag/cmp/ECmp.java deleted file mode 100644 index 11ee96c8a..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/tag/cmp/ECmp.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.tag.cmp; - -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.core.NodeComponent; - -@LiteflowComponent("e") -public class ECmp extends NodeComponent { - - @Override - public void process() { - System.out.println(this.getTag()); - System.out.println("ECmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/tag/cmp/FCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/tag/cmp/FCmp.java deleted file mode 100644 index 2f670578e..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/tag/cmp/FCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.tag.cmp; - -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.core.NodeComponent; - -@LiteflowComponent("f") -public class FCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("FCmp executed!"); - } - - @Override - public boolean isAccess() { - return Boolean.parseBoolean(this.getTag()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/tag/cmp/GCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/tag/cmp/GCmp.java deleted file mode 100644 index f6180b563..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/tag/cmp/GCmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.tag.cmp; - -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.core.NodeComponent; - -@LiteflowComponent("g") -public class GCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("GCmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/TestTL.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/TestTL.java deleted file mode 100644 index fee0055e5..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/TestTL.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.yomahub.liteflow.test.useTTLInWhen; - -import com.alibaba.ttl.TransmittableThreadLocal; - -public class TestTL { - - public static ThreadLocal tl = new TransmittableThreadLocal<>(); - - public static String get(){ - return tl.get(); - } - - public static void set(String value){ - tl.set(value); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/UseTTLInWhenSpringTest.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/UseTTLInWhenSpringTest.java deleted file mode 100644 index be06ec9d2..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/UseTTLInWhenSpringTest.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.yomahub.liteflow.test.useTTLInWhen; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * 在when异步节点的情况下去拿ThreadLocal里的测试场景 - * @author Bryan.Zhang - * @since 2.6.3 - */ -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:/useTTLInWhen/application.xml") -public class UseTTLInWhenSpringTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testUseTTLInWhen() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - DefaultContext context = response.getFirstContextBean(); - Assert.assertEquals("hello,b", context.getData("b")); - Assert.assertEquals("hello,c", context.getData("c")); - Assert.assertEquals("hello,d", context.getData("d")); - Assert.assertEquals("hello,e", context.getData("e")); - Assert.assertEquals("hello,f", context.getData("f")); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/ACmp.java deleted file mode 100644 index bab445a4b..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/ACmp.java +++ /dev/null @@ -1,22 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.useTTLInWhen.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.test.useTTLInWhen.TestTL; -import org.springframework.stereotype.Component; - -@Component("a") -public class ACmp extends NodeComponent { - - @Override - public void process() { - TestTL.set("hello"); - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/BCmp.java deleted file mode 100644 index b0e7b15f6..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/BCmp.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.useTTLInWhen.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.useTTLInWhen.TestTL; -import org.springframework.stereotype.Component; - -@Component("b") -public class BCmp extends NodeComponent { - - @Override - public void process() { - DefaultContext context = this.getFirstContextBean(); - String value = TestTL.get(); - context.setData(this.getNodeId(),value+",b"); - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/CCmp.java deleted file mode 100644 index 90a294748..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/CCmp.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.useTTLInWhen.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.useTTLInWhen.TestTL; -import org.springframework.stereotype.Component; - -@Component("c") -public class CCmp extends NodeComponent { - - @Override - public void process() { - DefaultContext context = this.getFirstContextBean(); - String value = TestTL.get(); - context.setData(this.getNodeId(),value+",c"); - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/DCmp.java deleted file mode 100644 index c81a734af..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/DCmp.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.useTTLInWhen.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.useTTLInWhen.TestTL; -import org.springframework.stereotype.Component; - -@Component("d") -public class DCmp extends NodeComponent { - - @Override - public void process() { - DefaultContext context = this.getFirstContextBean(); - String value = TestTL.get(); - context.setData(this.getNodeId(),value+",d"); - System.out.println("DCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/ECmp.java deleted file mode 100644 index 7384747fc..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/ECmp.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.useTTLInWhen.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.useTTLInWhen.TestTL; -import org.springframework.stereotype.Component; - -@Component("e") -public class ECmp extends NodeComponent { - - @Override - public void process() { - DefaultContext context = this.getFirstContextBean(); - String value = TestTL.get(); - context.setData(this.getNodeId(),value+",e"); - System.out.println("ECmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/FCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/FCmp.java deleted file mode 100644 index 0fb50eff3..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/useTTLInWhen/cmp/FCmp.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.useTTLInWhen.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.useTTLInWhen.TestTL; -import org.springframework.stereotype.Component; - -@Component("f") -public class FCmp extends NodeComponent { - - @Override - public void process() { - DefaultContext context = this.getFirstContextBean(); - String value = TestTL.get(); - context.setData(this.getNodeId(),value+",f"); - System.out.println("FCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/whenTimeOut/WhenTimeOutSpringTest1.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/whenTimeOut/WhenTimeOutSpringTest1.java deleted file mode 100644 index e82ae842f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/whenTimeOut/WhenTimeOutSpringTest1.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.yomahub.liteflow.test.whenTimeOut; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.exception.WhenTimeoutException; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * springboot环境下异步线程超时日志打印测试 - * @author Bryan.Zhang - * @since 2.6.4 - */ -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:/whenTimeOut/application1.xml") -public class WhenTimeOutSpringTest1 extends BaseTest { - - private final Logger log = LoggerFactory.getLogger(this.getClass()); - - @Resource - private FlowExecutor flowExecutor; - - //其中b和c在when情况下超时,所以抛出了WhenTimeoutException这个错 - @Test - public void testWhenTimeOut() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertFalse(response.isSuccess()); - Assert.assertEquals(WhenTimeoutException.class, response.getCause().getClass()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/whenTimeOut/WhenTimeOutSpringTest2.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/whenTimeOut/WhenTimeOutSpringTest2.java deleted file mode 100644 index 70fdddb63..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/whenTimeOut/WhenTimeOutSpringTest2.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.yomahub.liteflow.test.whenTimeOut; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; - -/** - * springboot环境下异步线程超时日志打印测试 - * @author Bryan.Zhang - * @since 2.6.4 - */ -@RunWith(SpringRunner.class) -@ContextConfiguration("classpath:/whenTimeOut/application2.xml") -public class WhenTimeOutSpringTest2 extends BaseTest { - - private final Logger log = LoggerFactory.getLogger(this.getClass()); - - @Resource - private FlowExecutor flowExecutor; - - //其中d,e,f都sleep 4秒,其中def是不同的组,超时设置5秒 - @Test - public void testWhenTimeOut() throws Exception{ - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assert.assertTrue(response.isSuccess()); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/ACmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/ACmp.java deleted file mode 100644 index 19b0bc06d..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/ACmp.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.whenTimeOut.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("a") -public class ACmp extends NodeComponent { - - @Override - public void process() { - System.out.println("ACmp executed!"); - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/BCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/BCmp.java deleted file mode 100644 index fb8cd2a1c..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/BCmp.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.whenTimeOut.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("b") -public class BCmp extends NodeComponent { - - @Override - public void process() { - try { - Thread.sleep(4000); - }catch (Exception ignored){ - - } - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/CCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/CCmp.java deleted file mode 100644 index ee9fe9773..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/CCmp.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.whenTimeOut.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("c") -public class CCmp extends NodeComponent { - - @Override - public void process() { - try { - Thread.sleep(3500); - }catch (Exception ignored){ - - } - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/DCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/DCmp.java deleted file mode 100644 index 5f3c4b3fb..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/DCmp.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.whenTimeOut.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("d") -public class DCmp extends NodeComponent { - - @Override - public void process() { - try { - Thread.sleep(4000); - }catch (Exception ignored){ - - } - System.out.println("DCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/ECmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/ECmp.java deleted file mode 100644 index 0e18aee71..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/ECmp.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.whenTimeOut.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("e") -public class ECmp extends NodeComponent { - - @Override - public void process() { - try { - Thread.sleep(4000); - }catch (Exception ignored){ - - } - System.out.println("ECmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/FCmp.java b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/FCmp.java deleted file mode 100644 index fad1d2d66..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/whenTimeOut/cmp/FCmp.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.whenTimeOut.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.springframework.stereotype.Component; - -@Component("f") -public class FCmp extends NodeComponent { - - @Override - public void process() { - try { - Thread.sleep(4000); - }catch (Exception ignored){ - - } - System.out.println("FCmp executed!"); - } - -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/absoluteConfigPath/application.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/absoluteConfigPath/application.xml deleted file mode 100644 index fbcaa2645..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/absoluteConfigPath/application.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/absoluteConfigPath/flow.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/absoluteConfigPath/flow.xml deleted file mode 100644 index a6fda5aa0..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/absoluteConfigPath/flow.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/aop/application-custom.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/aop/application-custom.xml deleted file mode 100644 index 22d8648d9..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/aop/application-custom.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/aop/application-global.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/aop/application-global.xml deleted file mode 100644 index 7675c3ee7..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/aop/application-global.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/aop/flow.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/aop/flow.xml deleted file mode 100644 index 84e8d4588..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/aop/flow.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/asyncNode/application.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/asyncNode/application.xml deleted file mode 100644 index 872baab7a..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/asyncNode/application.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/asyncNode/flow.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/asyncNode/flow.xml deleted file mode 100644 index e81546bb6..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/asyncNode/flow.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/base/application.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/base/application.xml deleted file mode 100644 index 828258996..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/base/application.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/base/flow.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/base/flow.xml deleted file mode 100644 index 7153add87..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/base/flow.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/builder/application1.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/builder/application1.xml deleted file mode 100644 index e93c94aa9..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/builder/application1.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/builder/application2.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/builder/application2.xml deleted file mode 100644 index 5689a4a41..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/builder/application2.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/cmpRetry/application.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/cmpRetry/application.xml deleted file mode 100644 index ac8639b63..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/cmpRetry/application.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/cmpRetry/flow.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/cmpRetry/flow.xml deleted file mode 100644 index d44e3ee05..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/cmpRetry/flow.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/cmpStep/application.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/cmpStep/application.xml deleted file mode 100644 index 5e250af2a..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/cmpStep/application.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/cmpStep/flow.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/cmpStep/flow.xml deleted file mode 100644 index cd127f1ab..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/cmpStep/flow.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/component/application.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/component/application.xml deleted file mode 100644 index 44c503ec8..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/component/application.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/component/flow.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/component/flow.xml deleted file mode 100644 index 2a504fd01..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/component/flow.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/config/application-local.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/config/application-local.xml deleted file mode 100644 index cf4d83caf..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/config/application-local.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/config/flow.json b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/config/flow.json deleted file mode 100644 index c3a7a8763..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/config/flow.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "flow": { - "nodes": { - "node": [ - { - "id": "a", - "class": "com.yomahub.liteflow.test.config.cmp.ACmp" - }, - { - "id": "b", - "class": "com.yomahub.liteflow.test.config.cmp.BCmp" - }, - { - "id": "c", - "class": "com.yomahub.liteflow.test.config.cmp.CCmp" - } - ] - }, - "chain": [ - { - "name": "chain1", - "condition": [ - {"type": "then", "value": "a,b,c"} - ] - } - ] - } -} \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/config/local-rule-source-pattern-match.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/config/local-rule-source-pattern-match.xml deleted file mode 100644 index 4425765a2..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/config/local-rule-source-pattern-match.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/config/springgroup0/flow0.json b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/config/springgroup0/flow0.json deleted file mode 100644 index 24615d628..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/config/springgroup0/flow0.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "flow": { - "chain": [ - { - "name": "chain1", - "condition": [ - {"type": "then", "value": "a,b,c"} - ] - } - ] - } -} \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/config/springgroup0/flow0.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/config/springgroup0/flow0.xml deleted file mode 100644 index 22870d94f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/config/springgroup0/flow0.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/config/springgroup0/flow0.yml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/config/springgroup0/flow0.yml deleted file mode 100644 index 3cdaced3e..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/config/springgroup0/flow0.yml +++ /dev/null @@ -1,6 +0,0 @@ -flow: - chain: - - name: chain1 - condition: - - type: then - value: 'a,b,c' diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/config/springgroup1/flow.json b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/config/springgroup1/flow.json deleted file mode 100644 index 2821316b6..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/config/springgroup1/flow.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "flow": { - "chain": [ - { - "name": "chain3", - "condition": [ - {"type": "then", "value": "a,c,f,g"} - ] - } - ] - } -} \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/config/springgroup1/flow.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/config/springgroup1/flow.xml deleted file mode 100644 index 5b23639aa..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/config/springgroup1/flow.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/config/springgroup1/flow.yml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/config/springgroup1/flow.yml deleted file mode 100644 index 7a089fb8f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/config/springgroup1/flow.yml +++ /dev/null @@ -1,6 +0,0 @@ -flow: - chain: - - name: chain3 - condition: - - type: then - value: 'a,c,f,g' diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/customNodes/application.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/customNodes/application.xml deleted file mode 100644 index 520dc7eb4..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/customNodes/application.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/customNodes/flow.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/customNodes/flow.xml deleted file mode 100644 index ecc1abcd6..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/customNodes/flow.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/customWhenThreadPool/application.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/customWhenThreadPool/application.xml deleted file mode 100644 index e8b99d0a2..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/customWhenThreadPool/application.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/customWhenThreadPool/flow.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/customWhenThreadPool/flow.xml deleted file mode 100644 index c6f199ddb..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/customWhenThreadPool/flow.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/emptyFlow/application.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/emptyFlow/application.xml deleted file mode 100644 index cff8065b9..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/emptyFlow/application.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/emptyFlow/flow.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/emptyFlow/flow.xml deleted file mode 100644 index e69de29bb..000000000 diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/enable/application-local.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/enable/application-local.xml deleted file mode 100644 index 3d7d6c9b6..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/enable/application-local.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/enable/flow.json b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/enable/flow.json deleted file mode 100644 index 217fbd773..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/enable/flow.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "flow": { - "chain": [ - { - "name": "chain1", - "condition": [ - {"type": "then", "value": "a,b,c"} - ] - } - ] - } -} diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/event/application.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/event/application.xml deleted file mode 100644 index 615425358..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/event/application.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/event/flow.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/event/flow.xml deleted file mode 100644 index a1f50587a..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/event/flow.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/exception/application1.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/exception/application1.xml deleted file mode 100644 index b673ccea5..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/exception/application1.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/exception/application2.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/exception/application2.xml deleted file mode 100644 index b673ccea5..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/exception/application2.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/exception/flow-exception.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/exception/flow-exception.xml deleted file mode 100644 index 662226def..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/exception/flow-exception.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/exception/flow.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/exception/flow.xml deleted file mode 100644 index 328a6cb14..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/exception/flow.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/execute2Future/application.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/execute2Future/application.xml deleted file mode 100644 index 3189e6276..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/execute2Future/application.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/execute2Future/flow.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/execute2Future/flow.xml deleted file mode 100644 index a7517a2cf..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/execute2Future/flow.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/flowmeta/application.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/flowmeta/application.xml deleted file mode 100644 index 1d9c67d83..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/flowmeta/application.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/flowmeta/flow.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/flowmeta/flow.xml deleted file mode 100644 index 7153add87..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/flowmeta/flow.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/lazy/application.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/lazy/application.xml deleted file mode 100644 index f08888dc3..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/lazy/application.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/lazy/flow.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/lazy/flow.xml deleted file mode 100644 index 22870d94f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/lazy/flow.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/lfCmpAnno/application.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/lfCmpAnno/application.xml deleted file mode 100644 index 50dc6c909..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/lfCmpAnno/application.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/lfCmpAnno/flow.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/lfCmpAnno/flow.xml deleted file mode 100644 index 62def0c37..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/lfCmpAnno/flow.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/logback.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/logback.xml deleted file mode 100644 index bfc3d1c5d..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/logback.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n - - - - - - - - diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/monitor/application.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/monitor/application.xml deleted file mode 100644 index 0596e85ba..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/monitor/application.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/monitor/flow.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/monitor/flow.xml deleted file mode 100644 index e8ea83f95..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/monitor/flow.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/multipleType/application.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/multipleType/application.xml deleted file mode 100644 index b4b1f55c1..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/multipleType/application.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/multipleType/flow.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/multipleType/flow.xml deleted file mode 100644 index 38b703214..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/multipleType/flow.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/multipleType/flow.yml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/multipleType/flow.yml deleted file mode 100644 index 4c1d8375a..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/multipleType/flow.yml +++ /dev/null @@ -1,6 +0,0 @@ -flow: - chain: - - name: chain3 - condition: - - type: then - value: 'a,b,c' diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/nodeExecutor/application.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/nodeExecutor/application.xml deleted file mode 100644 index d41da7482..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/nodeExecutor/application.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/nodeExecutor/flow.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/nodeExecutor/flow.xml deleted file mode 100644 index 6b867c5bc..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/nodeExecutor/flow.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/nullParam/application-local.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/nullParam/application-local.xml deleted file mode 100644 index e584cdc44..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/nullParam/application-local.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/nullParam/flow.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/nullParam/flow.xml deleted file mode 100644 index cd45c1a17..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/nullParam/flow.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/parsecustom/application.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/parsecustom/application.xml deleted file mode 100644 index 73f64a898..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/parsecustom/application.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/parser/application-json.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/parser/application-json.xml deleted file mode 100644 index b589af68f..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/parser/application-json.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/parser/application-xml.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/parser/application-xml.xml deleted file mode 100644 index b84296f5d..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/parser/application-xml.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/parser/application-yml.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/parser/application-yml.xml deleted file mode 100644 index 7ffffc8c0..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/parser/application-yml.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/parser/flow.json b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/parser/flow.json deleted file mode 100644 index 52d0d05c0..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/parser/flow.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "flow": { - "nodes": { - "node": [ - { - "id": "a", - "class": "com.yomahub.liteflow.test.parser.cmp.ACmp" - }, - { - "id": "b", - "class": "com.yomahub.liteflow.test.parser.cmp.BCmp" - }, - { - "id": "c", - "class": "com.yomahub.liteflow.test.parser.cmp.CCmp" - }, - { - "id": "d", - "class": "com.yomahub.liteflow.test.parser.cmp.DCmp" - }, - { - "id": "e", - "class": "com.yomahub.liteflow.test.parser.cmp.ECmp" - }, - { - "id": "f", - "class": "com.yomahub.liteflow.test.parser.cmp.FCmp" - }, - { - "id": "g", - "class": "com.yomahub.liteflow.test.parser.cmp.GCmp" - } - ] - }, - "chain": [ - { - "name": "chain2", - "condition": [ - {"type": "then", "value": "c,g,f"} - ] - }, - { - "name": "chain1", - "condition": [ - {"type": "then", "value": "a,c"}, - {"type": "when", "value": "b,d,e(f|g)"}, - {"type": "then", "value": "chain2"} - ] - } - ] - } -} \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/parser/flow.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/parser/flow.xml deleted file mode 100644 index 0775c5ec1..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/parser/flow.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/parser/flow.yml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/parser/flow.yml deleted file mode 100644 index 814f59d54..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/parser/flow.yml +++ /dev/null @@ -1,30 +0,0 @@ -flow: - nodes: - node: - - id: a - class: com.yomahub.liteflow.test.parser.cmp.ACmp - - id: b - class: com.yomahub.liteflow.test.parser.cmp.BCmp - - id: c - class: com.yomahub.liteflow.test.parser.cmp.CCmp - - id: d - class: com.yomahub.liteflow.test.parser.cmp.DCmp - - id: e - class: com.yomahub.liteflow.test.parser.cmp.ECmp - - id: f - class: com.yomahub.liteflow.test.parser.cmp.FCmp - - id: g - class: com.yomahub.liteflow.test.parser.cmp.GCmp - chain: - - name: chain1 - condition: - - type: then - value: 'a,c' - - type: when - value: 'b,d,e(f|g)' - - type: then - value: 'chain2' - - name: chain2 - condition: - - type: then - value: 'c,g,f' diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/preAndFinally/application.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/preAndFinally/application.xml deleted file mode 100644 index dfec48b43..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/preAndFinally/application.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/preAndFinally/flow.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/preAndFinally/flow.xml deleted file mode 100644 index 78e263d19..000000000 --- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/preAndFinally/flow.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - -
-        
-        
-    
-
-    
-        
-        
-        
-        
-    
-
-    
-        
-        
-        
-    
-
-    
-        
-        
-    
-
-    
-        
-        
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/privateDelivery/application.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/privateDelivery/application.xml
deleted file mode 100644
index 35d842025..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/privateDelivery/application.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-    
-
-    
-
-    
-
-    
-        
-    
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/privateDelivery/flow.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/privateDelivery/flow.xml
deleted file mode 100644
index bf7146217..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/privateDelivery/flow.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-    
-        
-        
-        
-        
-        
-        
-        
-        
-        
-        
-        
-        
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/refreshRule/application.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/refreshRule/application.xml
deleted file mode 100644
index 70923f166..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/refreshRule/application.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-    
-
-    
-
-    
-
-    
-        
-    
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/refreshRule/flow.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/refreshRule/flow.xml
deleted file mode 100644
index 22870d94f..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/refreshRule/flow.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/refreshRule/flow_update.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/refreshRule/flow_update.xml
deleted file mode 100644
index 29090f04a..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/refreshRule/flow_update.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/reload/application.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/reload/application.xml
deleted file mode 100644
index 5f7d8832c..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/reload/application.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-    
-
-    
-
-    
-
-    
-        
-    
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/reload/flow.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/reload/flow.xml
deleted file mode 100644
index 22870d94f..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/reload/flow.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/removeChain/application.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/removeChain/application.xml
deleted file mode 100644
index 4ea254e65..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/removeChain/application.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-    
-
-    
-
-    
-
-    
-        
-    
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/removeChain/flow.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/removeChain/flow.xml
deleted file mode 100644
index c89c44473..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/removeChain/flow.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-    
-        
-        
-    
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/requestId/application.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/requestId/application.xml
deleted file mode 100644
index d7428e0b8..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/requestId/application.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-    
-
-    
-
-    
-
-    
-        
-        
-    
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/requestId/flow.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/requestId/flow.xml
deleted file mode 100644
index cd988fe71..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/requestId/flow.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/resizeSlot/application.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/resizeSlot/application.xml
deleted file mode 100644
index 5335eb54f..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/resizeSlot/application.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-    
-
-    
-
-    
-
-    
-        
-        
-    
-
-    
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/resizeSlot/flow.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/resizeSlot/flow.xml
deleted file mode 100644
index 22870d94f..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/resizeSlot/flow.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/subflow/application-implicit.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/subflow/application-implicit.xml
deleted file mode 100644
index 82565433e..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/subflow/application-implicit.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-    
-
-    
-
-    
-
-    
-        
-    
-
-    
-    
-    
-    
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/subflow/application-json.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/subflow/application-json.xml
deleted file mode 100644
index 1322a6b48..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/subflow/application-json.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-    
-
-    
-
-    
-
-    
-        
-    
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/subflow/application-subInDifferentConfig1.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/subflow/application-subInDifferentConfig1.xml
deleted file mode 100644
index 429358ce1..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/subflow/application-subInDifferentConfig1.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-    
-
-    
-
-    
-
-    
-        
-    
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/subflow/application-xml.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/subflow/application-xml.xml
deleted file mode 100644
index fa1fee108..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/subflow/application-xml.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-    
-
-    
-
-    
-
-    
-        
-    
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/subflow/application-yml.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/subflow/application-yml.xml
deleted file mode 100644
index 95f1b3daa..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/subflow/application-yml.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-    
-
-    
-
-    
-
-    
-        
-    
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/subflow/flow-implicit.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/subflow/flow-implicit.xml
deleted file mode 100644
index 5baca7072..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/subflow/flow-implicit.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-    
-         
-    
-
-    
-        
-    
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/subflow/flow-main.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/subflow/flow-main.xml
deleted file mode 100644
index 0adf54fc4..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/subflow/flow-main.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-    
-        
-         
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/subflow/flow-sub1.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/subflow/flow-sub1.xml
deleted file mode 100644
index 471dee3fe..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/subflow/flow-sub1.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-    
-        
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/subflow/flow-sub2.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/subflow/flow-sub2.xml
deleted file mode 100644
index 63dd964bf..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/subflow/flow-sub2.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/subflow/flow-sub2.yml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/subflow/flow-sub2.yml
deleted file mode 100644
index 8ba43c102..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/subflow/flow-sub2.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-flow:
-  chain:
-    - name: chain3
-      condition:
-        - type: then
-          value: 'e,d'
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/subflow/flow.json b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/subflow/flow.json
deleted file mode 100644
index 143589315..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/subflow/flow.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
-  "flow": {
-    "chain": [
-      {
-        "name": "chain3",
-        "condition": [
-          {"type": "then", "value": "e,d"}
-        ]
-      },
-      {
-        "name": "chain2",
-        "condition": [
-          {"type": "then", "value": "b,a"},
-          {"type": "then", "value": "chain3"}
-        ]
-      },
-      {
-        "name": "chain1",
-        "condition": [
-          {"type": "then", "value": "a,b"},
-          {"type": "then", "value": "c"},
-          {"type": "then", "value": "chain2"}
-        ]
-      },
-      {
-        "name": "c",
-        "condition": [
-          {"type": "then", "value": "d,e"}
-        ]
-      }
-    ]
-  }
-}
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/subflow/flow.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/subflow/flow.xml
deleted file mode 100644
index 03cf81299..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/subflow/flow.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-    
-        
-           
-         
-    
-
-    
-        
-    
-
-    
-        
-        
-    
-
-    
-        
-    
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/subflow/flow.yml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/subflow/flow.yml
deleted file mode 100644
index cdd8de74b..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/subflow/flow.yml
+++ /dev/null
@@ -1,24 +0,0 @@
-flow:
-  chain:
-    - name: chain3
-      condition:
-        - type: then
-          value: 'e,d'
-    - name: chain1
-      condition:
-        - type: then
-          value: 'a,b'
-        - type: then
-          value: 'c'
-        - type: then
-          value: 'chain2'
-    - name: c
-      condition:
-        - type: then
-          value: 'd,e'
-    - name: chain2
-      condition:
-        - type: then
-          value: 'b,a'
-        - type: then
-          value: 'chain3'
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/tag/application-json.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/tag/application-json.xml
deleted file mode 100644
index 5c5aaaa28..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/tag/application-json.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-    
-
-    
-
-    
-
-    
-        
-    
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/tag/application-xml.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/tag/application-xml.xml
deleted file mode 100644
index 5c5aaaa28..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/tag/application-xml.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-    
-
-    
-
-    
-
-    
-        
-    
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/tag/flow.json b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/tag/flow.json
deleted file mode 100644
index 49c902e4a..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/tag/flow.json
+++ /dev/null
@@ -1,31 +0,0 @@
-{
-  "flow": {
-    "chain": [
-      {
-        "name": "chain1",
-        "condition": [
-          {"type": "then", "value": "a[1],a[2],a[3]"}
-        ]
-      },
-      {
-        "name": "chain2",
-        "condition": [
-          {"type": "then", "value": "a[1],a[2],a[3],c[2](d[5]|e[6])"}
-        ]
-      },
-      {
-        "name": "chain3",
-        "condition": [
-          {"type": "then", "value": "b1"},
-          {"type": "when", "value": "b[1],b[2],b[3]"}
-        ]
-      },
-      {
-        "name": "chain4",
-        "condition": [
-          {"type": "then", "value": "f[false],g"}
-        ]
-      }
-    ]
-  }
-}
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/tag/flow.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/tag/flow.xml
deleted file mode 100644
index b7ceb903d..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/tag/flow.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-    
-        
-    
-
-    
-        
-    
-
-    
-        
-        
-    
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/useTTLInWhen/application.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/useTTLInWhen/application.xml
deleted file mode 100644
index 858f2aa65..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/useTTLInWhen/application.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-    
-
-    
-
-    
-
-    
-        
-        
-    
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/useTTLInWhen/flow.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/useTTLInWhen/flow.xml
deleted file mode 100644
index af6d2ef54..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/useTTLInWhen/flow.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-    
-        
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/whenTimeOut/application1.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/whenTimeOut/application1.xml
deleted file mode 100644
index ef785f2fc..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/whenTimeOut/application1.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-    
-
-    
-
-    
-
-    
-        
-        
-    
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/whenTimeOut/application2.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/whenTimeOut/application2.xml
deleted file mode 100644
index 375455c81..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/whenTimeOut/application2.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-    
-
-    
-
-    
-
-    
-        
-        
-    
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/whenTimeOut/flow1.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/whenTimeOut/flow1.xml
deleted file mode 100644
index 657f64cc3..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/whenTimeOut/flow1.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-    
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/whenTimeOut/flow2.xml b/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/whenTimeOut/flow2.xml
deleted file mode 100644
index 6586ab0b8..000000000
--- a/liteflow-testcase-old/liteflow-testcase-springnative/src/test/resources/whenTimeOut/flow2.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-    
-        
-        
-        
-    
-
\ No newline at end of file
diff --git a/liteflow-testcase-old/pom.xml b/liteflow-testcase-old/pom.xml
deleted file mode 100644
index ab208e3bc..000000000
--- a/liteflow-testcase-old/pom.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-    
-        liteflow
-        com.yomahub
-        ${revision}
-        ../pom.xml
-    
-    4.0.0
-    pom
-
-    liteflow-testcase-old
-
-    
-        liteflow-testcase-declare-springboot
-        liteflow-testcase-nospring
-        liteflow-testcase-script-groovy-springboot
-        liteflow-testcase-script-qlexpress-springboot
-        liteflow-testcase-springboot
-        liteflow-testcase-springnative
-    
-
-
-
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 046e63395..22ab26d90 100644
--- a/pom.xml
+++ b/pom.xml
@@ -339,7 +339,6 @@
 		liteflow-rule-plugin
 		liteflow-spring-boot-starter
 		liteflow-spring
-		liteflow-testcase-old
 		liteflow-testcase-el