diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/core/FlowExecutor.java b/liteflow-core/src/main/java/com/yomahub/liteflow/core/FlowExecutor.java
index 9de1023c3..49d1433d2 100644
--- a/liteflow-core/src/main/java/com/yomahub/liteflow/core/FlowExecutor.java
+++ b/liteflow-core/src/main/java/com/yomahub/liteflow/core/FlowExecutor.java
@@ -67,6 +67,12 @@ public class FlowExecutor {
this.liteflowConfig = liteflowConfig;
}
+ public static FlowExecutor loadInstance(LiteflowConfig liteflowConfig){
+ FlowExecutor flowExecutor = new FlowExecutor(liteflowConfig);
+ flowExecutor.init();
+ return flowExecutor;
+ }
+
/**
* FlowExecutor的初始化化方式,主要用于parse规则文件
*/
diff --git a/liteflow-testcase-nospring/pom.xml b/liteflow-testcase-nospring/pom.xml
index 7252e31fa..d21261488 100644
--- a/liteflow-testcase-nospring/pom.xml
+++ b/liteflow-testcase-nospring/pom.xml
@@ -17,6 +17,12 @@
liteflow-core
${project.version}
+
+ ch.qos.logback
+ logback-classic
+ 1.2.3
+ test
+
junit
junit
diff --git a/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/BaseTest.java b/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/BaseTest.java
new file mode 100644
index 000000000..dacc3f9be
--- /dev/null
+++ b/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/BaseTest.java
@@ -0,0 +1,18 @@
+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.thread.ExecutorHelper;
+import org.junit.AfterClass;
+
+public class BaseTest {
+
+ @AfterClass
+ public static void cleanScanCache(){
+ FlowBus.cleanCache();
+ ExecutorHelper.loadInstance().clearExecutorServiceMap();
+ SpiFactoryCleaner.clean();
+ LiteflowConfigGetter.clean();
+ }
+}
diff --git a/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/base/BaseTest.java b/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/base/BaseCommonTest.java
similarity index 80%
rename from liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/base/BaseTest.java
rename to liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/base/BaseCommonTest.java
index 882dff76a..fd8272566 100644
--- a/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/base/BaseTest.java
+++ b/liteflow-testcase-nospring/src/test/java/com/yomahub/liteflow/test/base/BaseCommonTest.java
@@ -7,15 +7,13 @@ import com.yomahub.liteflow.property.LiteflowConfig;
import org.junit.Assert;
import org.junit.Test;
-public class BaseTest {
+public class BaseCommonTest {
@Test
public void testBase(){
LiteflowConfig config = new LiteflowConfig();
config.setRuleSource("base/flow.xml");
- FlowExecutor executor = new FlowExecutor();
- executor.setLiteflowConfig(config);
- executor.init();
+ FlowExecutor executor = FlowExecutor.loadInstance(config);
LiteflowResponse response = executor.execute2Resp("chain1", "test0");
Assert.assertTrue(response.isSuccess());
}
diff --git a/liteflow-testcase-script-groovy/src/test/java/com/yomahub/liteflow/test/script/groovy/LiteFlowXmlScriptBuilderGroovyTest.java b/liteflow-testcase-script-groovy/src/test/java/com/yomahub/liteflow/test/script/groovy/LiteFlowXmlScriptBuilderGroovyTest.java
new file mode 100644
index 000000000..143a217fc
--- /dev/null
+++ b/liteflow-testcase-script-groovy/src/test/java/com/yomahub/liteflow/test/script/groovy/LiteFlowXmlScriptBuilderGroovyTest.java
@@ -0,0 +1,96 @@
+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.entity.data.DefaultSlot;
+import com.yomahub.liteflow.entity.data.LiteflowResponse;
+import com.yomahub.liteflow.enums.NodeTypeEnum;
+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;slot.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");
+ Assert.assertTrue(response.isSuccess());
+ Assert.assertEquals(Integer.valueOf(6), response.getSlot().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.COND_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");
+ Assert.assertTrue(response.isSuccess());
+ Assert.assertEquals("d[组件D]==>s2[条件脚本S2]==>a[组件A]", response.getSlot().getExecuteStepStr());
+ }
+}
diff --git a/liteflow-testcase-script-qlexpress/src/test/java/com/yomahub/liteflow/test/script/qlexpress/LiteFlowXmlScriptBuilderQLExpressTest.java b/liteflow-testcase-script-qlexpress/src/test/java/com/yomahub/liteflow/test/script/qlexpress/LiteFlowXmlScriptBuilderQLExpressTest.java
new file mode 100644
index 000000000..2e467187e
--- /dev/null
+++ b/liteflow-testcase-script-qlexpress/src/test/java/com/yomahub/liteflow/test/script/qlexpress/LiteFlowXmlScriptBuilderQLExpressTest.java
@@ -0,0 +1,96 @@
+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.entity.data.DefaultSlot;
+import com.yomahub.liteflow.entity.data.LiteflowResponse;
+import com.yomahub.liteflow.enums.NodeTypeEnum;
+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;slot.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");
+ Assert.assertTrue(response.isSuccess());
+ Assert.assertEquals(Integer.valueOf(6), response.getSlot().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.COND_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.getSlot().getExecuteStepStr());
+ }
+}
diff --git a/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/aop/LFCustomAOPTest.java b/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/aop/CustomAOPSpringbootTest.java
similarity index 94%
rename from liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/aop/LFCustomAOPTest.java
rename to liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/aop/CustomAOPSpringbootTest.java
index bdda6ead1..ba14ea636 100644
--- a/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/aop/LFCustomAOPTest.java
+++ b/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/aop/CustomAOPSpringbootTest.java
@@ -23,11 +23,11 @@ import javax.annotation.Resource;
*/
@RunWith(SpringRunner.class)
@TestPropertySource(value = "classpath:/aop/application.properties")
-@SpringBootTest(classes = LFCustomAOPTest.class)
+@SpringBootTest(classes = CustomAOPSpringbootTest.class)
@EnableAutoConfiguration
@Import(CustomAspect.class)
@ComponentScan({"com.yomahub.liteflow.test.aop.cmp1","com.yomahub.liteflow.test.aop.cmp2"})
-public class LFCustomAOPTest extends BaseTest {
+public class CustomAOPSpringbootTest extends BaseTest {
@Resource
private FlowExecutor flowExecutor;
diff --git a/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/aop/LFGlobalAOPTest.java b/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/aop/GlobalAOPSpringbootTest.java
similarity index 95%
rename from liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/aop/LFGlobalAOPTest.java
rename to liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/aop/GlobalAOPSpringbootTest.java
index 95f5959e7..ad59c894c 100644
--- a/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/aop/LFGlobalAOPTest.java
+++ b/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/aop/GlobalAOPSpringbootTest.java
@@ -25,11 +25,11 @@ import javax.annotation.Resource;
*/
@RunWith(SpringRunner.class)
@TestPropertySource(value = "classpath:/aop/application.properties")
-@SpringBootTest(classes = LFGlobalAOPTest.class)
+@SpringBootTest(classes = GlobalAOPSpringbootTest.class)
@EnableAutoConfiguration
@Import(CmpAspect.class)
@ComponentScan({"com.yomahub.liteflow.test.aop.cmp1","com.yomahub.liteflow.test.aop.cmp2"})
-public class LFGlobalAOPTest extends BaseTest {
+public class GlobalAOPSpringbootTest extends BaseTest {
@Resource
private FlowExecutor flowExecutor;
diff --git a/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/config/LiteflowConfigSpringbootTest.java b/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/config/LiteflowConfigSpringbootTest1.java
similarity index 85%
rename from liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/config/LiteflowConfigSpringbootTest.java
rename to liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/config/LiteflowConfigSpringbootTest1.java
index f79c99382..3b916d447 100644
--- a/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/config/LiteflowConfigSpringbootTest.java
+++ b/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/config/LiteflowConfigSpringbootTest1.java
@@ -4,6 +4,7 @@ import com.yomahub.liteflow.core.FlowExecutor;
import com.yomahub.liteflow.entity.data.DefaultSlot;
import com.yomahub.liteflow.entity.data.LiteflowResponse;
import com.yomahub.liteflow.property.LiteflowConfig;
+import com.yomahub.liteflow.property.LiteflowConfigGetter;
import com.yomahub.liteflow.test.BaseTest;
import org.junit.Assert;
import org.junit.Test;
@@ -24,20 +25,17 @@ import javax.annotation.Resource;
* @since 2.5.0
*/
@RunWith(SpringRunner.class)
-@TestPropertySource(value = "classpath:/config/application-local.properties")
-@SpringBootTest(classes = LiteflowConfigSpringbootTest.class)
+@TestPropertySource(value = "classpath:/config/application1.properties")
+@SpringBootTest(classes = LiteflowConfigSpringbootTest1.class)
@EnableAutoConfiguration
@ComponentScan({"com.yomahub.liteflow.test.config.cmp"})
-public class LiteflowConfigSpringbootTest extends BaseTest {
+public class LiteflowConfigSpringbootTest1 extends BaseTest {
@Resource
private FlowExecutor flowExecutor;
- @Autowired
- private ApplicationContext context;
-
@Test
public void testConfig() {
- LiteflowConfig config = context.getBean(LiteflowConfig.class);
+ LiteflowConfig config = LiteflowConfigGetter.get();
LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg");
Assert.assertTrue(response.isSuccess());
Assert.assertEquals("config/flow.yml", config.getRuleSource());
diff --git a/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/config/LiteflowConfigSpringbootTest2.java b/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/config/LiteflowConfigSpringbootTest2.java
new file mode 100644
index 000000000..d2b0f40c4
--- /dev/null
+++ b/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/config/LiteflowConfigSpringbootTest2.java
@@ -0,0 +1,44 @@
+package com.yomahub.liteflow.test.config;
+
+import com.yomahub.liteflow.core.FlowExecutor;
+import com.yomahub.liteflow.entity.data.DefaultSlot;
+import com.yomahub.liteflow.entity.data.LiteflowResponse;
+import com.yomahub.liteflow.property.LiteflowConfig;
+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;
+
+/**
+ * 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.getSlot().getExecuteStepStr());
+
+ LiteflowResponse response1 = flowExecutor.execute2Resp("chain2", "arg");
+ Assert.assertEquals("a==>c==>b==>d", response1.getSlot().getExecuteStepStr());
+ }
+}
diff --git a/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/config/cmp/DCmp.java b/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/config/cmp/DCmp.java
new file mode 100644
index 000000000..ee710d1d6
--- /dev/null
+++ b/liteflow-testcase-springboot/src/test/java/com/yomahub/liteflow/test/config/cmp/DCmp.java
@@ -0,0 +1,21 @@
+/**
+ * Title: liteflow
+ * Description: 轻量级的组件式流程框架
+ * @author Bryan.Zhang
+ * @email weenyc31@163.com
+ * @Date 2020/4/1
+ */
+package com.yomahub.liteflow.test.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-springboot/src/test/resources/config/aaa/bbb/flow1.xml b/liteflow-testcase-springboot/src/test/resources/config/aaa/bbb/flow1.xml
new file mode 100644
index 000000000..ced398c9b
--- /dev/null
+++ b/liteflow-testcase-springboot/src/test/resources/config/aaa/bbb/flow1.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/liteflow-testcase-springboot/src/test/resources/config/aaa/flow0.xml b/liteflow-testcase-springboot/src/test/resources/config/aaa/flow0.xml
new file mode 100644
index 000000000..22870d94f
--- /dev/null
+++ b/liteflow-testcase-springboot/src/test/resources/config/aaa/flow0.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/liteflow-testcase-springboot/src/test/resources/config/application-local.properties b/liteflow-testcase-springboot/src/test/resources/config/application1.properties
similarity index 100%
rename from liteflow-testcase-springboot/src/test/resources/config/application-local.properties
rename to liteflow-testcase-springboot/src/test/resources/config/application1.properties
diff --git a/liteflow-testcase-springboot/src/test/resources/config/application2.properties b/liteflow-testcase-springboot/src/test/resources/config/application2.properties
new file mode 100644
index 000000000..5079ac3d2
--- /dev/null
+++ b/liteflow-testcase-springboot/src/test/resources/config/application2.properties
@@ -0,0 +1 @@
+liteflow.rule-source=config/**/flow*.xml
\ No newline at end of file
diff --git a/liteflow-testcase-springnative/pom.xml b/liteflow-testcase-springnative/pom.xml
index 5a567fccc..00739d0ec 100644
--- a/liteflow-testcase-springnative/pom.xml
+++ b/liteflow-testcase-springnative/pom.xml
@@ -57,6 +57,12 @@
zkclient
test
+
+ org.aspectj
+ aspectjweaver
+ 1.8.13
+ test
+
diff --git a/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/AbsoluteConfigPathSpringTest.java b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/AbsoluteConfigPathSpringTest.java
new file mode 100644
index 000000000..ce75466c2
--- /dev/null
+++ b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/AbsoluteConfigPathSpringTest.java
@@ -0,0 +1,27 @@
+package com.yomahub.liteflow.test.absoluteConfigPath;
+
+import com.yomahub.liteflow.core.FlowExecutor;
+import com.yomahub.liteflow.entity.data.DefaultSlot;
+import com.yomahub.liteflow.entity.data.LiteflowResponse;
+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-springnative/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/ACmp.java b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/ACmp.java
new file mode 100644
index 000000000..74091479f
--- /dev/null
+++ b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/ACmp.java
@@ -0,0 +1,20 @@
+/**
+ * Title: liteflow
+ * Description: 轻量级的组件式流程框架
+ * @author Bryan.Zhang
+ * @email weenyc31@163.com
+ * @Date 2020/4/1
+ */
+package com.yomahub.liteflow.test.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-springnative/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/BCmp.java b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/BCmp.java
new file mode 100644
index 000000000..0f162d805
--- /dev/null
+++ b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/BCmp.java
@@ -0,0 +1,21 @@
+/**
+ * Title: liteflow
+ * Description: 轻量级的组件式流程框架
+ * @author Bryan.Zhang
+ * @email weenyc31@163.com
+ * @Date 2020/4/1
+ */
+package com.yomahub.liteflow.test.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-springnative/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/CCmp.java b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/CCmp.java
new file mode 100644
index 000000000..2da1ea352
--- /dev/null
+++ b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/CCmp.java
@@ -0,0 +1,21 @@
+/**
+ * Title: liteflow
+ * Description: 轻量级的组件式流程框架
+ * @author Bryan.Zhang
+ * @email weenyc31@163.com
+ * @Date 2020/4/1
+ */
+package com.yomahub.liteflow.test.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-springnative/src/test/java/com/yomahub/liteflow/test/aop/CustomAOPSpringTest.java b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/CustomAOPSpringTest.java
new file mode 100644
index 000000000..b787bd8cf
--- /dev/null
+++ b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/CustomAOPSpringTest.java
@@ -0,0 +1,45 @@
+package com.yomahub.liteflow.test.aop;
+
+import com.yomahub.liteflow.core.FlowExecutor;
+import com.yomahub.liteflow.entity.data.DefaultSlot;
+import com.yomahub.liteflow.entity.data.LiteflowResponse;
+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-global.xml")
+public class CustomAOPSpringTest 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.getSlot().getData("a"));
+ Assert.assertEquals("before_after", response.getSlot().getData("b"));
+ Assert.assertEquals("before_after", response.getSlot().getData("c"));
+ }
+
+ //测试自定义AOP,并行场景
+ @Test
+ public void testCustomAopP() {
+ LiteflowResponse response= flowExecutor.execute2Resp("chain2", "it's a request");
+ Assert.assertTrue(response.isSuccess());
+ Assert.assertEquals("before_after", response.getSlot().getData("a"));
+ Assert.assertEquals("before_after", response.getSlot().getData("b"));
+ Assert.assertEquals("before_after", response.getSlot().getData("c"));
+ }
+}
diff --git a/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/GlobalAOPSpringTest.java b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/GlobalAOPSpringTest.java
new file mode 100644
index 000000000..8e414b4dd
--- /dev/null
+++ b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/GlobalAOPSpringTest.java
@@ -0,0 +1,58 @@
+package com.yomahub.liteflow.test.aop;
+
+import com.yomahub.liteflow.core.FlowExecutor;
+import com.yomahub.liteflow.entity.data.DefaultSlot;
+import com.yomahub.liteflow.entity.data.LiteflowResponse;
+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");
+ Assert.assertTrue(response.isSuccess());
+ Assert.assertEquals("before_after", response.getSlot().getData("a"));
+ Assert.assertEquals("before_after", response.getSlot().getData("b"));
+ Assert.assertEquals("before_after", response.getSlot().getData("c"));
+ Assert.assertEquals("before_after", response.getSlot().getData("d"));
+ Assert.assertEquals("before_after", response.getSlot().getData("e"));
+ }
+
+ //测试全局AOP,并行场景
+ @Test
+ public void testGlobalAopP() {
+ LiteflowResponse response= flowExecutor.execute2Resp("chain2", "it's a request");
+ Assert.assertTrue(response.isSuccess());
+ Assert.assertEquals("before_after", response.getSlot().getData("a"));
+ Assert.assertEquals("before_after", response.getSlot().getData("b"));
+ Assert.assertEquals("before_after", response.getSlot().getData("c"));
+ Assert.assertEquals("before_after", response.getSlot().getData("d"));
+ Assert.assertEquals("before_after", response.getSlot().getData("e"));
+ }
+
+ @AfterClass
+ public static void cleanScanCache(){
+ BaseTest.cleanScanCache();
+ ComponentScanner.cmpAroundAspect = null;
+ }
+}
diff --git a/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/aspect/CmpAspect.java b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/aspect/CmpAspect.java
new file mode 100644
index 000000000..22a94daa7
--- /dev/null
+++ b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/aspect/CmpAspect.java
@@ -0,0 +1,17 @@
+package com.yomahub.liteflow.test.aop.aspect;
+
+import cn.hutool.core.util.StrUtil;
+import com.yomahub.liteflow.aop.ICmpAroundAspect;
+import com.yomahub.liteflow.entity.data.Slot;
+
+public class CmpAspect implements ICmpAroundAspect {
+ @Override
+ public void beforeProcess(String nodeId, Slot slot) {
+ slot.setData(nodeId, "before");
+ }
+
+ @Override
+ public void afterProcess(String nodeId, Slot slot) {
+ slot.setData(nodeId, StrUtil.format("{}_{}", slot.getData(nodeId), "after"));
+ }
+}
diff --git a/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/aspect/CustomAspect.java b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/aspect/CustomAspect.java
new file mode 100644
index 000000000..7277a8ac5
--- /dev/null
+++ b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/aspect/CustomAspect.java
@@ -0,0 +1,27 @@
+package com.yomahub.liteflow.test.aop.aspect;
+
+import cn.hutool.core.util.StrUtil;
+import com.yomahub.liteflow.core.NodeComponent;
+import com.yomahub.liteflow.entity.data.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();
+ Slot slot = cmp.getSlot();
+ slot.setData(cmp.getNodeId(), "before");
+ Object returnObj = jp.proceed();
+ slot.setData(cmp.getNodeId(), StrUtil.format("{}_{}", slot.getData(cmp.getNodeId()), "after"));
+ return returnObj;
+ }
+}
diff --git a/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/cmp1/ACmp.java b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/cmp1/ACmp.java
new file mode 100644
index 000000000..7fd947163
--- /dev/null
+++ b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/cmp1/ACmp.java
@@ -0,0 +1,21 @@
+/**
+ * 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-springnative/src/test/java/com/yomahub/liteflow/test/aop/cmp1/BCmp.java b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/cmp1/BCmp.java
new file mode 100644
index 000000000..d99d2a1e6
--- /dev/null
+++ b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/cmp1/BCmp.java
@@ -0,0 +1,21 @@
+/**
+ * Title: liteflow
+ * Description: 轻量级的组件式流程框架
+ * @author Bryan.Zhang
+ * @email weenyc31@163.com
+ * @Date 2020/4/1
+ */
+package com.yomahub.liteflow.test.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-springnative/src/test/java/com/yomahub/liteflow/test/aop/cmp1/CCmp.java b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/cmp1/CCmp.java
new file mode 100644
index 000000000..7a2181438
--- /dev/null
+++ b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/cmp1/CCmp.java
@@ -0,0 +1,21 @@
+/**
+ * Title: liteflow
+ * Description: 轻量级的组件式流程框架
+ * @author Bryan.Zhang
+ * @email weenyc31@163.com
+ * @Date 2020/4/1
+ */
+package com.yomahub.liteflow.test.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-springnative/src/test/java/com/yomahub/liteflow/test/aop/cmp2/DCmp.java b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/cmp2/DCmp.java
new file mode 100644
index 000000000..eb8ae7648
--- /dev/null
+++ b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/cmp2/DCmp.java
@@ -0,0 +1,21 @@
+/**
+ * Title: liteflow
+ * Description: 轻量级的组件式流程框架
+ * @author Bryan.Zhang
+ * @email weenyc31@163.com
+ * @Date 2020/4/1
+ */
+package com.yomahub.liteflow.test.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-springnative/src/test/java/com/yomahub/liteflow/test/aop/cmp2/ECmp.java b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/cmp2/ECmp.java
new file mode 100644
index 000000000..ce0319d44
--- /dev/null
+++ b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/aop/cmp2/ECmp.java
@@ -0,0 +1,21 @@
+/**
+ * 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-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/AsyncNodeSpringTest.java b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/AsyncNodeSpringTest.java
new file mode 100644
index 000000000..48a059849
--- /dev/null
+++ b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/AsyncNodeSpringTest.java
@@ -0,0 +1,128 @@
+package com.yomahub.liteflow.test.asyncNode;
+
+import cn.hutool.core.collection.ListUtil;
+import com.yomahub.liteflow.core.FlowExecutor;
+import com.yomahub.liteflow.entity.data.DefaultSlot;
+import com.yomahub.liteflow.entity.data.LiteflowResponse;
+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.getSlot().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.getSlot().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遍,这里验证下
+ Integer count = response.getSlot().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遍,这里验证下
+ Integer count = response.getSlot().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遍
+ Integer count = response.getSlot().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
+ Integer count = response.getSlot().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");
+ Assert.assertTrue(response.isSuccess());
+ Assert.assertTrue(response.getSlot().getData("check").toString().startsWith("habc"));
+ }
+}
diff --git a/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ACmp.java b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ACmp.java
new file mode 100644
index 000000000..fc2973788
--- /dev/null
+++ b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ACmp.java
@@ -0,0 +1,24 @@
+package com.yomahub.liteflow.test.asyncNode.cmp;
+
+import com.yomahub.liteflow.core.NodeComponent;
+import com.yomahub.liteflow.entity.data.Slot;
+import org.springframework.stereotype.Component;
+
+
+@Component("a")
+public class ACmp extends NodeComponent {
+ @Override
+ public void process() {
+ Slot slot = this.getSlot();
+ synchronized (NodeComponent.class){
+ if (slot.hasData("check")){
+ String str = slot.getData("check");
+ str += this.getNodeId();
+ slot.setData("check", str);
+ }else{
+ slot.setData("check", this.getNodeId());
+ }
+ }
+ System.out.println("Acomp executed!");
+ }
+}
diff --git a/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/BCmp.java b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/BCmp.java
new file mode 100644
index 000000000..33739235e
--- /dev/null
+++ b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/BCmp.java
@@ -0,0 +1,24 @@
+package com.yomahub.liteflow.test.asyncNode.cmp;
+
+import com.yomahub.liteflow.core.NodeComponent;
+import com.yomahub.liteflow.entity.data.Slot;
+import org.springframework.stereotype.Component;
+
+
+@Component("b")
+public class BCmp extends NodeComponent {
+ @Override
+ public void process() {
+ Slot slot = this.getSlot();
+ synchronized (NodeComponent.class){
+ if (slot.hasData("check")){
+ String str = slot.getData("check");
+ str += this.getNodeId();
+ slot.setData("check", str);
+ }else{
+ slot.setData("check", this.getNodeId());
+ }
+ }
+ System.out.println("Bcomp executed!");
+ }
+}
diff --git a/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/CCmp.java b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/CCmp.java
new file mode 100644
index 000000000..c1f2427bf
--- /dev/null
+++ b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/CCmp.java
@@ -0,0 +1,24 @@
+package com.yomahub.liteflow.test.asyncNode.cmp;
+
+import com.yomahub.liteflow.core.NodeComponent;
+import com.yomahub.liteflow.entity.data.Slot;
+import org.springframework.stereotype.Component;
+
+
+@Component("c")
+public class CCmp extends NodeComponent {
+ @Override
+ public void process() throws Exception {
+ Slot slot = this.getSlot();
+ synchronized (NodeComponent.class){
+ if (slot.hasData("check")){
+ String str = slot.getData("check");
+ str += this.getNodeId();
+ slot.setData("check", str);
+ }else{
+ slot.setData("check", this.getNodeId());
+ }
+ }
+ System.out.println("Ccomp executed!");
+ }
+}
diff --git a/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/DCmp.java b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/DCmp.java
new file mode 100644
index 000000000..1d997d095
--- /dev/null
+++ b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/DCmp.java
@@ -0,0 +1,25 @@
+package com.yomahub.liteflow.test.asyncNode.cmp;
+
+import com.yomahub.liteflow.core.NodeComponent;
+import com.yomahub.liteflow.entity.data.Slot;
+import org.springframework.stereotype.Component;
+
+
+@Component("d")
+public class DCmp extends NodeComponent {
+ @Override
+ public void process() throws Exception {
+ Thread.sleep(1000);
+ Slot slot = this.getSlot();
+ synchronized (NodeComponent.class){
+ if (slot.hasData("check")){
+ String str = slot.getData("check");
+ str += this.getNodeId();
+ slot.setData("check", str);
+ }else{
+ slot.setData("check", this.getNodeId());
+ }
+ }
+ System.out.println("Dcomp executed!");
+ }
+}
diff --git a/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ECmp.java b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ECmp.java
new file mode 100644
index 000000000..19e9b27bf
--- /dev/null
+++ b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ECmp.java
@@ -0,0 +1,15 @@
+package com.yomahub.liteflow.test.asyncNode.cmp;
+
+import com.yomahub.liteflow.core.NodeCondComponent;
+import org.springframework.stereotype.Component;
+
+
+@Component("e")
+public class ECmp extends NodeCondComponent {
+
+ @Override
+ public String processCond() throws Exception {
+ System.out.println("Ecomp executed!");
+ return "g";
+ }
+}
diff --git a/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/FCmp.java b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/FCmp.java
new file mode 100644
index 000000000..eb9322c81
--- /dev/null
+++ b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/FCmp.java
@@ -0,0 +1,14 @@
+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-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/GCmp.java b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/GCmp.java
new file mode 100644
index 000000000..daceb656e
--- /dev/null
+++ b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/GCmp.java
@@ -0,0 +1,26 @@
+package com.yomahub.liteflow.test.asyncNode.cmp;
+
+import com.yomahub.liteflow.core.NodeComponent;
+import com.yomahub.liteflow.entity.data.Slot;
+import org.springframework.stereotype.Component;
+
+
+@Component("g")
+public class GCmp extends NodeComponent {
+
+ @Override
+ public void process() throws Exception {
+ Thread.sleep(500);
+ Slot slot = this.getSlot();
+ synchronized (NodeComponent.class){
+ if (slot.hasData("check")){
+ String str = slot.getData("check");
+ str += this.getNodeId();
+ slot.setData("check", str);
+ }else{
+ slot.setData("check", this.getNodeId());
+ }
+ }
+ System.out.println("Gcomp executed!");
+ }
+}
diff --git a/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/HCmp.java b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/HCmp.java
new file mode 100644
index 000000000..84479b2b6
--- /dev/null
+++ b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/HCmp.java
@@ -0,0 +1,26 @@
+package com.yomahub.liteflow.test.asyncNode.cmp;
+
+import com.yomahub.liteflow.core.NodeComponent;
+import com.yomahub.liteflow.entity.data.Slot;
+import org.springframework.stereotype.Component;
+
+
+@Component("h")
+public class HCmp extends NodeComponent {
+
+ @Override
+ public void process() throws Exception {
+ Slot slot = this.getSlot();
+ synchronized (NodeComponent.class){
+ if (slot.hasData("check")){
+ String str = slot.getData("check");
+ str += this.getNodeId();
+ slot.setData("check", str);
+ }else{
+ slot.setData("check", this.getNodeId());
+ }
+ }
+
+ System.out.println("Hcomp executed!");
+ }
+}
diff --git a/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ICmp.java b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ICmp.java
new file mode 100644
index 000000000..7526ad545
--- /dev/null
+++ b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ICmp.java
@@ -0,0 +1,24 @@
+package com.yomahub.liteflow.test.asyncNode.cmp;
+
+import com.yomahub.liteflow.core.NodeComponent;
+import com.yomahub.liteflow.entity.data.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 {
+ Slot slot = this.getSlot();
+ if (slot.hasData("count")){
+ Integer count = slot.getData("count");
+ slot.setData("count", ++count);
+ } else{
+ slot.setData("count", 1);
+ }
+ System.out.println("Icomp executed! throw Exception!");
+ throw new TestException();
+ }
+}
diff --git a/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/JCmp.java b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/JCmp.java
new file mode 100644
index 000000000..41d95782d
--- /dev/null
+++ b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/JCmp.java
@@ -0,0 +1,15 @@
+package com.yomahub.liteflow.test.asyncNode.cmp;
+
+import com.yomahub.liteflow.core.NodeCondComponent;
+import org.springframework.stereotype.Component;
+
+
+@Component("j")
+public class JCmp extends NodeCondComponent {
+
+ @Override
+ public String processCond() throws Exception {
+ System.out.println("Jcomp executed!");
+ return "chain3";
+ }
+}
diff --git a/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/base/BaseCommonSpringTest.java b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/base/BaseCommonSpringTest.java
new file mode 100644
index 000000000..931c29436
--- /dev/null
+++ b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/base/BaseCommonSpringTest.java
@@ -0,0 +1,28 @@
+package com.yomahub.liteflow.test.base;
+
+import com.yomahub.liteflow.core.FlowExecutor;
+import com.yomahub.liteflow.entity.data.DefaultSlot;
+import com.yomahub.liteflow.entity.data.LiteflowResponse;
+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.getSlot().getExecuteStepStr());
+ }
+}
diff --git a/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/base/cmp/ACmp.java b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/base/cmp/ACmp.java
new file mode 100644
index 000000000..c33792217
--- /dev/null
+++ b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/base/cmp/ACmp.java
@@ -0,0 +1,20 @@
+/**
+ * Title: liteflow
+ * Description: 轻量级的组件式流程框架
+ * @author Bryan.Zhang
+ * @email weenyc31@163.com
+ * @Date 2020/4/1
+ */
+package com.yomahub.liteflow.test.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-springnative/src/test/java/com/yomahub/liteflow/test/base/cmp/BCmp.java b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/base/cmp/BCmp.java
new file mode 100644
index 000000000..f537308c7
--- /dev/null
+++ b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/base/cmp/BCmp.java
@@ -0,0 +1,21 @@
+/**
+ * Title: liteflow
+ * Description: 轻量级的组件式流程框架
+ * @author Bryan.Zhang
+ * @email weenyc31@163.com
+ * @Date 2020/4/1
+ */
+package com.yomahub.liteflow.test.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-springnative/src/test/java/com/yomahub/liteflow/test/base/cmp/CCmp.java b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/base/cmp/CCmp.java
new file mode 100644
index 000000000..6b6f84b41
--- /dev/null
+++ b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/base/cmp/CCmp.java
@@ -0,0 +1,21 @@
+/**
+ * Title: liteflow
+ * Description: 轻量级的组件式流程框架
+ * @author Bryan.Zhang
+ * @email weenyc31@163.com
+ * @Date 2020/4/1
+ */
+package com.yomahub.liteflow.test.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-springnative/src/test/java/com/yomahub/liteflow/test/base/cmp/DCmp.java b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/base/cmp/DCmp.java
new file mode 100644
index 000000000..ab0317f69
--- /dev/null
+++ b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/base/cmp/DCmp.java
@@ -0,0 +1,21 @@
+/**
+ * Title: liteflow
+ * Description: 轻量级的组件式流程框架
+ * @author Bryan.Zhang
+ * @email weenyc31@163.com
+ * @Date 2020/4/1
+ */
+package com.yomahub.liteflow.test.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-springnative/src/test/java/com/yomahub/liteflow/test/config/LiteflowConfigNoSpringTest.java b/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/config/LiteflowConfigNoSpringTest.java
deleted file mode 100644
index b846f2b85..000000000
--- a/liteflow-testcase-springnative/src/test/java/com/yomahub/liteflow/test/config/LiteflowConfigNoSpringTest.java
+++ /dev/null
@@ -1,101 +0,0 @@
-package com.yomahub.liteflow.test.config;
-
-import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.entity.data.DefaultSlot;
-import com.yomahub.liteflow.entity.data.LiteflowResponse;
-import com.yomahub.liteflow.exception.ConfigErrorException;
-import com.yomahub.liteflow.property.LiteflowConfig;
-import com.yomahub.liteflow.test.BaseTest;
-import org.junit.Assert;
-import org.junit.Test;
-
-/**
- * 无spring环境下参数单元测试
- * @author zendwang
- * @since 2.5.0
- */
-public class LiteflowConfigNoSpringTest extends BaseTest {
-
- @Test(expected = ConfigErrorException.class)
- public void testNoConfig() {
- FlowExecutor executor = new FlowExecutor();
- executor.init();
- }
-
- @Test
- public void testConfig() {
- FlowExecutor executor = new FlowExecutor();
- LiteflowConfig config = new LiteflowConfig();
- config.setRuleSource("config/flow.json");
- executor.setLiteflowConfig(config);
- executor.init();
- LiteflowResponse response = executor.execute2Resp("chain1", "arg");
- Assert.assertTrue(response.isSuccess());
- 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(100, config.getWhenQueueLimit().longValue());
- }
-
- /**
- * rule source支持的通配符
- * 匹配的文件
- * config/nospringgroup0/flow0.xml
- * config/nospringgroup1/flow.xml
- */
- @Test
- public void testLocalXmlRuleSourcePatternMatch() {
- FlowExecutor executor = new FlowExecutor();
- LiteflowConfig config = new LiteflowConfig();
- config.setRuleSource("config/nospring*/flow*.xml");
- executor.setLiteflowConfig(config);
- executor.init();
- LiteflowResponse response0 = executor.execute2Resp("chain1", "arg");
- Assert.assertEquals("a==>b==>c", response0.getSlot().getExecuteStepStr());
-
- LiteflowResponse response1 = executor.execute2Resp("chain3", "arg");
- Assert.assertEquals("a==>c==>f==>g", response1.getSlot().getExecuteStepStr());
-
- }
-
- /**
- * rule source支持的通配符
- * 匹配的文件
- * config/nospringgroup0/flow0.json
- * config/nospringgroup1/flow0.json
- */
- @Test
- public void testLocalJsonRuleSourcePatternMatch() {
- FlowExecutor executor = new FlowExecutor();
- LiteflowConfig config = new LiteflowConfig();
- config.setRuleSource("config/nospring*/flow*.json");
- executor.setLiteflowConfig(config);
- executor.init();
- LiteflowResponse response0 = executor.execute2Resp("chain1", "arg");
- Assert.assertEquals("a==>b==>c", response0.getSlot().getExecuteStepStr());
- LiteflowResponse response1 = executor.execute2Resp("chain3", "arg");
- Assert.assertEquals("a==>c==>f==>g", response1.getSlot().getExecuteStepStr());
- }
-
- /**
- * rule source支持的通配符
- * 匹配的文件
- * config/nospringgroup0/flow0.yml
- * config/nospringgroup1/flow.yml
- */
- @Test
- public void testLocalYmlRuleSourcePatternMatch() {
- FlowExecutor executor = new FlowExecutor();
- LiteflowConfig config = new LiteflowConfig();
- config.setRuleSource("config/nospring*/flow*.yml");
- executor.setLiteflowConfig(config);
- executor.init();
- LiteflowResponse response0 = executor.execute2Resp("chain1", "arg");
- Assert.assertEquals("a==>b==>c", response0.getSlot().getExecuteStepStr());
- LiteflowResponse response = executor.execute2Resp("chain3", "arg");
- Assert.assertEquals("a==>c==>f==>g", response.getSlot().getExecuteStepStr());
- }
-}
diff --git a/liteflow-testcase-springnative/src/test/resources/absoluteConfigPath/application.xml b/liteflow-testcase-springnative/src/test/resources/absoluteConfigPath/application.xml
new file mode 100644
index 000000000..510b264ba
--- /dev/null
+++ b/liteflow-testcase-springnative/src/test/resources/absoluteConfigPath/application.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/liteflow-testcase-springnative/src/test/resources/aop/application-custom.xml b/liteflow-testcase-springnative/src/test/resources/aop/application-custom.xml
new file mode 100644
index 000000000..fd0cde74a
--- /dev/null
+++ b/liteflow-testcase-springnative/src/test/resources/aop/application-custom.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/liteflow-testcase-springnative/src/test/resources/aop/application-global.xml b/liteflow-testcase-springnative/src/test/resources/aop/application-global.xml
new file mode 100644
index 000000000..376b0c1ff
--- /dev/null
+++ b/liteflow-testcase-springnative/src/test/resources/aop/application-global.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/liteflow-testcase-springnative/src/test/resources/aop/flow.xml b/liteflow-testcase-springnative/src/test/resources/aop/flow.xml
new file mode 100644
index 000000000..fcbc8b715
--- /dev/null
+++ b/liteflow-testcase-springnative/src/test/resources/aop/flow.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/liteflow-testcase-springnative/src/test/resources/asyncNode/application.xml b/liteflow-testcase-springnative/src/test/resources/asyncNode/application.xml
new file mode 100644
index 000000000..92ff44d0c
--- /dev/null
+++ b/liteflow-testcase-springnative/src/test/resources/asyncNode/application.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/liteflow-testcase-springnative/src/test/resources/asyncNode/flow.xml b/liteflow-testcase-springnative/src/test/resources/asyncNode/flow.xml
new file mode 100644
index 000000000..e81546bb6
--- /dev/null
+++ b/liteflow-testcase-springnative/src/test/resources/asyncNode/flow.xml
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/liteflow-testcase-springnative/src/test/resources/base/application.xml b/liteflow-testcase-springnative/src/test/resources/base/application.xml
new file mode 100644
index 000000000..09fb4a8a2
--- /dev/null
+++ b/liteflow-testcase-springnative/src/test/resources/base/application.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/liteflow-testcase-springnative/src/test/resources/base/flow.xml b/liteflow-testcase-springnative/src/test/resources/base/flow.xml
new file mode 100644
index 000000000..7153add87
--- /dev/null
+++ b/liteflow-testcase-springnative/src/test/resources/base/flow.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/liteflow-testcase-springnative/src/test/resources/config/nospringgroup0/flow0.json b/liteflow-testcase-springnative/src/test/resources/config/nospringgroup0/flow0.json
deleted file mode 100644
index c3a7a8763..000000000
--- a/liteflow-testcase-springnative/src/test/resources/config/nospringgroup0/flow0.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-springnative/src/test/resources/config/nospringgroup0/flow0.xml b/liteflow-testcase-springnative/src/test/resources/config/nospringgroup0/flow0.xml
deleted file mode 100644
index ee5d47f24..000000000
--- a/liteflow-testcase-springnative/src/test/resources/config/nospringgroup0/flow0.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/liteflow-testcase-springnative/src/test/resources/config/nospringgroup0/flow0.yml b/liteflow-testcase-springnative/src/test/resources/config/nospringgroup0/flow0.yml
deleted file mode 100644
index 5424e94fd..000000000
--- a/liteflow-testcase-springnative/src/test/resources/config/nospringgroup0/flow0.yml
+++ /dev/null
@@ -1,14 +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'
diff --git a/liteflow-testcase-springnative/src/test/resources/config/nospringgroup1/flow.json b/liteflow-testcase-springnative/src/test/resources/config/nospringgroup1/flow.json
deleted file mode 100644
index 52dd794ad..000000000
--- a/liteflow-testcase-springnative/src/test/resources/config/nospringgroup1/flow.json
+++ /dev/null
@@ -1,32 +0,0 @@
-{
- "flow": {
- "nodes": {
- "node": [
- {
- "id": "d",
- "class": "com.yomahub.liteflow.test.config.cmp.DCmp"
- },
- {
- "id": "e",
- "class": "com.yomahub.liteflow.test.config.cmp.ECmp"
- },
- {
- "id": "f",
- "class": "com.yomahub.liteflow.test.config.cmp.FCmp"
- },
- {
- "id": "g",
- "class": "com.yomahub.liteflow.test.config.cmp.GCmp"
- }
- ]
- },
- "chain": [
- {
- "name": "chain3",
- "condition": [
- {"type": "then", "value": "a,c,f,g"}
- ]
- }
- ]
- }
-}
\ No newline at end of file
diff --git a/liteflow-testcase-springnative/src/test/resources/config/nospringgroup1/flow.xml b/liteflow-testcase-springnative/src/test/resources/config/nospringgroup1/flow.xml
deleted file mode 100644
index d3d2afbf3..000000000
--- a/liteflow-testcase-springnative/src/test/resources/config/nospringgroup1/flow.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/liteflow-testcase-springnative/src/test/resources/config/nospringgroup1/flow.yml b/liteflow-testcase-springnative/src/test/resources/config/nospringgroup1/flow.yml
deleted file mode 100644
index b6af2e455..000000000
--- a/liteflow-testcase-springnative/src/test/resources/config/nospringgroup1/flow.yml
+++ /dev/null
@@ -1,16 +0,0 @@
-flow:
- nodes:
- node:
- - id: d
- class: com.yomahub.liteflow.test.config.cmp.DCmp
- - id: e
- class: com.yomahub.liteflow.test.config.cmp.ECmp
- - id: f
- class: com.yomahub.liteflow.test.config.cmp.FCmp
- - id: g
- class: com.yomahub.liteflow.test.config.cmp.GCmp
- chain:
- - name: chain3
- condition:
- - type: then
- value: 'a,c,f,g'