diff --git a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/fallback/FallbackELDeclSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/fallback/FallbackELDeclSpringbootTest.java deleted file mode 100644 index 2f9f592e..00000000 --- a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/fallback/FallbackELDeclSpringbootTest.java +++ /dev/null @@ -1,225 +0,0 @@ -package com.yomahub.liteflow.test.fallback; - -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -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 javax.annotation.Resource; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.Future; - -/** - * SpringBoot 降级组件测试 - * - * @author DaleLee - * @since 2.11.1 - */ -@TestPropertySource(value = "classpath:/fallback/application.properties") -@SpringBootTest(classes = FallbackELDeclSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.fallback.cmp"}) -public class FallbackELDeclSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testThen1() { - LiteflowResponse response = flowExecutor.execute2Resp("then1", "arg"); - Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("a==>c", response.getExecuteStepStrWithoutTime()); - } - - @Test - public void testThen2() { - LiteflowResponse response = flowExecutor.execute2Resp("then2", "arg"); - Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("c==>c==>c", response.getExecuteStepStrWithoutTime()); - } - - @Test - public void testWhen1() { - LiteflowResponse response = flowExecutor.execute2Resp("when1", "arg"); - Assertions.assertTrue(response.isSuccess()); - String executeStepStr = response.getExecuteStepStrWithoutTime(); - Assertions.assertTrue("b==>c".equals(executeStepStr) || "c==>b".equals(executeStepStr)); - } - - @Test - public void testIf1() { - LiteflowResponse response = flowExecutor.execute2Resp("if1", "arg"); - Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("ifn2", response.getExecuteStepStrWithoutTime()); - } - - @Test - public void testIf2() { - LiteflowResponse response = flowExecutor.execute2Resp("if2", "arg"); - Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("ifn1==>c", response.getExecuteStepStrWithoutTime()); - } - - @Test - public void testFor1() { - LiteflowResponse response = flowExecutor.execute2Resp("for1", "arg"); - Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("for1==>a==>a==>a", response.getExecuteStepStrWithoutTime()); - } - - @Test - public void testFor2() { - LiteflowResponse response = flowExecutor.execute2Resp("for2", "arg"); - Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("LOOP_3==>c==>c==>c", response.getExecuteStepStrWithoutTime()); - } - - @Test - public void testWhile1() { - LiteflowResponse response = flowExecutor.execute2Resp("while1", "arg"); - Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("wn2", response.getExecuteStepStrWithoutTime()); - } - - @Test - public void testWhile2() { - LiteflowResponse response = flowExecutor.execute2Resp("while2", "arg"); - Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("wn1==>c==>wn1==>c==>wn1==>c==>wn1", response.getExecuteStepStrWithoutTime()); - } - - @Test - public void testIterator1() { - LiteflowResponse response = flowExecutor.execute2Resp("iterator1", "arg"); - Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("itn2", response.getExecuteStepStrWithoutTime()); - } - - @Test - public void testIterator2() { - LiteflowResponse response = flowExecutor.execute2Resp("iterator2", "arg"); - Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("itn1==>c==>c==>c", response.getExecuteStepStrWithoutTime()); - } - - @Test - public void testBreak1() { - LiteflowResponse response = flowExecutor.execute2Resp("break1", "arg"); - Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("LOOP_3==>a==>bn1", response.getExecuteStepStrWithoutTime()); - } - - @Test - public void testBreak2() { - LiteflowResponse response = flowExecutor.execute2Resp("break2", "arg"); - Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("wn1==>a==>bn1", response.getExecuteStepStrWithoutTime()); - } - - @Test - public void testBreak3() { - LiteflowResponse response = flowExecutor.execute2Resp("break3", "arg"); - Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("itn1==>a==>bn1", response.getExecuteStepStrWithoutTime()); - } - - @Test - public void testSwitch1() { - LiteflowResponse response = flowExecutor.execute2Resp("switch1", "arg"); - Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("swn2==>b", response.getExecuteStepStrWithoutTime()); - } - - @Test - public void testSwitch2() { - LiteflowResponse response = flowExecutor.execute2Resp("switch2", "arg"); - Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("swn1==>a", response.getExecuteStepStrWithoutTime()); - } - - @Test - public void testAnd1() { - LiteflowResponse response = flowExecutor.execute2Resp("and1", "arg"); - Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("ifn2", response.getExecuteStepStrWithoutTime()); - } - - @Test - public void testOr1() { - LiteflowResponse response = flowExecutor.execute2Resp("or1", "arg"); - Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("ifn2==>ifn1==>a", response.getExecuteStepStrWithoutTime()); - } - - @Test - public void testNot1() { - LiteflowResponse response = flowExecutor.execute2Resp("not1", "arg"); - Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("ifn2==>a", response.getExecuteStepStrWithoutTime()); - } - - @Test - public void testCatch1() { - LiteflowResponse response = flowExecutor.execute2Resp("catch1", "arg"); - Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("a==>d==>c", response.getExecuteStepStrWithoutTime()); - } - - @Test - public void testMulti1() { - LiteflowResponse response = flowExecutor.execute2Resp("multi1", "arg"); - Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("a==>c==>ifn2", response.getExecuteStepStrWithoutTime()); - } - - @Test - public void testMulti2() { - LiteflowResponse response = flowExecutor.execute2Resp("multi2", "arg"); - Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("ifn2==>ifn1==>a==>c", response.getExecuteStepStrWithoutTime()); - } - - @Test - public void testMulti3() { - LiteflowResponse response = flowExecutor.execute2Resp("multi3", "arg"); - Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("for1==>b==>c==>b==>c==>b==>c", response.getExecuteStepStrWithoutTime()); - } - - @Test - public void testConcurrent1() { - LiteflowResponse response = flowExecutor.execute2Resp("concurrent1", "arg"); - Assertions.assertTrue(response.isSuccess()); - String stepStr = response.getExecuteStepStrWithoutTime(); - Assertions.assertTrue("c==>ifn2".equals(stepStr) || "ifn2==>c".equals(stepStr)); - } - - @Test - public void testConcurrent2() { - LiteflowResponse response = flowExecutor.execute2Resp("concurrent2", "arg"); - Assertions.assertTrue(response.isSuccess()); - String stepStr = response.getExecuteStepStrWithoutTime(); - Assertions.assertTrue("c==>ifn2".equals(stepStr) || "ifn2==>c".equals(stepStr)); - } - - @Test - public void testConcurrent3() throws ExecutionException, InterruptedException { - // 执行多条 chain - Future future1 = flowExecutor.execute2Future("concurrent1", "arg", new Object()); - Future future2 = flowExecutor.execute2Future("concurrent2", "arg", new Object()); - Thread.sleep(1000); - LiteflowResponse response1 = future1.get(); - LiteflowResponse response2 = future2.get(); - Assertions.assertTrue(response1.isSuccess()); - String stepStr1 = response1.getExecuteStepStrWithoutTime(); - Assertions.assertTrue("c==>ifn2".equals(stepStr1) || "ifn2==>c".equals(stepStr1)); - Assertions.assertTrue(response2.isSuccess()); - String stepStr2 = response2.getExecuteStepStrWithoutTime(); - Assertions.assertTrue("c==>ifn2".equals(stepStr2) || "ifn2==>c".equals(stepStr2)); - } -} diff --git a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/fallback/cmp/ACmp.java b/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/fallback/cmp/ACmp.java deleted file mode 100644 index 913035fd..00000000 --- a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/fallback/cmp/ACmp.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.yomahub.liteflow.test.fallback.cmp; - -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") -public class ACmp { - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("ACmp executed!"); - } - -} diff --git a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/fallback/cmp/BCmp.java b/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/fallback/cmp/BCmp.java deleted file mode 100644 index af597c5b..00000000 --- a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/fallback/cmp/BCmp.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.yomahub.liteflow.test.fallback.cmp; - -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") -public class BCmp { - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/fallback/cmp/BreakCmp.java b/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/fallback/cmp/BreakCmp.java deleted file mode 100644 index 7a733678..00000000 --- a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/fallback/cmp/BreakCmp.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.yomahub.liteflow.test.fallback.cmp; - -import com.yomahub.liteflow.annotation.FallbackCmp; -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import com.yomahub.liteflow.enums.NodeTypeEnum; - -@LiteflowComponent("bn1") -@LiteflowCmpDefine(NodeTypeEnum.BOOLEAN) -@FallbackCmp -public class BreakCmp { - - @LiteflowMethod(value = LiteFlowMethodEnum.PROCESS_BOOLEAN) - public boolean processBreak(NodeComponent bindCmp) throws Exception { - return true; - } -} diff --git a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/fallback/cmp/CCmp.java b/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/fallback/cmp/CCmp.java deleted file mode 100644 index e74168e3..00000000 --- a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/fallback/cmp/CCmp.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.yomahub.liteflow.test.fallback.cmp; - -import com.yomahub.liteflow.annotation.FallbackCmp; -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; - -@LiteflowComponent("c") -@FallbackCmp -public class CCmp { - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/fallback/cmp/DCmp.java b/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/fallback/cmp/DCmp.java deleted file mode 100644 index 23107e65..00000000 --- a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/fallback/cmp/DCmp.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.yomahub.liteflow.test.fallback.cmp; - -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; - -@LiteflowComponent("d") -public class DCmp { - - @LiteflowMethod(LiteFlowMethodEnum.PROCESS) - public void process(NodeComponent bindCmp) throws Exception { - throw new RuntimeException("component[d]"); - } -} diff --git a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/fallback/cmp/ForCmp.java b/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/fallback/cmp/ForCmp.java deleted file mode 100644 index 99596035..00000000 --- a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/fallback/cmp/ForCmp.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.yomahub.liteflow.test.fallback.cmp; - -import com.yomahub.liteflow.annotation.FallbackCmp; -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import com.yomahub.liteflow.enums.NodeTypeEnum; - -@LiteflowComponent("for1") -@LiteflowCmpDefine(NodeTypeEnum.FOR) -@FallbackCmp -public class ForCmp { - - @LiteflowMethod(value = LiteFlowMethodEnum.PROCESS_FOR) - public int processFor(NodeComponent bindCmp) throws Exception { - return 3; - } -} diff --git a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/fallback/cmp/IfCmp1.java b/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/fallback/cmp/IfCmp1.java deleted file mode 100644 index 5899ae0e..00000000 --- a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/fallback/cmp/IfCmp1.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.yomahub.liteflow.test.fallback.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; -import com.yomahub.liteflow.enums.NodeTypeEnum; - -@LiteflowComponent("ifn1") -@LiteflowCmpDefine(NodeTypeEnum.BOOLEAN) -public class IfCmp1 { - - @LiteflowMethod(value = LiteFlowMethodEnum.PROCESS_BOOLEAN) - public boolean processIf(NodeComponent bindCmp) throws Exception { - return true; - } -} diff --git a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/fallback/cmp/IfCmp2.java b/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/fallback/cmp/IfCmp2.java deleted file mode 100644 index f8b2cef8..00000000 --- a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/fallback/cmp/IfCmp2.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.yomahub.liteflow.test.fallback.cmp; - -import com.yomahub.liteflow.annotation.FallbackCmp; -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import com.yomahub.liteflow.enums.NodeTypeEnum; - -@LiteflowComponent("ifn2") -@LiteflowCmpDefine(NodeTypeEnum.BOOLEAN) -@FallbackCmp -public class IfCmp2 { - - @LiteflowMethod(value = LiteFlowMethodEnum.PROCESS_BOOLEAN) - public boolean processIf(NodeComponent bindCmp) throws Exception { - return false; - } -} diff --git a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/fallback/cmp/IteratorCmp1.java b/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/fallback/cmp/IteratorCmp1.java deleted file mode 100644 index 1ee36ed1..00000000 --- a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/fallback/cmp/IteratorCmp1.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.yomahub.liteflow.test.fallback.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; -import com.yomahub.liteflow.enums.NodeTypeEnum; - -import java.util.Arrays; -import java.util.Iterator; - -@LiteflowComponent("itn1") -@LiteflowCmpDefine(NodeTypeEnum.ITERATOR) -public class IteratorCmp1 { - - @LiteflowMethod(value = LiteFlowMethodEnum.PROCESS_ITERATOR) - public Iterator processIterator(NodeComponent bindCmp) throws Exception { - return Arrays.asList("a", "b", "c").iterator(); - } -} diff --git a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/fallback/cmp/IteratorCmp2.java b/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/fallback/cmp/IteratorCmp2.java deleted file mode 100644 index eab745bb..00000000 --- a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/fallback/cmp/IteratorCmp2.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.yomahub.liteflow.test.fallback.cmp; - -import com.yomahub.liteflow.annotation.FallbackCmp; -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import com.yomahub.liteflow.enums.NodeTypeEnum; - -import java.util.Collections; -import java.util.Iterator; - -@LiteflowComponent("itn2") -@LiteflowCmpDefine(NodeTypeEnum.ITERATOR) -@FallbackCmp -public class IteratorCmp2 { - - @LiteflowMethod(value = LiteFlowMethodEnum.PROCESS_ITERATOR) - public Iterator processIterator(NodeComponent bindCmp) throws Exception { - return Collections.emptyIterator(); - } -} diff --git a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/fallback/cmp/SwitchCmp1.java b/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/fallback/cmp/SwitchCmp1.java deleted file mode 100644 index 46948f73..00000000 --- a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/fallback/cmp/SwitchCmp1.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.yomahub.liteflow.test.fallback.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; -import com.yomahub.liteflow.enums.NodeTypeEnum; - -@LiteflowComponent("swn1") -@LiteflowCmpDefine(NodeTypeEnum.SWITCH) -public class SwitchCmp1 { - - @LiteflowMethod(value = LiteFlowMethodEnum.PROCESS_SWITCH) - public String processSwitch(NodeComponent bindCmp) throws Exception { - return "a"; - } -} diff --git a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/fallback/cmp/SwitchCmp2.java b/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/fallback/cmp/SwitchCmp2.java deleted file mode 100644 index 7da7c710..00000000 --- a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/fallback/cmp/SwitchCmp2.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.yomahub.liteflow.test.fallback.cmp; - -import com.yomahub.liteflow.annotation.FallbackCmp; -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import com.yomahub.liteflow.enums.NodeTypeEnum; - -@LiteflowComponent("swn2") -@LiteflowCmpDefine(NodeTypeEnum.SWITCH) -@FallbackCmp -public class SwitchCmp2 { - - @LiteflowMethod(value = LiteFlowMethodEnum.PROCESS_SWITCH) - public String processSwitch(NodeComponent bindCmp) throws Exception { - return "b"; - } -} diff --git a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/fallback/cmp/WhileCmp1.java b/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/fallback/cmp/WhileCmp1.java deleted file mode 100644 index 8f030ec7..00000000 --- a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/fallback/cmp/WhileCmp1.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.yomahub.liteflow.test.fallback.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; -import com.yomahub.liteflow.enums.NodeTypeEnum; - -import java.util.HashSet; -import java.util.Set; - -@LiteflowComponent("wn1") -@LiteflowCmpDefine(NodeTypeEnum.BOOLEAN) -public class WhileCmp1 { - private int count = 0; - - // 执行过的 chain - Set executedChain = new HashSet<>(); - - @LiteflowMethod(value = LiteFlowMethodEnum.PROCESS_BOOLEAN) - public boolean processWhile(NodeComponent bindCmp) throws Exception { - // 判断是否切换了 chain - if (!executedChain.contains(bindCmp.getCurrChainId())) { - count = 0; - executedChain.add(bindCmp.getCurrChainId()); - } - count++; - return count <= 3; - } -} diff --git a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/fallback/cmp/WhileCmp2.java b/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/fallback/cmp/WhileCmp2.java deleted file mode 100644 index a178b560..00000000 --- a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/fallback/cmp/WhileCmp2.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.yomahub.liteflow.test.fallback.cmp; - -import com.yomahub.liteflow.annotation.FallbackCmp; -import com.yomahub.liteflow.annotation.LiteflowCmpDefine; -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import com.yomahub.liteflow.enums.NodeTypeEnum; - -@LiteflowComponent("wn2") -@LiteflowCmpDefine(NodeTypeEnum.BOOLEAN) -@FallbackCmp -public class WhileCmp2 { - - @LiteflowMethod(value = LiteFlowMethodEnum.PROCESS_BOOLEAN) - public boolean processWhile(NodeComponent bindCmp) throws Exception { - return false; - } -} diff --git a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/resources/fallback/application.properties b/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/resources/fallback/application.properties deleted file mode 100644 index b6a1da88..00000000 --- a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/resources/fallback/application.properties +++ /dev/null @@ -1,2 +0,0 @@ -liteflow.rule-source=fallback/flow.el.xml -liteflow.fallback-cmp-enable=true \ No newline at end of file diff --git a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/resources/fallback/flow.el.xml b/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/resources/fallback/flow.el.xml deleted file mode 100644 index 9647a51d..00000000 --- a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/resources/fallback/flow.el.xml +++ /dev/null @@ -1,136 +0,0 @@ - - - - - THEN(a, node("x")); - - - - THEN(PRE(node("x1")), node("x2"), FINALLY(node("x3"))); - - - - - WHEN(b, node("x")); - - - - - IF(node("x"), a) - - - - - IF(ifn1, node("x")) - - - - - FOR(node("x")).DO(a); - - - - - FOR(3).DO(node("x")); - - - - - WHILE(node("x")).DO(a) - - - - - WHILE(wn1).DO(node("x")) - - - - - ITERATOR(node("x")).DO(a) - - - - - ITERATOR(itn1).DO(node("x")) - - - - - FOR(3).DO(a).BREAK(node("x")); - - - - WHILE(wn1).DO(a).BREAK(node("x")); - - - - ITERATOR(itn1).DO(a).BREAK(node("x")); - - - - - SWITCH(node("x")).to(a,b); - - - - - SWITCH(swn1).to(node("x"),a); - - - - - IF(AND(node("x"),ifn1), a); - - - - - IF(OR(node("x"),ifn1), a); - - - - - IF(NOT(node("x")), a); - - - - - CATCH(THEN(a, d)).DO(node("x")) - - - - - THEN( - a, - node("x1"), - IF(node("x2"), b) - ); - - - - IF( - OR(node("x1"), ifn1), - THEN(a, node("x2")) - ); - - - - FOR(node("x1")).DO( - THEN(b, node("x2")) - ); - - - - - WHEN( - THEN(node("x1")), - IF(node("x2"), b) - ).maxWaitSeconds(10000); - - - - WHEN( - node("x1"), - IF(node("x2"), b) - ).maxWaitSeconds(10000); - - \ No newline at end of file diff --git a/liteflow-testcase-el/liteflow-testcase-el-nospring/pom.xml b/liteflow-testcase-el/liteflow-testcase-el-nospring/pom.xml index 4020d12a..ed8ba75e 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-nospring/pom.xml +++ b/liteflow-testcase-el/liteflow-testcase-el-nospring/pom.xml @@ -19,6 +19,11 @@ liteflow-core ${revision} + + com.yomahub + liteflow-el-builder + ${revision} + ch.qos.logback logback-classic diff --git a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/fallback/FallbackTest.java b/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/fallback/FallbackTest.java index 3ffb7dbc..7a27baff 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/fallback/FallbackTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/fallback/FallbackTest.java @@ -1,5 +1,8 @@ package com.yomahub.liteflow.test.fallback; +import com.yomahub.liteflow.builder.el.ELBus; +import com.yomahub.liteflow.builder.el.ELWrapper; +import com.yomahub.liteflow.builder.el.LiteFlowChainELBuilder; import com.yomahub.liteflow.core.FlowExecutor; import com.yomahub.liteflow.core.FlowExecutorHolder; import com.yomahub.liteflow.flow.LiteflowResponse; @@ -33,14 +36,14 @@ public class FallbackTest extends BaseTest { public void testThen1() { LiteflowResponse response = flowExecutor.execute2Resp("then1", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("a==>c", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("a==>fb_comm_cmp", response.getExecuteStepStrWithoutTime()); } @Test public void testThen2() { LiteflowResponse response = flowExecutor.execute2Resp("then2", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("c==>c==>c", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("fb_comm_cmp==>fb_comm_cmp==>fb_comm_cmp", response.getExecuteStepStrWithoutTime()); } @Test @@ -48,147 +51,112 @@ public class FallbackTest extends BaseTest { LiteflowResponse response = flowExecutor.execute2Resp("when1", "arg"); Assertions.assertTrue(response.isSuccess()); String executeStepStr = response.getExecuteStepStrWithoutTime(); - Assertions.assertTrue("b==>c".equals(executeStepStr) || "c==>b".equals(executeStepStr)); + Assertions.assertTrue("b==>fb_comm_cmp".equals(executeStepStr) || "fb_comm_cmp==>b".equals(executeStepStr)); } @Test public void testIf1() { LiteflowResponse response = flowExecutor.execute2Resp("if1", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("ifn2", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("fb_bool_cmp", response.getExecuteStepStrWithoutTime()); } @Test public void testIf2() { LiteflowResponse response = flowExecutor.execute2Resp("if2", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("ifn1==>c", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("ifn1==>fb_comm_cmp", response.getExecuteStepStrWithoutTime()); } @Test public void testFor1() { LiteflowResponse response = flowExecutor.execute2Resp("for1", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("for1==>a==>a==>a", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("fb_for_cmp==>a==>a==>a", response.getExecuteStepStrWithoutTime()); } @Test public void testFor2() { LiteflowResponse response = flowExecutor.execute2Resp("for2", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("LOOP_3==>c==>c==>c", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("LOOP_3==>fb_comm_cmp==>fb_comm_cmp==>fb_comm_cmp", response.getExecuteStepStrWithoutTime()); } @Test public void testWhile1() { LiteflowResponse response = flowExecutor.execute2Resp("while1", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("wn2", response.getExecuteStepStrWithoutTime()); - } - - @Test - public void testWhile2() { - LiteflowResponse response = flowExecutor.execute2Resp("while2", "arg"); - Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("wn1==>c==>wn1==>c==>wn1==>c==>wn1", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("fb_bool_cmp", response.getExecuteStepStrWithoutTime()); } @Test public void testIterator1() { LiteflowResponse response = flowExecutor.execute2Resp("iterator1", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("itn2", response.getExecuteStepStrWithoutTime()); - } - - @Test - public void testIterator2() { - LiteflowResponse response = flowExecutor.execute2Resp("iterator2", "arg"); - Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("itn1==>c==>c==>c", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("fb_iter_cmp", response.getExecuteStepStrWithoutTime()); } @Test public void testBreak1() { LiteflowResponse response = flowExecutor.execute2Resp("break1", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("LOOP_3==>a==>bn1", response.getExecuteStepStrWithoutTime()); - } - - @Test - public void testBreak2() { - LiteflowResponse response = flowExecutor.execute2Resp("break2", "arg"); - Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("wn1==>a==>bn1", response.getExecuteStepStrWithoutTime()); - } - - @Test - public void testBreak3() { - LiteflowResponse response = flowExecutor.execute2Resp("break3", "arg"); - Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("itn1==>a==>bn1", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("LOOP_3==>a==>fb_bool_cmp==>a==>fb_bool_cmp==>a==>fb_bool_cmp", response.getExecuteStepStrWithoutTime()); } @Test public void testSwitch1() { LiteflowResponse response = flowExecutor.execute2Resp("switch1", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("swn2==>b", response.getExecuteStepStrWithoutTime()); - } - - @Test - public void testSwitch2() { - LiteflowResponse response = flowExecutor.execute2Resp("switch2", "arg"); - Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("swn1==>a", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("fb_sw_cmp==>b", response.getExecuteStepStrWithoutTime()); } @Test public void testAnd1() { LiteflowResponse response = flowExecutor.execute2Resp("and1", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("ifn2", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("fb_bool_cmp", response.getExecuteStepStrWithoutTime()); } @Test public void testOr1() { LiteflowResponse response = flowExecutor.execute2Resp("or1", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("ifn2==>ifn1==>a", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("fb_bool_cmp==>ifn1==>a", response.getExecuteStepStrWithoutTime()); } @Test public void testNot1() { LiteflowResponse response = flowExecutor.execute2Resp("not1", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("ifn2==>a", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("fb_bool_cmp==>a", response.getExecuteStepStrWithoutTime()); } @Test public void testCatch1() { LiteflowResponse response = flowExecutor.execute2Resp("catch1", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("a==>d==>c", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("a==>d==>fb_comm_cmp", response.getExecuteStepStrWithoutTime()); } @Test public void testMulti1() { LiteflowResponse response = flowExecutor.execute2Resp("multi1", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("a==>c==>ifn2", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("a==>fb_comm_cmp==>fb_bool_cmp", response.getExecuteStepStrWithoutTime()); } @Test public void testMulti2() { LiteflowResponse response = flowExecutor.execute2Resp("multi2", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("ifn2==>ifn1==>a==>c", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("fb_bool_cmp==>ifn1==>a==>fb_comm_cmp", response.getExecuteStepStrWithoutTime()); } @Test public void testMulti3() { LiteflowResponse response = flowExecutor.execute2Resp("multi3", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("for1==>b==>c==>b==>c==>b==>c", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("fb_for_cmp==>b==>fb_comm_cmp==>b==>fb_comm_cmp==>b==>fb_comm_cmp", response.getExecuteStepStrWithoutTime()); } @Test @@ -196,7 +164,7 @@ public class FallbackTest extends BaseTest { LiteflowResponse response = flowExecutor.execute2Resp("concurrent1", "arg"); Assertions.assertTrue(response.isSuccess()); String stepStr = response.getExecuteStepStrWithoutTime(); - Assertions.assertTrue("c==>ifn2".equals(stepStr) || "ifn2==>c".equals(stepStr)); + Assertions.assertTrue("fb_comm_cmp==>fb_bool_cmp".equals(stepStr) || "fb_bool_cmp==>fb_comm_cmp".equals(stepStr)); } @Test @@ -204,7 +172,7 @@ public class FallbackTest extends BaseTest { LiteflowResponse response = flowExecutor.execute2Resp("concurrent2", "arg"); Assertions.assertTrue(response.isSuccess()); String stepStr = response.getExecuteStepStrWithoutTime(); - Assertions.assertTrue("c==>ifn2".equals(stepStr) || "ifn2==>c".equals(stepStr)); + Assertions.assertTrue("fb_comm_cmp==>fb_bool_cmp".equals(stepStr) || "ifn2==>c".equals(stepStr)); } @Test @@ -217,9 +185,18 @@ public class FallbackTest extends BaseTest { LiteflowResponse response2 = future2.get(); Assertions.assertTrue(response1.isSuccess()); String stepStr1 = response1.getExecuteStepStrWithoutTime(); - Assertions.assertTrue("c==>ifn2".equals(stepStr1) || "ifn2==>c".equals(stepStr1)); + Assertions.assertTrue("fb_comm_cmp==>fb_bool_cmp".equals(stepStr1) || "fb_bool_cmp==>fb_comm_cmp".equals(stepStr1)); Assertions.assertTrue(response2.isSuccess()); String stepStr2 = response2.getExecuteStepStrWithoutTime(); - Assertions.assertTrue("c==>ifn2".equals(stepStr2) || "ifn2==>c".equals(stepStr2)); + Assertions.assertTrue("fb_comm_cmp==>fb_bool_cmp".equals(stepStr2) || "fb_bool_cmp==>fb_comm_cmp".equals(stepStr2)); + } + + @Test + public void testWithElBuild(){ + ELWrapper el = ELBus.then("a", "b", "az"); + LiteFlowChainELBuilder.createChain().setChainId("elBuilder").setEL(el.toEL()).build(); + LiteflowResponse response = flowExecutor.execute2Resp("elBuilder"); + Assertions.assertTrue(response.isSuccess()); + Assertions.assertEquals("a==>b==>fb_comm_cmp", response.getExecuteStepStrWithoutTime()); } } diff --git a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/fallback/cmp/IfCmp2.java b/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/fallback/cmp/BooleanFBCmp.java similarity index 82% rename from liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/fallback/cmp/IfCmp2.java rename to liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/fallback/cmp/BooleanFBCmp.java index a333ea0e..360b204b 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/fallback/cmp/IfCmp2.java +++ b/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/fallback/cmp/BooleanFBCmp.java @@ -4,7 +4,7 @@ import com.yomahub.liteflow.annotation.FallbackCmp; import com.yomahub.liteflow.core.NodeBooleanComponent; @FallbackCmp -public class IfCmp2 extends NodeBooleanComponent { +public class BooleanFBCmp extends NodeBooleanComponent { @Override public boolean processBoolean() throws Exception { diff --git a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/fallback/cmp/BreakCmp.java b/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/fallback/cmp/BreakCmp.java deleted file mode 100644 index b59e7c9d..00000000 --- a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/fallback/cmp/BreakCmp.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.yomahub.liteflow.test.fallback.cmp; - -import com.yomahub.liteflow.annotation.FallbackCmp; -import com.yomahub.liteflow.core.NodeBooleanComponent; - -@FallbackCmp -public class BreakCmp extends NodeBooleanComponent { - - @Override - public boolean processBoolean() throws Exception { - return true; - } -} diff --git a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/fallback/cmp/CCmp.java b/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/fallback/cmp/CommonFBCmp.java similarity index 84% rename from liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/fallback/cmp/CCmp.java rename to liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/fallback/cmp/CommonFBCmp.java index 8e191587..780c8868 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/fallback/cmp/CCmp.java +++ b/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/fallback/cmp/CommonFBCmp.java @@ -4,7 +4,7 @@ import com.yomahub.liteflow.annotation.FallbackCmp; import com.yomahub.liteflow.core.NodeComponent; @FallbackCmp -public class CCmp extends NodeComponent { +public class CommonFBCmp extends NodeComponent { @Override public void process() { diff --git a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/fallback/cmp/ForCmp.java b/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/fallback/cmp/ForFBCmp.java similarity index 83% rename from liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/fallback/cmp/ForCmp.java rename to liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/fallback/cmp/ForFBCmp.java index 0a69a763..115c7a9f 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/fallback/cmp/ForCmp.java +++ b/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/fallback/cmp/ForFBCmp.java @@ -4,7 +4,7 @@ import com.yomahub.liteflow.annotation.FallbackCmp; import com.yomahub.liteflow.core.NodeForComponent; @FallbackCmp -public class ForCmp extends NodeForComponent { +public class ForFBCmp extends NodeForComponent { @Override public int processFor() throws Exception { diff --git a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/fallback/cmp/IteratorCmp2.java b/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/fallback/cmp/IterFBCmp.java similarity index 85% rename from liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/fallback/cmp/IteratorCmp2.java rename to liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/fallback/cmp/IterFBCmp.java index 1a6456da..6fb30a02 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/fallback/cmp/IteratorCmp2.java +++ b/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/fallback/cmp/IterFBCmp.java @@ -7,7 +7,7 @@ import java.util.Collections; import java.util.Iterator; @FallbackCmp -public class IteratorCmp2 extends NodeIteratorComponent { +public class IterFBCmp extends NodeIteratorComponent { @Override public Iterator processIterator() throws Exception { diff --git a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/fallback/cmp/SwitchCmp2.java b/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/fallback/cmp/SwFBCmp.java similarity index 83% rename from liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/fallback/cmp/SwitchCmp2.java rename to liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/fallback/cmp/SwFBCmp.java index 78b10c31..de3bb4d9 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/fallback/cmp/SwitchCmp2.java +++ b/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/fallback/cmp/SwFBCmp.java @@ -4,7 +4,7 @@ import com.yomahub.liteflow.annotation.FallbackCmp; import com.yomahub.liteflow.core.NodeSwitchComponent; @FallbackCmp -public class SwitchCmp2 extends NodeSwitchComponent { +public class SwFBCmp extends NodeSwitchComponent { @Override public String processSwitch() throws Exception { diff --git a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/fallback/cmp/WhileCmp2.java b/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/fallback/cmp/WhileCmp2.java deleted file mode 100644 index f3e76823..00000000 --- a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/fallback/cmp/WhileCmp2.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.yomahub.liteflow.test.fallback.cmp; - -import com.yomahub.liteflow.annotation.FallbackCmp; -import com.yomahub.liteflow.core.NodeBooleanComponent; - -@FallbackCmp -public class WhileCmp2 extends NodeBooleanComponent { - - @Override - public boolean processBoolean() throws Exception { - return false; - } -} diff --git a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/resources/fallback/flow.el.xml b/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/resources/fallback/flow.el.xml index 24eba9db..85be51c9 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/resources/fallback/flow.el.xml +++ b/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/resources/fallback/flow.el.xml @@ -3,25 +3,23 @@ - + + + - - - - - - - - + + + + THEN(a, node("x")); - + THEN(PRE(node("x1")), node("x2"), FINALLY(node("x3"))); @@ -35,119 +33,96 @@ IF(node("x"), a) - + IF(ifn1, node("x")) - + FOR(node("x")).DO(a); - + FOR(3).DO(node("x")); - + WHILE(node("x")).DO(a) - - - - WHILE(wn1).DO(node("x")) - - + ITERATOR(node("x")).DO(a) - - - - ITERATOR(itn1).DO(node("x")) - - + FOR(3).DO(a).BREAK(node("x")); - - - WHILE(wn1).DO(a).BREAK(node("x")); - - - - ITERATOR(itn1).DO(a).BREAK(node("x")); - - + SWITCH(node("x")).to(a,b); - - - - SWITCH(swn1).to(node("x"),a); - - + IF(AND(node("x"),ifn1), a); - + IF(OR(node("x"),ifn1), a); - + IF(NOT(node("x")), a); - + - CATCH(THEN(a, d)).DO(node("x")) + CATCH(THEN(a, d)).DO(node("x")) - + THEN( - a, - node("x1"), - IF(node("x2"), b) + a, + node("x1"), + IF(node("x2"), b) ); - + IF( - OR(node("x1"), ifn1), - THEN(a, node("x2")) + OR(node("x1"), ifn1), + THEN(a, node("x2")) ); - + FOR(node("x1")).DO( - THEN(b, node("x2")) + THEN(b, node("x2")) ); WHEN( - THEN(node("x1")), - IF(node("x2"), b) + THEN(node("x1")), + IF(node("x2"), b) ).maxWaitSeconds(10000); WHEN( - node("x1"), - IF(node("x2"), b) + node("x1"), + IF(node("x2"), b) ).maxWaitSeconds(10000); \ No newline at end of file diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/pom.xml b/liteflow-testcase-el/liteflow-testcase-el-solon/pom.xml index 2993329c..b1bc0903 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/pom.xml +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/pom.xml @@ -19,6 +19,12 @@ ${revision} + + com.yomahub + liteflow-el-builder + ${revision} + + org.noear solon-test-junit5 diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/fallback/FallbackELSolonTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/fallback/FallbackELSolonTest.java index dae75cc1..fe3966a2 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/fallback/FallbackELSolonTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/fallback/FallbackELSolonTest.java @@ -1,5 +1,8 @@ package com.yomahub.liteflow.test.fallback; +import com.yomahub.liteflow.builder.el.ELBus; +import com.yomahub.liteflow.builder.el.ELWrapper; +import com.yomahub.liteflow.builder.el.LiteFlowChainELBuilder; import com.yomahub.liteflow.core.FlowExecutor; import com.yomahub.liteflow.flow.LiteflowResponse; import com.yomahub.liteflow.test.BaseTest; @@ -30,14 +33,14 @@ public class FallbackELSolonTest extends BaseTest { public void testThen1() { LiteflowResponse response = flowExecutor.execute2Resp("then1", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("a==>c", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("a==>fb_comm_cmp", response.getExecuteStepStrWithoutTime()); } @Test public void testThen2() { LiteflowResponse response = flowExecutor.execute2Resp("then2", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("c==>c==>c", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("fb_comm_cmp==>fb_comm_cmp==>fb_comm_cmp", response.getExecuteStepStrWithoutTime()); } @Test @@ -45,147 +48,112 @@ public class FallbackELSolonTest extends BaseTest { LiteflowResponse response = flowExecutor.execute2Resp("when1", "arg"); Assertions.assertTrue(response.isSuccess()); String executeStepStr = response.getExecuteStepStrWithoutTime(); - Assertions.assertTrue("b==>c".equals(executeStepStr) || "c==>b".equals(executeStepStr)); + Assertions.assertTrue("b==>fb_comm_cmp".equals(executeStepStr) || "fb_comm_cmp==>b".equals(executeStepStr)); } @Test public void testIf1() { LiteflowResponse response = flowExecutor.execute2Resp("if1", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("ifn2", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("fb_bool_cmp", response.getExecuteStepStrWithoutTime()); } @Test public void testIf2() { LiteflowResponse response = flowExecutor.execute2Resp("if2", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("ifn1==>c", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("ifn1==>fb_comm_cmp", response.getExecuteStepStrWithoutTime()); } @Test public void testFor1() { LiteflowResponse response = flowExecutor.execute2Resp("for1", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("for1==>a==>a==>a", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("fb_for_cmp==>a==>a==>a", response.getExecuteStepStrWithoutTime()); } @Test public void testFor2() { LiteflowResponse response = flowExecutor.execute2Resp("for2", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("LOOP_3==>c==>c==>c", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("LOOP_3==>fb_comm_cmp==>fb_comm_cmp==>fb_comm_cmp", response.getExecuteStepStrWithoutTime()); } @Test public void testWhile1() { LiteflowResponse response = flowExecutor.execute2Resp("while1", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("wn2", response.getExecuteStepStrWithoutTime()); - } - - @Test - public void testWhile2() { - LiteflowResponse response = flowExecutor.execute2Resp("while2", "arg"); - Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("wn1==>c==>wn1==>c==>wn1==>c==>wn1", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("fb_bool_cmp", response.getExecuteStepStrWithoutTime()); } @Test public void testIterator1() { LiteflowResponse response = flowExecutor.execute2Resp("iterator1", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("itn2", response.getExecuteStepStrWithoutTime()); - } - - @Test - public void testIterator2() { - LiteflowResponse response = flowExecutor.execute2Resp("iterator2", "arg"); - Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("itn1==>c==>c==>c", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("fb_iter_cmp", response.getExecuteStepStrWithoutTime()); } @Test public void testBreak1() { LiteflowResponse response = flowExecutor.execute2Resp("break1", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("LOOP_3==>a==>bn1", response.getExecuteStepStrWithoutTime()); - } - - @Test - public void testBreak2() { - LiteflowResponse response = flowExecutor.execute2Resp("break2", "arg"); - Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("wn1==>a==>bn1", response.getExecuteStepStrWithoutTime()); - } - - @Test - public void testBreak3() { - LiteflowResponse response = flowExecutor.execute2Resp("break3", "arg"); - Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("itn1==>a==>bn1", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("LOOP_3==>a==>fb_bool_cmp==>a==>fb_bool_cmp==>a==>fb_bool_cmp", response.getExecuteStepStrWithoutTime()); } @Test public void testSwitch1() { LiteflowResponse response = flowExecutor.execute2Resp("switch1", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("swn2==>b", response.getExecuteStepStrWithoutTime()); - } - - @Test - public void testSwitch2() { - LiteflowResponse response = flowExecutor.execute2Resp("switch2", "arg"); - Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("swn1==>a", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("fb_sw_cmp==>b", response.getExecuteStepStrWithoutTime()); } @Test public void testAnd1() { LiteflowResponse response = flowExecutor.execute2Resp("and1", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("ifn2", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("fb_bool_cmp", response.getExecuteStepStrWithoutTime()); } @Test public void testOr1() { LiteflowResponse response = flowExecutor.execute2Resp("or1", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("ifn2==>ifn1==>a", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("fb_bool_cmp==>ifn1==>a", response.getExecuteStepStrWithoutTime()); } @Test public void testNot1() { LiteflowResponse response = flowExecutor.execute2Resp("not1", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("ifn2==>a", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("fb_bool_cmp==>a", response.getExecuteStepStrWithoutTime()); } @Test public void testCatch1() { LiteflowResponse response = flowExecutor.execute2Resp("catch1", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("a==>d==>c", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("a==>d==>fb_comm_cmp", response.getExecuteStepStrWithoutTime()); } @Test public void testMulti1() { LiteflowResponse response = flowExecutor.execute2Resp("multi1", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("a==>c==>ifn2", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("a==>fb_comm_cmp==>fb_bool_cmp", response.getExecuteStepStrWithoutTime()); } @Test public void testMulti2() { LiteflowResponse response = flowExecutor.execute2Resp("multi2", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("ifn2==>ifn1==>a==>c", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("fb_bool_cmp==>ifn1==>a==>fb_comm_cmp", response.getExecuteStepStrWithoutTime()); } @Test public void testMulti3() { LiteflowResponse response = flowExecutor.execute2Resp("multi3", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("for1==>b==>c==>b==>c==>b==>c", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("fb_for_cmp==>b==>fb_comm_cmp==>b==>fb_comm_cmp==>b==>fb_comm_cmp", response.getExecuteStepStrWithoutTime()); } @Test @@ -193,7 +161,7 @@ public class FallbackELSolonTest extends BaseTest { LiteflowResponse response = flowExecutor.execute2Resp("concurrent1", "arg"); Assertions.assertTrue(response.isSuccess()); String stepStr = response.getExecuteStepStrWithoutTime(); - Assertions.assertTrue("c==>ifn2".equals(stepStr) || "ifn2==>c".equals(stepStr)); + Assertions.assertTrue("fb_comm_cmp==>fb_bool_cmp".equals(stepStr) || "fb_bool_cmp==>fb_comm_cmp".equals(stepStr)); } @Test @@ -201,7 +169,7 @@ public class FallbackELSolonTest extends BaseTest { LiteflowResponse response = flowExecutor.execute2Resp("concurrent2", "arg"); Assertions.assertTrue(response.isSuccess()); String stepStr = response.getExecuteStepStrWithoutTime(); - Assertions.assertTrue("c==>ifn2".equals(stepStr) || "ifn2==>c".equals(stepStr)); + Assertions.assertTrue("fb_comm_cmp==>fb_bool_cmp".equals(stepStr) || "ifn2==>c".equals(stepStr)); } @Test @@ -214,9 +182,18 @@ public class FallbackELSolonTest extends BaseTest { LiteflowResponse response2 = future2.get(); Assertions.assertTrue(response1.isSuccess()); String stepStr1 = response1.getExecuteStepStrWithoutTime(); - Assertions.assertTrue("c==>ifn2".equals(stepStr1) || "ifn2==>c".equals(stepStr1)); + Assertions.assertTrue("fb_comm_cmp==>fb_bool_cmp".equals(stepStr1) || "fb_bool_cmp==>fb_comm_cmp".equals(stepStr1)); Assertions.assertTrue(response2.isSuccess()); String stepStr2 = response2.getExecuteStepStrWithoutTime(); - Assertions.assertTrue("c==>ifn2".equals(stepStr2) || "ifn2==>c".equals(stepStr2)); + Assertions.assertTrue("fb_comm_cmp==>fb_bool_cmp".equals(stepStr2) || "fb_bool_cmp==>fb_comm_cmp".equals(stepStr2)); + } + + @Test + public void testWithElBuild(){ + ELWrapper el = ELBus.then("a", "b", "az"); + LiteFlowChainELBuilder.createChain().setChainId("elBuilder").setEL(el.toEL()).build(); + LiteflowResponse response = flowExecutor.execute2Resp("elBuilder"); + Assertions.assertTrue(response.isSuccess()); + Assertions.assertEquals("a==>b==>fb_comm_cmp", response.getExecuteStepStrWithoutTime()); } } diff --git a/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/fallback/cmp/IfCmp2.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/fallback/cmp/BooleanFBCmp.java similarity index 78% rename from liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/fallback/cmp/IfCmp2.java rename to liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/fallback/cmp/BooleanFBCmp.java index 4dd233e3..ca800d99 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/fallback/cmp/IfCmp2.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/fallback/cmp/BooleanFBCmp.java @@ -4,9 +4,9 @@ import com.yomahub.liteflow.annotation.FallbackCmp; import com.yomahub.liteflow.annotation.LiteflowComponent; import com.yomahub.liteflow.core.NodeBooleanComponent; -@LiteflowComponent("ifn2") +@LiteflowComponent("fb_bool_cmp") @FallbackCmp -public class IfCmp2 extends NodeBooleanComponent { +public class BooleanFBCmp extends NodeBooleanComponent { @Override public boolean processBoolean() throws Exception { diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/fallback/cmp/BreakCmp.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/fallback/cmp/BreakCmp.java deleted file mode 100644 index 448d7501..00000000 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/fallback/cmp/BreakCmp.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.yomahub.liteflow.test.fallback.cmp; - -import com.yomahub.liteflow.annotation.FallbackCmp; -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.core.NodeBooleanComponent; - -@LiteflowComponent("bn1") -@FallbackCmp -public class BreakCmp extends NodeBooleanComponent { - - @Override - public boolean processBoolean() throws Exception { - return true; - } -} diff --git a/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/fallback/cmp/CCmp.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/fallback/cmp/CommonFBCmp.java similarity index 79% rename from liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/fallback/cmp/CCmp.java rename to liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/fallback/cmp/CommonFBCmp.java index 54d0799b..e7e397c2 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/fallback/cmp/CCmp.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/fallback/cmp/CommonFBCmp.java @@ -4,9 +4,9 @@ import com.yomahub.liteflow.annotation.FallbackCmp; import com.yomahub.liteflow.annotation.LiteflowComponent; import com.yomahub.liteflow.core.NodeComponent; -@LiteflowComponent("c") +@LiteflowComponent("fb_comm_cmp") @FallbackCmp -public class CCmp extends NodeComponent { +public class CommonFBCmp extends NodeComponent { @Override public void process() { diff --git a/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/fallback/cmp/ForCmp.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/fallback/cmp/ForFBCmp.java similarity index 79% rename from liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/fallback/cmp/ForCmp.java rename to liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/fallback/cmp/ForFBCmp.java index 2607f8ac..9e53e8e0 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/fallback/cmp/ForCmp.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/fallback/cmp/ForFBCmp.java @@ -4,9 +4,9 @@ import com.yomahub.liteflow.annotation.FallbackCmp; import com.yomahub.liteflow.annotation.LiteflowComponent; import com.yomahub.liteflow.core.NodeForComponent; -@LiteflowComponent("for1") +@LiteflowComponent("fb_for_cmp") @FallbackCmp -public class ForCmp extends NodeForComponent { +public class ForFBCmp extends NodeForComponent { @Override public int processFor() throws Exception { diff --git a/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/fallback/cmp/IteratorCmp2.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/fallback/cmp/IterFBCmp.java similarity index 82% rename from liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/fallback/cmp/IteratorCmp2.java rename to liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/fallback/cmp/IterFBCmp.java index c45f1903..c3014cb5 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/fallback/cmp/IteratorCmp2.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/fallback/cmp/IterFBCmp.java @@ -7,9 +7,9 @@ import com.yomahub.liteflow.core.NodeIteratorComponent; import java.util.Collections; import java.util.Iterator; -@LiteflowComponent("itn2") +@LiteflowComponent("fb_iter_cmp") @FallbackCmp -public class IteratorCmp2 extends NodeIteratorComponent { +public class IterFBCmp extends NodeIteratorComponent { @Override public Iterator processIterator() throws Exception { diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/fallback/cmp/SwitchCmp2.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/fallback/cmp/SwFBCmp.java similarity index 79% rename from liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/fallback/cmp/SwitchCmp2.java rename to liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/fallback/cmp/SwFBCmp.java index 28b1edcf..453709f7 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/fallback/cmp/SwitchCmp2.java +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/fallback/cmp/SwFBCmp.java @@ -4,9 +4,9 @@ import com.yomahub.liteflow.annotation.FallbackCmp; import com.yomahub.liteflow.annotation.LiteflowComponent; import com.yomahub.liteflow.core.NodeSwitchComponent; -@LiteflowComponent("swn2") +@LiteflowComponent("fb_sw_cmp") @FallbackCmp -public class SwitchCmp2 extends NodeSwitchComponent { +public class SwFBCmp extends NodeSwitchComponent { @Override public String processSwitch() throws Exception { diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/fallback/cmp/WhileCmp2.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/fallback/cmp/WhileCmp2.java deleted file mode 100644 index eb21b885..00000000 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/fallback/cmp/WhileCmp2.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.yomahub.liteflow.test.fallback.cmp; - -import com.yomahub.liteflow.annotation.FallbackCmp; -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.core.NodeBooleanComponent; - -@LiteflowComponent("wn2") -@FallbackCmp -public class WhileCmp2 extends NodeBooleanComponent { - - @Override - public boolean processBoolean() throws Exception { - return false; - } -} diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/resources/fallback/flow.el.xml b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/resources/fallback/flow.el.xml index 9647a51d..e944bdd4 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/resources/fallback/flow.el.xml +++ b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/resources/fallback/flow.el.xml @@ -4,7 +4,7 @@ THEN(a, node("x")); - + THEN(PRE(node("x1")), node("x2"), FINALLY(node("x3"))); @@ -18,119 +18,96 @@ IF(node("x"), a) - + IF(ifn1, node("x")) - + FOR(node("x")).DO(a); - + FOR(3).DO(node("x")); - + WHILE(node("x")).DO(a) - - - - WHILE(wn1).DO(node("x")) - - + ITERATOR(node("x")).DO(a) - - - - ITERATOR(itn1).DO(node("x")) - - + FOR(3).DO(a).BREAK(node("x")); - - - WHILE(wn1).DO(a).BREAK(node("x")); - - - - ITERATOR(itn1).DO(a).BREAK(node("x")); - - + SWITCH(node("x")).to(a,b); - - - - SWITCH(swn1).to(node("x"),a); - - + IF(AND(node("x"),ifn1), a); - + IF(OR(node("x"),ifn1), a); - + IF(NOT(node("x")), a); - + - CATCH(THEN(a, d)).DO(node("x")) + CATCH(THEN(a, d)).DO(node("x")) - + THEN( - a, - node("x1"), - IF(node("x2"), b) + a, + node("x1"), + IF(node("x2"), b) ); - + IF( - OR(node("x1"), ifn1), - THEN(a, node("x2")) + OR(node("x1"), ifn1), + THEN(a, node("x2")) ); - + FOR(node("x1")).DO( - THEN(b, node("x2")) + THEN(b, node("x2")) ); WHEN( - THEN(node("x1")), - IF(node("x2"), b) + THEN(node("x1")), + IF(node("x2"), b) ).maxWaitSeconds(10000); WHEN( - node("x1"), - IF(node("x2"), b) + node("x1"), + IF(node("x2"), b) ).maxWaitSeconds(10000); \ No newline at end of file diff --git a/liteflow-testcase-el/liteflow-testcase-el-springnative/pom.xml b/liteflow-testcase-el/liteflow-testcase-el-springnative/pom.xml index 332c7fa6..9207969c 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-springnative/pom.xml +++ b/liteflow-testcase-el/liteflow-testcase-el-springnative/pom.xml @@ -19,6 +19,12 @@ ${revision} + + com.yomahub + liteflow-el-builder + ${revision} + + ch.qos.logback logback-classic diff --git a/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/fallback/FallbackELSpringTest.java b/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/fallback/FallbackELSpringTest.java index a6552f9f..31a6ec75 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/fallback/FallbackELSpringTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/fallback/FallbackELSpringTest.java @@ -1,5 +1,8 @@ package com.yomahub.liteflow.test.fallback; +import com.yomahub.liteflow.builder.el.ELBus; +import com.yomahub.liteflow.builder.el.ELWrapper; +import com.yomahub.liteflow.builder.el.LiteFlowChainELBuilder; import com.yomahub.liteflow.core.FlowExecutor; import com.yomahub.liteflow.flow.LiteflowResponse; import com.yomahub.liteflow.test.BaseTest; @@ -29,14 +32,14 @@ public class FallbackELSpringTest extends BaseTest { public void testThen1() { LiteflowResponse response = flowExecutor.execute2Resp("then1", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("a==>c", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("a==>fb_comm_cmp", response.getExecuteStepStrWithoutTime()); } @Test public void testThen2() { LiteflowResponse response = flowExecutor.execute2Resp("then2", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("c==>c==>c", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("fb_comm_cmp==>fb_comm_cmp==>fb_comm_cmp", response.getExecuteStepStrWithoutTime()); } @Test @@ -44,147 +47,112 @@ public class FallbackELSpringTest extends BaseTest { LiteflowResponse response = flowExecutor.execute2Resp("when1", "arg"); Assertions.assertTrue(response.isSuccess()); String executeStepStr = response.getExecuteStepStrWithoutTime(); - Assertions.assertTrue("b==>c".equals(executeStepStr) || "c==>b".equals(executeStepStr)); + Assertions.assertTrue("b==>fb_comm_cmp".equals(executeStepStr) || "fb_comm_cmp==>b".equals(executeStepStr)); } @Test public void testIf1() { LiteflowResponse response = flowExecutor.execute2Resp("if1", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("ifn2", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("fb_bool_cmp", response.getExecuteStepStrWithoutTime()); } @Test public void testIf2() { LiteflowResponse response = flowExecutor.execute2Resp("if2", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("ifn1==>c", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("ifn1==>fb_comm_cmp", response.getExecuteStepStrWithoutTime()); } @Test public void testFor1() { LiteflowResponse response = flowExecutor.execute2Resp("for1", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("for1==>a==>a==>a", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("fb_for_cmp==>a==>a==>a", response.getExecuteStepStrWithoutTime()); } @Test public void testFor2() { LiteflowResponse response = flowExecutor.execute2Resp("for2", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("LOOP_3==>c==>c==>c", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("LOOP_3==>fb_comm_cmp==>fb_comm_cmp==>fb_comm_cmp", response.getExecuteStepStrWithoutTime()); } @Test public void testWhile1() { LiteflowResponse response = flowExecutor.execute2Resp("while1", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("wn2", response.getExecuteStepStrWithoutTime()); - } - - @Test - public void testWhile2() { - LiteflowResponse response = flowExecutor.execute2Resp("while2", "arg"); - Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("wn1==>c==>wn1==>c==>wn1==>c==>wn1", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("fb_bool_cmp", response.getExecuteStepStrWithoutTime()); } @Test public void testIterator1() { LiteflowResponse response = flowExecutor.execute2Resp("iterator1", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("itn2", response.getExecuteStepStrWithoutTime()); - } - - @Test - public void testIterator2() { - LiteflowResponse response = flowExecutor.execute2Resp("iterator2", "arg"); - Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("itn1==>c==>c==>c", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("fb_iter_cmp", response.getExecuteStepStrWithoutTime()); } @Test public void testBreak1() { LiteflowResponse response = flowExecutor.execute2Resp("break1", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("LOOP_3==>a==>bn1", response.getExecuteStepStrWithoutTime()); - } - - @Test - public void testBreak2() { - LiteflowResponse response = flowExecutor.execute2Resp("break2", "arg"); - Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("wn1==>a==>bn1", response.getExecuteStepStrWithoutTime()); - } - - @Test - public void testBreak3() { - LiteflowResponse response = flowExecutor.execute2Resp("break3", "arg"); - Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("itn1==>a==>bn1", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("LOOP_3==>a==>fb_bool_cmp==>a==>fb_bool_cmp==>a==>fb_bool_cmp", response.getExecuteStepStrWithoutTime()); } @Test public void testSwitch1() { LiteflowResponse response = flowExecutor.execute2Resp("switch1", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("swn2==>b", response.getExecuteStepStrWithoutTime()); - } - - @Test - public void testSwitch2() { - LiteflowResponse response = flowExecutor.execute2Resp("switch2", "arg"); - Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("swn1==>a", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("fb_sw_cmp==>b", response.getExecuteStepStrWithoutTime()); } @Test public void testAnd1() { LiteflowResponse response = flowExecutor.execute2Resp("and1", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("ifn2", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("fb_bool_cmp", response.getExecuteStepStrWithoutTime()); } @Test public void testOr1() { LiteflowResponse response = flowExecutor.execute2Resp("or1", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("ifn2==>ifn1==>a", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("fb_bool_cmp==>ifn1==>a", response.getExecuteStepStrWithoutTime()); } @Test public void testNot1() { LiteflowResponse response = flowExecutor.execute2Resp("not1", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("ifn2==>a", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("fb_bool_cmp==>a", response.getExecuteStepStrWithoutTime()); } @Test public void testCatch1() { LiteflowResponse response = flowExecutor.execute2Resp("catch1", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("a==>d==>c", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("a==>d==>fb_comm_cmp", response.getExecuteStepStrWithoutTime()); } @Test public void testMulti1() { LiteflowResponse response = flowExecutor.execute2Resp("multi1", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("a==>c==>ifn2", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("a==>fb_comm_cmp==>fb_bool_cmp", response.getExecuteStepStrWithoutTime()); } @Test public void testMulti2() { LiteflowResponse response = flowExecutor.execute2Resp("multi2", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("ifn2==>ifn1==>a==>c", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("fb_bool_cmp==>ifn1==>a==>fb_comm_cmp", response.getExecuteStepStrWithoutTime()); } @Test public void testMulti3() { LiteflowResponse response = flowExecutor.execute2Resp("multi3", "arg"); Assertions.assertTrue(response.isSuccess()); - Assertions.assertEquals("for1==>b==>c==>b==>c==>b==>c", response.getExecuteStepStrWithoutTime()); + Assertions.assertEquals("fb_for_cmp==>b==>fb_comm_cmp==>b==>fb_comm_cmp==>b==>fb_comm_cmp", response.getExecuteStepStrWithoutTime()); } @Test @@ -192,7 +160,7 @@ public class FallbackELSpringTest extends BaseTest { LiteflowResponse response = flowExecutor.execute2Resp("concurrent1", "arg"); Assertions.assertTrue(response.isSuccess()); String stepStr = response.getExecuteStepStrWithoutTime(); - Assertions.assertTrue("c==>ifn2".equals(stepStr) || "ifn2==>c".equals(stepStr)); + Assertions.assertTrue("fb_comm_cmp==>fb_bool_cmp".equals(stepStr) || "fb_bool_cmp==>fb_comm_cmp".equals(stepStr)); } @Test @@ -200,7 +168,7 @@ public class FallbackELSpringTest extends BaseTest { LiteflowResponse response = flowExecutor.execute2Resp("concurrent2", "arg"); Assertions.assertTrue(response.isSuccess()); String stepStr = response.getExecuteStepStrWithoutTime(); - Assertions.assertTrue("c==>ifn2".equals(stepStr) || "ifn2==>c".equals(stepStr)); + Assertions.assertTrue("fb_comm_cmp==>fb_bool_cmp".equals(stepStr) || "ifn2==>c".equals(stepStr)); } @Test @@ -213,9 +181,18 @@ public class FallbackELSpringTest extends BaseTest { LiteflowResponse response2 = future2.get(); Assertions.assertTrue(response1.isSuccess()); String stepStr1 = response1.getExecuteStepStrWithoutTime(); - Assertions.assertTrue("c==>ifn2".equals(stepStr1) || "ifn2==>c".equals(stepStr1)); + Assertions.assertTrue("fb_comm_cmp==>fb_bool_cmp".equals(stepStr1) || "fb_bool_cmp==>fb_comm_cmp".equals(stepStr1)); Assertions.assertTrue(response2.isSuccess()); String stepStr2 = response2.getExecuteStepStrWithoutTime(); - Assertions.assertTrue("c==>ifn2".equals(stepStr2) || "ifn2==>c".equals(stepStr2)); + Assertions.assertTrue("fb_comm_cmp==>fb_bool_cmp".equals(stepStr2) || "fb_bool_cmp==>fb_comm_cmp".equals(stepStr2)); + } + + @Test + public void testWithElBuild(){ + ELWrapper el = ELBus.then("a", "b", "az"); + LiteFlowChainELBuilder.createChain().setChainId("elBuilder").setEL(el.toEL()).build(); + LiteflowResponse response = flowExecutor.execute2Resp("elBuilder"); + Assertions.assertTrue(response.isSuccess()); + Assertions.assertEquals("a==>b==>fb_comm_cmp", response.getExecuteStepStrWithoutTime()); } } diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/fallback/cmp/IfCmp2.java b/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/fallback/cmp/BooleanFBCmp.java similarity index 78% rename from liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/fallback/cmp/IfCmp2.java rename to liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/fallback/cmp/BooleanFBCmp.java index 4dd233e3..ca800d99 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/fallback/cmp/IfCmp2.java +++ b/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/fallback/cmp/BooleanFBCmp.java @@ -4,9 +4,9 @@ import com.yomahub.liteflow.annotation.FallbackCmp; import com.yomahub.liteflow.annotation.LiteflowComponent; import com.yomahub.liteflow.core.NodeBooleanComponent; -@LiteflowComponent("ifn2") +@LiteflowComponent("fb_bool_cmp") @FallbackCmp -public class IfCmp2 extends NodeBooleanComponent { +public class BooleanFBCmp extends NodeBooleanComponent { @Override public boolean processBoolean() throws Exception { diff --git a/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/fallback/cmp/BreakCmp.java b/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/fallback/cmp/BreakCmp.java deleted file mode 100644 index 448d7501..00000000 --- a/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/fallback/cmp/BreakCmp.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.yomahub.liteflow.test.fallback.cmp; - -import com.yomahub.liteflow.annotation.FallbackCmp; -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.core.NodeBooleanComponent; - -@LiteflowComponent("bn1") -@FallbackCmp -public class BreakCmp extends NodeBooleanComponent { - - @Override - public boolean processBoolean() throws Exception { - return true; - } -} diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/fallback/cmp/CCmp.java b/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/fallback/cmp/CommonFBCmp.java similarity index 79% rename from liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/fallback/cmp/CCmp.java rename to liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/fallback/cmp/CommonFBCmp.java index 54d0799b..e7e397c2 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/fallback/cmp/CCmp.java +++ b/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/fallback/cmp/CommonFBCmp.java @@ -4,9 +4,9 @@ import com.yomahub.liteflow.annotation.FallbackCmp; import com.yomahub.liteflow.annotation.LiteflowComponent; import com.yomahub.liteflow.core.NodeComponent; -@LiteflowComponent("c") +@LiteflowComponent("fb_comm_cmp") @FallbackCmp -public class CCmp extends NodeComponent { +public class CommonFBCmp extends NodeComponent { @Override public void process() { diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/fallback/cmp/ForCmp.java b/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/fallback/cmp/ForFBCmp.java similarity index 79% rename from liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/fallback/cmp/ForCmp.java rename to liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/fallback/cmp/ForFBCmp.java index 2607f8ac..9e53e8e0 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/fallback/cmp/ForCmp.java +++ b/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/fallback/cmp/ForFBCmp.java @@ -4,9 +4,9 @@ import com.yomahub.liteflow.annotation.FallbackCmp; import com.yomahub.liteflow.annotation.LiteflowComponent; import com.yomahub.liteflow.core.NodeForComponent; -@LiteflowComponent("for1") +@LiteflowComponent("fb_for_cmp") @FallbackCmp -public class ForCmp extends NodeForComponent { +public class ForFBCmp extends NodeForComponent { @Override public int processFor() throws Exception { diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/fallback/cmp/IteratorCmp2.java b/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/fallback/cmp/IterFBCmp.java similarity index 82% rename from liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/fallback/cmp/IteratorCmp2.java rename to liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/fallback/cmp/IterFBCmp.java index c45f1903..c3014cb5 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/fallback/cmp/IteratorCmp2.java +++ b/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/fallback/cmp/IterFBCmp.java @@ -7,9 +7,9 @@ import com.yomahub.liteflow.core.NodeIteratorComponent; import java.util.Collections; import java.util.Iterator; -@LiteflowComponent("itn2") +@LiteflowComponent("fb_iter_cmp") @FallbackCmp -public class IteratorCmp2 extends NodeIteratorComponent { +public class IterFBCmp extends NodeIteratorComponent { @Override public Iterator processIterator() throws Exception { diff --git a/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/fallback/cmp/SwitchCmp2.java b/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/fallback/cmp/SwFBCmp.java similarity index 79% rename from liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/fallback/cmp/SwitchCmp2.java rename to liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/fallback/cmp/SwFBCmp.java index 28b1edcf..453709f7 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/fallback/cmp/SwitchCmp2.java +++ b/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/fallback/cmp/SwFBCmp.java @@ -4,9 +4,9 @@ import com.yomahub.liteflow.annotation.FallbackCmp; import com.yomahub.liteflow.annotation.LiteflowComponent; import com.yomahub.liteflow.core.NodeSwitchComponent; -@LiteflowComponent("swn2") +@LiteflowComponent("fb_sw_cmp") @FallbackCmp -public class SwitchCmp2 extends NodeSwitchComponent { +public class SwFBCmp extends NodeSwitchComponent { @Override public String processSwitch() throws Exception { diff --git a/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/fallback/cmp/WhileCmp2.java b/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/fallback/cmp/WhileCmp2.java deleted file mode 100644 index eb21b885..00000000 --- a/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/fallback/cmp/WhileCmp2.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.yomahub.liteflow.test.fallback.cmp; - -import com.yomahub.liteflow.annotation.FallbackCmp; -import com.yomahub.liteflow.annotation.LiteflowComponent; -import com.yomahub.liteflow.core.NodeBooleanComponent; - -@LiteflowComponent("wn2") -@FallbackCmp -public class WhileCmp2 extends NodeBooleanComponent { - - @Override - public boolean processBoolean() throws Exception { - return false; - } -} diff --git a/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/resources/fallback/flow.el.xml b/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/resources/fallback/flow.el.xml index 9647a51d..e944bdd4 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/resources/fallback/flow.el.xml +++ b/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/resources/fallback/flow.el.xml @@ -4,7 +4,7 @@ THEN(a, node("x")); - + THEN(PRE(node("x1")), node("x2"), FINALLY(node("x3"))); @@ -18,119 +18,96 @@ IF(node("x"), a) - + IF(ifn1, node("x")) - + FOR(node("x")).DO(a); - + FOR(3).DO(node("x")); - + WHILE(node("x")).DO(a) - - - - WHILE(wn1).DO(node("x")) - - + ITERATOR(node("x")).DO(a) - - - - ITERATOR(itn1).DO(node("x")) - - + FOR(3).DO(a).BREAK(node("x")); - - - WHILE(wn1).DO(a).BREAK(node("x")); - - - - ITERATOR(itn1).DO(a).BREAK(node("x")); - - + SWITCH(node("x")).to(a,b); - - - - SWITCH(swn1).to(node("x"),a); - - + IF(AND(node("x"),ifn1), a); - + IF(OR(node("x"),ifn1), a); - + IF(NOT(node("x")), a); - + - CATCH(THEN(a, d)).DO(node("x")) + CATCH(THEN(a, d)).DO(node("x")) - + THEN( - a, - node("x1"), - IF(node("x2"), b) + a, + node("x1"), + IF(node("x2"), b) ); - + IF( - OR(node("x1"), ifn1), - THEN(a, node("x2")) + OR(node("x1"), ifn1), + THEN(a, node("x2")) ); - + FOR(node("x1")).DO( - THEN(b, node("x2")) + THEN(b, node("x2")) ); WHEN( - THEN(node("x1")), - IF(node("x2"), b) + THEN(node("x1")), + IF(node("x2"), b) ).maxWaitSeconds(10000); WHEN( - node("x1"), - IF(node("x2"), b) + node("x1"), + IF(node("x2"), b) ).maxWaitSeconds(10000); \ No newline at end of file