瀏覽代碼

feature #I5CW7I 【版本特性】构造全新的EL规则表达式

everywhere.z 2 年之前
父節點
當前提交
0764214b7b
共有 100 個文件被更改,包括 3395 次插入0 次删除
  1. 60 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/pom.xml
  2. 23 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/BaseTest.java
  3. 41 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/AbsoluteConfigPathELDeclSpringbootTest.java
  4. 24 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/ACmp.java
  5. 25 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/BCmp.java
  6. 25 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/CCmp.java
  7. 41 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/CustomAOPELDeclSpringbootTest.java
  8. 79 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/GlobalAOPELDeclSpringbootTest.java
  9. 20 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/aspect/CmpAspect.java
  10. 28 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/aspect/CustomAspect.java
  11. 25 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp1/ACmp.java
  12. 25 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp1/BCmp.java
  13. 25 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp1/CCmp.java
  14. 25 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp2/DCmp.java
  15. 25 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp2/ECmp.java
  16. 25 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp2/FCmp.java
  17. 139 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/AsyncNodeELDeclSpringbootTest.java
  18. 29 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ACmp.java
  19. 29 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/BCmp.java
  20. 29 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/CCmp.java
  21. 30 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/DCmp.java
  22. 19 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ECmp.java
  23. 18 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/FCmp.java
  24. 31 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/GCmp.java
  25. 31 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/HCmp.java
  26. 29 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ICmp.java
  27. 19 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/JCmp.java
  28. 4 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/exception/TestException.java
  29. 38 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/base/BaseELDeclSpringbootTest.java
  30. 24 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/base/cmp/ACmp.java
  31. 25 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/base/cmp/BCmp.java
  32. 25 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/base/cmp/CCmp.java
  33. 31 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/base/cmp/DCmp.java
  34. 10 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/base/cmp/TestDomain.java
  35. 212 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/BuilderELDeclSpringbootTest1.java
  36. 41 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/BuilderELDeclSpringbootTest2.java
  37. 22 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/ACmp.java
  38. 23 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/BCmp.java
  39. 23 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/CCmp.java
  40. 23 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/DCmp.java
  41. 24 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/ECmp.java
  42. 23 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/FCmp.java
  43. 23 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/GCmp.java
  44. 25 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp2/HCmp.java
  45. 25 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp2/ICmp.java
  46. 25 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp2/JCmp.java
  47. 63 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/LiteflowRetryELDeclSpringbootTest.java
  48. 24 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/ACmp.java
  49. 31 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/BCmp.java
  50. 28 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/CCmp.java
  51. 28 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/DCmp.java
  52. 28 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/ECmp.java
  53. 51 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/CmpStepELDeclSpringbootTest.java
  54. 25 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/ACmp.java
  55. 25 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/BCmp.java
  56. 27 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/CCmp.java
  57. 26 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/DCmp.java
  58. 29 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/ECmp.java
  59. 93 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/FlowExecutorELDeclSpringbootTest.java
  60. 30 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/ACmp.java
  61. 33 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/BCmp.java
  62. 33 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/CCmp.java
  63. 30 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/DCmp.java
  64. 28 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/ECmp.java
  65. 30 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/GCmp.java
  66. 24 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/HCmp.java
  67. 26 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp2/FCondCmp.java
  68. 37 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/customMethodName/CustomMethodNameELDeclSpringbootTest.java
  69. 57 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/customMethodName/cmp/ACmp.java
  70. 25 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/customMethodName/cmp/BCmp.java
  71. 44 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/CustomNodesELDeclSpringbootTest.java
  72. 22 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/ACmp.java
  73. 29 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/BCmp.java
  74. 23 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/CCmp.java
  75. 23 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/DCmp.java
  76. 30 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/ECmp.java
  77. 23 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/FCmp.java
  78. 11 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/domain/DemoDomain.java
  79. 25 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor1.java
  80. 24 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor2.java
  81. 24 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor3.java
  82. 75 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomWhenThreadPoolELDeclSpringbootTest.java
  83. 24 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/ACmp.java
  84. 28 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/BCmp.java
  85. 28 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/CCmp.java
  86. 28 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/DCmp.java
  87. 28 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/ECmp.java
  88. 28 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/FCmp.java
  89. 64 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/event/EventELDeclSpringbootTest.java
  90. 35 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/event/cmp/ACmp.java
  91. 33 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/event/cmp/BCmp.java
  92. 33 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/event/cmp/CCmp.java
  93. 32 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/event/cmp/DCmp.java
  94. 33 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/event/cmp/ECmp.java
  95. 61 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/exception/Exception1ELDeclSpringBootTest.java
  96. 59 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/exception/Exception2ELDeclSpringBootTest.java
  97. 34 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/ACmp.java
  98. 39 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/BCmp.java
  99. 28 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/CCmp.java
  100. 31 0
      liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/DCmp.java

+ 60 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/pom.xml

@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>liteflow-testcase-el</artifactId>
+        <groupId>com.yomahub</groupId>
+        <version>2.8.0</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>liteflow-testcase-el-declare-springboot</artifactId>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.yomahub</groupId>
+            <artifactId>liteflow-spring-boot-starter</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.aspectj</groupId>
+            <artifactId>aspectjweaver</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.curator</groupId>
+            <artifactId>curator-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.101tec</groupId>
+            <artifactId>zkclient</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <version>${springboot.version}</version>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-deploy-plugin</artifactId>
+                <version>2.8.2</version>
+                <configuration>
+                    <skip>true</skip>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>

+ 23 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/BaseTest.java

@@ -0,0 +1,23 @@
+package com.yomahub.liteflow.test;
+
+import com.yomahub.liteflow.flow.FlowBus;
+import com.yomahub.liteflow.flow.id.IdGeneratorHelper;
+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();
+        IdGeneratorHelper.getInstance().clear();
+    }
+
+}

+ 41 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/AbsoluteConfigPathELDeclSpringbootTest.java

@@ -0,0 +1,41 @@
+package com.yomahub.liteflow.test.absoluteConfigPath;
+
+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.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 = AbsoluteConfigPathELDeclSpringbootTest.class)
+@EnableAutoConfiguration
+@ComponentScan({"com.yomahub.liteflow.test.absoluteConfigPath.cmp"})
+public class AbsoluteConfigPathELDeclSpringbootTest 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());
+    }
+}

+ 24 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/ACmp.java

@@ -0,0 +1,24 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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!");
+	}
+}

+ 25 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/BCmp.java

@@ -0,0 +1,25 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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!");
+	}
+
+}

+ 25 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/absoluteConfigPath/cmp/CCmp.java

@@ -0,0 +1,25 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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!");
+	}
+
+}

+ 41 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/CustomAOPELDeclSpringbootTest.java

@@ -0,0 +1,41 @@
+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 CustomAOPELDeclSpringbootTest 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"));
+    }*/
+}

+ 79 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/GlobalAOPELDeclSpringbootTest.java

@@ -0,0 +1,79 @@
+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 = GlobalAOPELDeclSpringbootTest.class)
+@EnableAutoConfiguration
+@Import(CmpAspect.class)
+@ComponentScan({"com.yomahub.liteflow.test.aop.cmp1","com.yomahub.liteflow.test.aop.cmp2"})
+public class GlobalAOPELDeclSpringbootTest 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;
+    }
+}

+ 20 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/aspect/CmpAspect.java

@@ -0,0 +1,20 @@
+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"));
+    }
+}

+ 28 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/aspect/CustomAspect.java

@@ -0,0 +1,28 @@
+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;
+    }
+}

+ 25 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp1/ACmp.java

@@ -0,0 +1,25 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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!");
+	}
+
+}

+ 25 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp1/BCmp.java

@@ -0,0 +1,25 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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!");
+	}
+
+}

+ 25 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp1/CCmp.java

@@ -0,0 +1,25 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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!");
+	}
+
+}

+ 25 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp2/DCmp.java

@@ -0,0 +1,25 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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!");
+	}
+
+}

+ 25 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp2/ECmp.java

@@ -0,0 +1,25 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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!");
+	}
+
+}

+ 25 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/aop/cmp2/FCmp.java

@@ -0,0 +1,25 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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");
+	}
+
+}

+ 139 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/AsyncNodeELDeclSpringbootTest.java

@@ -0,0 +1,139 @@
+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 = AsyncNodeELDeclSpringbootTest.class)
+@EnableAutoConfiguration
+@ComponentScan({"com.yomahub.liteflow.test.asyncNode.cmp"})
+public class AsyncNodeELDeclSpringbootTest 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"));
+    }
+}

+ 29 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ACmp.java

@@ -0,0 +1,29 @@
+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!");
+    }
+}

+ 29 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/BCmp.java

@@ -0,0 +1,29 @@
+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!");
+    }
+}

+ 29 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/CCmp.java

@@ -0,0 +1,29 @@
+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!");
+    }
+}

+ 30 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/DCmp.java

@@ -0,0 +1,30 @@
+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!");
+    }
+}

+ 19 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ECmp.java

@@ -0,0 +1,19 @@
+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_COND)
+    public String processCond(NodeComponent bindCmp) throws Exception {
+        System.out.println("Ecomp executed!");
+        return "g";
+    }
+}

+ 18 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/FCmp.java

@@ -0,0 +1,18 @@
+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!");
+    }
+}

+ 31 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/GCmp.java

@@ -0,0 +1,31 @@
+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!");
+    }
+}

+ 31 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/HCmp.java

@@ -0,0 +1,31 @@
+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!");
+    }
+}

+ 29 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/ICmp.java

@@ -0,0 +1,29 @@
+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();
+        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();
+    }
+}

+ 19 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/cmp/JCmp.java

@@ -0,0 +1,19 @@
+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_COND)
+    public String processCond(NodeComponent bindCmp) throws Exception {
+        System.out.println("Jcomp executed!");
+        return "chain3";
+    }
+}

+ 4 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/asyncNode/exception/TestException.java

@@ -0,0 +1,4 @@
+package com.yomahub.liteflow.test.asyncNode.exception;
+
+public class TestException extends Exception{
+}

+ 38 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/base/BaseELDeclSpringbootTest.java

@@ -0,0 +1,38 @@
+package com.yomahub.liteflow.test.base;
+
+import com.yomahub.liteflow.core.FlowExecutor;
+import com.yomahub.liteflow.flow.LiteflowResponse;
+import com.yomahub.liteflow.test.BaseTest;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.test.context.TestPropertySource;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import javax.annotation.Resource;
+
+/**
+ * springboot环境最普通的例子测试
+ * @author Bryan.Zhang
+ * @since 2.6.4
+ */
+@RunWith(SpringRunner.class)
+@TestPropertySource(value = "classpath:/base/application.properties")
+@SpringBootTest(classes = BaseELDeclSpringbootTest.class)
+@EnableAutoConfiguration
+@ComponentScan({"com.yomahub.liteflow.test.base.cmp"})
+public class BaseELDeclSpringbootTest extends BaseTest {
+
+    @Resource
+    private FlowExecutor flowExecutor;
+
+    @Test
+    public void testBase() throws Exception{
+        LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg");
+        Assert.assertTrue(response.isSuccess());
+    }
+
+}

+ 24 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/base/cmp/ACmp.java

@@ -0,0 +1,24 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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!");
+	}
+}

+ 25 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/base/cmp/BCmp.java

@@ -0,0 +1,25 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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!");
+	}
+
+}

+ 25 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/base/cmp/CCmp.java

@@ -0,0 +1,25 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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!");
+	}
+
+}

+ 31 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/base/cmp/DCmp.java

@@ -0,0 +1,31 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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!");
+	}
+
+}

+ 10 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/base/cmp/TestDomain.java

@@ -0,0 +1,10 @@
+package com.yomahub.liteflow.test.base.cmp;
+
+import org.springframework.stereotype.Component;
+
+@Component
+public class TestDomain {
+    public void sayHi(){
+        System.out.println("hello");
+    }
+}

+ 212 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/BuilderELDeclSpringbootTest1.java

@@ -0,0 +1,212 @@
+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.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.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 = BuilderELDeclSpringbootTest1.class)
+@EnableAutoConfiguration
+public class BuilderELDeclSpringbootTest1 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();
+
+
+        LiteFlowChainELBuilder.createChain().setChainName("chain2").setEL(
+                "THEN(c, d)"
+        ).build();
+
+        LiteFlowChainELBuilder.createChain().setChainName("chain1").setEL(
+                "THEN(a, b, WHEN(SWITCH(e).to(f, g, chain2)))"
+        ).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());
+    }
+}

+ 41 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/BuilderELDeclSpringbootTest2.java

@@ -0,0 +1,41 @@
+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;
+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 = BuilderELDeclSpringbootTest2.class)
+@EnableAutoConfiguration
+@ComponentScan({"com.yomahub.liteflow.test.builder.cmp2"})
+public class BuilderELDeclSpringbootTest2 extends BaseTest {
+
+    @Resource
+    private FlowExecutor flowExecutor;
+
+    //通过spring去扫描组件,通过代码去构建chain
+    @Test
+    public void testBuilder() throws Exception {
+        LiteFlowChainELBuilder.createChain().setChainName("chain1").setEL(
+                "THEN(h, i, j)"
+        ).build();
+
+        LiteflowResponse response = flowExecutor.execute2Resp("chain1");
+        Assert.assertTrue(response.isSuccess());
+        Assert.assertEquals("h==>i==>j", response.getExecuteStepStr());
+    }
+}

+ 22 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/ACmp.java

@@ -0,0 +1,22 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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!");
+	}
+}

+ 23 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/BCmp.java

@@ -0,0 +1,23 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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!");
+	}
+
+}

+ 23 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/CCmp.java

@@ -0,0 +1,23 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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!");
+	}
+
+}

+ 23 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/DCmp.java

@@ -0,0 +1,23 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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!");
+	}
+
+}

+ 24 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/ECmp.java

@@ -0,0 +1,24 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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_COND)
+	public String processCond(NodeComponent bindCmp) throws Exception {
+		System.out.println("ECmp executed!");
+		return "chain2";
+	}
+
+}

+ 23 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/FCmp.java

@@ -0,0 +1,23 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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!");
+	}
+
+}

+ 23 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp1/GCmp.java

@@ -0,0 +1,23 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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!");
+	}
+
+}

+ 25 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp2/HCmp.java

@@ -0,0 +1,25 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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!");
+	}
+
+}

+ 25 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp2/ICmp.java

@@ -0,0 +1,25 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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!");
+	}
+
+}

+ 25 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/builder/cmp2/JCmp.java

@@ -0,0 +1,25 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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!");
+	}
+
+}

+ 63 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/LiteflowRetryELDeclSpringbootTest.java

@@ -0,0 +1,63 @@
+package com.yomahub.liteflow.test.cmpRetry;
+
+import com.yomahub.liteflow.core.FlowExecutor;
+import com.yomahub.liteflow.flow.LiteflowResponse;
+import com.yomahub.liteflow.test.BaseTest;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.test.context.TestPropertySource;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import javax.annotation.Resource;
+
+
+/**
+ * 测试springboot下的节点执行器
+ * @author Bryan.Zhang
+ * @since 2.5.10
+ */
+@RunWith(SpringRunner.class)
+@TestPropertySource(value = "classpath:/cmpRetry/application.properties")
+@SpringBootTest(classes = LiteflowRetryELDeclSpringbootTest.class)
+@EnableAutoConfiguration
+@ComponentScan({"com.yomahub.liteflow.test.cmpRetry.cmp"})
+public class LiteflowRetryELDeclSpringbootTest 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());
+    }
+}

+ 24 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/ACmp.java

@@ -0,0 +1,24 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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!");
+	}
+}

+ 31 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/BCmp.java

@@ -0,0 +1,31 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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");
+		}
+	}
+
+}

+ 28 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/CCmp.java

@@ -0,0 +1,28 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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");
+	}
+
+}

+ 28 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/DCmp.java

@@ -0,0 +1,28 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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");
+	}
+
+}

+ 28 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpRetry/cmp/ECmp.java

@@ -0,0 +1,28 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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");
+	}
+
+}

+ 51 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/CmpStepELDeclSpringbootTest.java

@@ -0,0 +1,51 @@
+package com.yomahub.liteflow.test.cmpStep;
+
+import com.yomahub.liteflow.core.FlowExecutor;
+import com.yomahub.liteflow.flow.LiteflowResponse;
+import com.yomahub.liteflow.test.BaseTest;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.test.context.TestPropertySource;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import javax.annotation.Resource;
+
+/**
+ * springboot环境最普通的例子测试
+ * @author Bryan.Zhang
+ * @since 2.6.4
+ */
+@RunWith(SpringRunner.class)
+@TestPropertySource(value = "classpath:/cmpStep/application.properties")
+@SpringBootTest(classes = CmpStepELDeclSpringbootTest.class)
+@EnableAutoConfiguration
+@ComponentScan({"com.yomahub.liteflow.test.cmpStep.cmp"})
+public class CmpStepELDeclSpringbootTest 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());
+    }
+}

+ 25 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/ACmp.java

@@ -0,0 +1,25 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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!");
+	}
+}

+ 25 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/BCmp.java

@@ -0,0 +1,25 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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!");
+	}
+
+}

+ 27 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/CCmp.java

@@ -0,0 +1,27 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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");
+	}
+
+}

+ 26 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/DCmp.java

@@ -0,0 +1,26 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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");
+	}
+
+}

+ 29 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/cmpStep/cmp/ECmp.java

@@ -0,0 +1,29 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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;
+	}
+}

+ 93 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/FlowExecutorELDeclSpringbootTest.java

@@ -0,0 +1,93 @@
+package com.yomahub.liteflow.test.component;
+
+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.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 = FlowExecutorELDeclSpringbootTest.class)
+@EnableAutoConfiguration
+@ComponentScan({"com.yomahub.liteflow.test.component.cmp1","com.yomahub.liteflow.test.component.cmp2"})
+public class FlowExecutorELDeclSpringbootTest extends BaseTest {
+    private static final Logger LOG = LoggerFactory.getLogger(FlowExecutorELDeclSpringbootTest.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());
+    }
+
+}

+ 30 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/ACmp.java

@@ -0,0 +1,30 @@
+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;
+    }
+}

+ 33 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/BCmp.java

@@ -0,0 +1,33 @@
+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;
+    }
+
+}

+ 33 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/CCmp.java

@@ -0,0 +1,33 @@
+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;
+    }
+}

+ 30 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/DCmp.java

@@ -0,0 +1,30 @@
+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;
+    }
+}

+ 28 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/ECmp.java

@@ -0,0 +1,28 @@
+package com.yomahub.liteflow.test.component.cmp1;
+
+import com.alibaba.fastjson.JSON;
+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("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=" + JSON.toJSONString(responseData));
+    }
+}

+ 30 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/GCmp.java

@@ -0,0 +1,30 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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;
+	}
+}

+ 24 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp1/HCmp.java

@@ -0,0 +1,24 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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!");
+	}
+}

+ 26 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/component/cmp2/FCondCmp.java

@@ -0,0 +1,26 @@
+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_COND)
+    public String processCond(NodeComponent bindCmp) {
+        Integer requestData = bindCmp.getRequestData();
+        if (Objects.isNull(requestData)){
+            return "d";
+        } else if(requestData == 0){
+            return "c";
+        } else {
+            return "b";
+        }
+    }
+}

+ 37 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/customMethodName/CustomMethodNameELDeclSpringbootTest.java

@@ -0,0 +1,37 @@
+package com.yomahub.liteflow.test.customMethodName;
+
+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 Bryan.Zhang
+ * @since 2.7.2
+ */
+@RunWith(SpringRunner.class)
+@TestPropertySource(value = "classpath:/customMethodName/application.properties")
+@SpringBootTest(classes = CustomMethodNameELDeclSpringbootTest.class)
+@EnableAutoConfiguration
+@ComponentScan({"com.yomahub.liteflow.test.customMethodName.cmp"})
+public class CustomMethodNameELDeclSpringbootTest extends BaseTest {
+
+    @Resource
+    private FlowExecutor flowExecutor;
+
+    @Test
+    public void testCustomMethodName() throws Exception{
+        LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg");
+        Assert.assertTrue(response.isSuccess());
+    }
+}

+ 57 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/customMethodName/cmp/ACmp.java

@@ -0,0 +1,57 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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;
+	}
+}

+ 25 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/customMethodName/cmp/BCmp.java

@@ -0,0 +1,25 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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!");
+	}
+
+}

+ 44 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/CustomNodesELDeclSpringbootTest.java

@@ -0,0 +1,44 @@
+package com.yomahub.liteflow.test.customNodes;
+
+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.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 = CustomNodesELDeclSpringbootTest.class)
+@EnableAutoConfiguration
+@ComponentScan({"com.yomahub.liteflow.test.customNodes.domain"})
+public class CustomNodesELDeclSpringbootTest 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());
+    }
+}

+ 22 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/ACmp.java

@@ -0,0 +1,22 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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!");
+	}
+}

+ 29 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/BCmp.java

@@ -0,0 +1,29 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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!");
+	}
+}

+ 23 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/CCmp.java

@@ -0,0 +1,23 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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!");
+	}
+
+}

+ 23 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/DCmp.java

@@ -0,0 +1,23 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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!");
+	}
+
+}

+ 30 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/ECmp.java

@@ -0,0 +1,30 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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!");
+	}
+
+}

+ 23 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/cmp/FCmp.java

@@ -0,0 +1,23 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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!");
+	}
+
+}

+ 11 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/customNodes/domain/DemoDomain.java

@@ -0,0 +1,11 @@
+package com.yomahub.liteflow.test.customNodes.domain;
+
+import org.springframework.stereotype.Component;
+
+@Component
+public class DemoDomain {
+
+    public void sayHi(){
+        System.out.println("hi");
+    }
+}

+ 25 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor1.java

@@ -0,0 +1,25 @@
+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-");
+    }
+}

+ 24 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor2.java

@@ -0,0 +1,24 @@
+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-");
+    }
+}

+ 24 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomThreadExecutor3.java

@@ -0,0 +1,24 @@
+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-");
+    }
+}

+ 75 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/CustomWhenThreadPoolELDeclSpringbootTest.java

@@ -0,0 +1,75 @@
+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 = CustomWhenThreadPoolELDeclSpringbootTest.class)
+@EnableAutoConfiguration
+@ComponentScan({"com.yomahub.liteflow.test.customWhenThreadPool.cmp"})
+public class CustomWhenThreadPoolELDeclSpringbootTest 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"));
+
+    }
+}

+ 24 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/ACmp.java

@@ -0,0 +1,24 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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!");
+	}
+}

+ 28 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/BCmp.java

@@ -0,0 +1,28 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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!");
+	}
+
+}

+ 28 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/CCmp.java

@@ -0,0 +1,28 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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!");
+	}
+
+}

+ 28 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/DCmp.java

@@ -0,0 +1,28 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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!");
+	}
+
+}

+ 28 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/ECmp.java

@@ -0,0 +1,28 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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!");
+	}
+
+}

+ 28 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/customWhenThreadPool/cmp/FCmp.java

@@ -0,0 +1,28 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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!");
+	}
+
+}

+ 64 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/event/EventELDeclSpringbootTest.java

@@ -0,0 +1,64 @@
+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 = EventELDeclSpringbootTest.class)
+@EnableAutoConfiguration
+@ComponentScan({"com.yomahub.liteflow.test.event.cmp"})
+public class EventELDeclSpringbootTest 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"));
+    }
+
+}

+ 35 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/event/cmp/ACmp.java

@@ -0,0 +1,35 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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);
+	}
+}

+ 33 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/event/cmp/BCmp.java

@@ -0,0 +1,33 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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);
+	}
+}

+ 33 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/event/cmp/CCmp.java

@@ -0,0 +1,33 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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);
+	}
+}

+ 32 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/event/cmp/DCmp.java

@@ -0,0 +1,32 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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());
+	}
+}

+ 33 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/event/cmp/ECmp.java

@@ -0,0 +1,33 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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("错误事件回调本身抛出异常");
+	}
+}

+ 61 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/exception/Exception1ELDeclSpringBootTest.java

@@ -0,0 +1,61 @@
+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 = Exception1ELDeclSpringBootTest.class)
+@EnableAutoConfiguration
+public class Exception1ELDeclSpringBootTest extends BaseTest {
+
+    @Resource
+    private FlowExecutor flowExecutor;
+
+    /**
+     * 验证 chain 节点重复的异常
+     */
+    @Test(expected = ChainDuplicateException.class)
+    public void testChainDuplicateException() {
+        LiteflowConfig config = LiteflowConfigGetter.get();
+        config.setRuleSource("exception/flow-exception.el.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();
+    }
+
+    @Test(expected = FlowExecutorNotInitException.class)
+    public void testNoConditionInChainException() throws Exception {
+        LiteflowConfig config = LiteflowConfigGetter.get();
+        config.setRuleSource("exception/flow-blank.el.xml");
+        flowExecutor.init();
+    }
+}

+ 59 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/exception/Exception2ELDeclSpringBootTest.java

@@ -0,0 +1,59 @@
+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.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 org.springframework.util.ReflectionUtils;
+
+import javax.annotation.Resource;
+
+/**
+ * 流程执行异常
+ * 单元测试
+ *
+ * @author zendwang
+ */
+@RunWith(SpringRunner.class)
+@TestPropertySource(value = "classpath:/exception/application.properties")
+@SpringBootTest(classes = Exception2ELDeclSpringBootTest.class)
+@EnableAutoConfiguration
+@ComponentScan({"com.yomahub.liteflow.test.exception.cmp"})
+public class Exception2ELDeclSpringBootTest 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
+    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();
+    }
+}

+ 34 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/ACmp.java

@@ -0,0 +1,34 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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!");
+	}
+
+}

+ 39 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/BCmp.java

@@ -0,0 +1,39 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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!");
+	}
+}

+ 28 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/CCmp.java

@@ -0,0 +1,28 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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!");
+	}
+}

+ 31 - 0
liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/exception/cmp/DCmp.java

@@ -0,0 +1,31 @@
+/**
+ * <p>Title: liteflow</p>
+ * <p>Description: 轻量级的组件式流程框架</p>
+ * @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!");
+	}
+}

Some files were not shown because too many files changed in this diff