From e5581f84f9f6cc2456059bc41e03a37af0f47a67 Mon Sep 17 00:00:00 2001 From: "everywhere.z" Date: Fri, 21 Jul 2023 14:43:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96monitorFile=E7=9A=84=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MonitorFileELDeclMultiSpringbootTest.java | 52 ------------------- .../test/monitorFile/cmp/CmpConfig.java | 28 ---------- .../monitorFile/application.properties | 2 - .../test/resources/monitorFile/flow.el.xml | 7 --- .../MonitorFileELDeclSpringbootTest.java | 51 ------------------ .../liteflow/test/monitorFile/cmp/ACmp.java | 25 --------- .../liteflow/test/monitorFile/cmp/BCmp.java | 25 --------- .../liteflow/test/monitorFile/cmp/CCmp.java | 25 --------- .../monitorFile/application.properties | 2 - .../test/resources/monitorFile/flow.el.xml | 7 --- .../monitorFile/LiteflowMonitorFileTest.java | 47 ----------------- .../liteflow/test/monitorFile/cmp/ACmp.java | 19 ------- .../liteflow/test/monitorFile/cmp/BCmp.java | 19 ------- .../liteflow/test/monitorFile/cmp/CCmp.java | 19 ------- .../MonitorFileSpringbootTest.java | 44 ---------------- .../liteflow/test/monitorFile/cmp/ACmp.java | 23 -------- .../liteflow/test/monitorFile/cmp/BCmp.java | 23 -------- .../liteflow/test/monitorFile/cmp/CCmp.java | 23 -------- .../monitorFile/application.properties | 2 - .../src/test/resources/monitorFile/flow.xml | 7 --- .../MonitorFileELSpringbootTest.java | 4 +- 21 files changed, 2 insertions(+), 452 deletions(-) delete mode 100644 liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/java/com/yomahub/liteflow/test/monitorFile/MonitorFileELDeclMultiSpringbootTest.java delete mode 100644 liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/java/com/yomahub/liteflow/test/monitorFile/cmp/CmpConfig.java delete mode 100644 liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/resources/monitorFile/application.properties delete mode 100644 liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/resources/monitorFile/flow.el.xml delete mode 100644 liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/monitorFile/MonitorFileELDeclSpringbootTest.java delete mode 100644 liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/monitorFile/cmp/ACmp.java delete mode 100644 liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/monitorFile/cmp/BCmp.java delete mode 100644 liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/monitorFile/cmp/CCmp.java delete mode 100644 liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/resources/monitorFile/application.properties delete mode 100644 liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/resources/monitorFile/flow.el.xml delete mode 100644 liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/monitorFile/LiteflowMonitorFileTest.java delete mode 100644 liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/monitorFile/cmp/ACmp.java delete mode 100644 liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/monitorFile/cmp/BCmp.java delete mode 100644 liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/monitorFile/cmp/CCmp.java delete mode 100644 liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/monitorFile/MonitorFileSpringbootTest.java delete mode 100644 liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/monitorFile/cmp/ACmp.java delete mode 100644 liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/monitorFile/cmp/BCmp.java delete mode 100644 liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/monitorFile/cmp/CCmp.java delete mode 100644 liteflow-testcase-el/liteflow-testcase-el-solon/src/test/resources/monitorFile/application.properties delete mode 100644 liteflow-testcase-el/liteflow-testcase-el-solon/src/test/resources/monitorFile/flow.xml diff --git a/liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/java/com/yomahub/liteflow/test/monitorFile/MonitorFileELDeclMultiSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/java/com/yomahub/liteflow/test/monitorFile/MonitorFileELDeclMultiSpringbootTest.java deleted file mode 100644 index bf3639f2..00000000 --- a/liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/java/com/yomahub/liteflow/test/monitorFile/MonitorFileELDeclMultiSpringbootTest.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.yomahub.liteflow.test.monitorFile; - -import cn.hutool.core.io.FileUtil; -import cn.hutool.core.io.resource.ClassPathResource; -import cn.hutool.core.util.CharsetUtil; -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.springframework.test.context.junit.jupiter.SpringExtension; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; -import java.io.File; - -@ExtendWith(SpringExtension.class) -@TestPropertySource(value = "classpath:/monitorFile/application.properties") -@SpringBootTest(classes = MonitorFileELDeclMultiSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({ "com.yomahub.liteflow.test.monitorFile.cmp" }) -public class MonitorFileELDeclMultiSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testMonitor() throws Exception { - String absolutePath = new ClassPathResource("classpath:/monitorFile/flow.el.xml").getAbsolutePath(); - FileUtil.writeString("THEN(a, b, c);", new File(absolutePath), CharsetUtil.CHARSET_UTF_8); - String content = FileUtil.readUtf8String(absolutePath); - String newContent = content.replace("THEN(a, b, c);", "THEN(a, c, b);"); - FileUtil.writeString(newContent, new File(absolutePath), CharsetUtil.CHARSET_UTF_8); - Thread.sleep(3000); - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assertions.assertEquals("a==>c==>b", response.getExecuteStepStr()); - - } - - @AfterEach - public void afterEach(){ - String absolutePath = new ClassPathResource("classpath:/monitorFile/flow.el.xml").getAbsolutePath(); - FileUtil.writeString("THEN(a, b, c);", new File(absolutePath), CharsetUtil.CHARSET_UTF_8); - } - -} diff --git a/liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/java/com/yomahub/liteflow/test/monitorFile/cmp/CmpConfig.java b/liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/java/com/yomahub/liteflow/test/monitorFile/cmp/CmpConfig.java deleted file mode 100644 index 19873353..00000000 --- a/liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/java/com/yomahub/liteflow/test/monitorFile/cmp/CmpConfig.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.yomahub.liteflow.test.monitorFile.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; - -import java.util.Random; - -@LiteflowComponent -public class CmpConfig { - - @LiteflowMethod(value = LiteFlowMethodEnum.PROCESS, nodeId = "a") - public void processA(NodeComponent bindCmp) { - System.out.println("ACmp executed!"); - } - - @LiteflowMethod(value = LiteFlowMethodEnum.PROCESS, nodeId = "b") - public void processB(NodeComponent bindCmp) { - System.out.println("BCmp executed!"); - } - - @LiteflowMethod(value = LiteFlowMethodEnum.PROCESS, nodeId = "c") - public void process(NodeComponent bindCmp) { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/resources/monitorFile/application.properties b/liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/resources/monitorFile/application.properties deleted file mode 100644 index 361f7e90..00000000 --- a/liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/resources/monitorFile/application.properties +++ /dev/null @@ -1,2 +0,0 @@ -liteflow.rule-source=monitorFile/flow.el.xml -liteflow.enable-monitor-file=true \ No newline at end of file diff --git a/liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/resources/monitorFile/flow.el.xml b/liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/resources/monitorFile/flow.el.xml deleted file mode 100644 index 98c3cbae..00000000 --- a/liteflow-testcase-el/liteflow-testcase-el-declare-multi-springboot/src/test/resources/monitorFile/flow.el.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - THEN(a, b, c); - - - \ No newline at end of file diff --git a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/monitorFile/MonitorFileELDeclSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/monitorFile/MonitorFileELDeclSpringbootTest.java deleted file mode 100644 index 21b325a8..00000000 --- a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/monitorFile/MonitorFileELDeclSpringbootTest.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.yomahub.liteflow.test.monitorFile; - -import cn.hutool.core.io.FileUtil; -import cn.hutool.core.io.resource.ClassPathResource; -import cn.hutool.core.util.CharsetUtil; -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.springframework.test.context.junit.jupiter.SpringExtension; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; -import java.io.File; - -@ExtendWith(SpringExtension.class) -@TestPropertySource(value = "classpath:/monitorFile/application.properties") -@SpringBootTest(classes = MonitorFileELDeclSpringbootTest.class) -@EnableAutoConfiguration -@ComponentScan({ "com.yomahub.liteflow.test.monitorFile.cmp" }) -public class MonitorFileELDeclSpringbootTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testMonitor() throws Exception { - String absolutePath = new ClassPathResource("classpath:/monitorFile/flow.el.xml").getAbsolutePath(); - FileUtil.writeString("THEN(a, b, c);", new File(absolutePath), CharsetUtil.CHARSET_UTF_8); - String content = FileUtil.readUtf8String(absolutePath); - String newContent = content.replace("THEN(a, b, c);", "THEN(a, c, b);"); - FileUtil.writeString(newContent, new File(absolutePath), CharsetUtil.CHARSET_UTF_8); - Thread.sleep(3000); - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assertions.assertEquals("a==>c==>b", response.getExecuteStepStr()); - } - - @AfterEach - public void afterEach(){ - String absolutePath = new ClassPathResource("classpath:/monitorFile/flow.el.xml").getAbsolutePath(); - FileUtil.writeString("THEN(a, b, c);", new File(absolutePath), CharsetUtil.CHARSET_UTF_8); - } - -} diff --git a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/monitorFile/cmp/ACmp.java b/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/monitorFile/cmp/ACmp.java deleted file mode 100644 index 753f3d95..00000000 --- a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/monitorFile/cmp/ACmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.monitorFile.cmp; - -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -import java.util.Random; - -@Component("a") -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/monitorFile/cmp/BCmp.java b/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/monitorFile/cmp/BCmp.java deleted file mode 100644 index 2cf61833..00000000 --- a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/monitorFile/cmp/BCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.monitorFile.cmp; - -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -import java.util.Random; - -@Component("b") -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/monitorFile/cmp/CCmp.java b/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/monitorFile/cmp/CCmp.java deleted file mode 100644 index 697d5dab..00000000 --- a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/monitorFile/cmp/CCmp.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.monitorFile.cmp; - -import com.yomahub.liteflow.annotation.LiteflowMethod; -import com.yomahub.liteflow.core.NodeComponent; -import com.yomahub.liteflow.enums.LiteFlowMethodEnum; -import org.springframework.stereotype.Component; - -import java.util.Random; - -@Component("c") -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/resources/monitorFile/application.properties b/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/resources/monitorFile/application.properties deleted file mode 100644 index 361f7e90..00000000 --- a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/resources/monitorFile/application.properties +++ /dev/null @@ -1,2 +0,0 @@ -liteflow.rule-source=monitorFile/flow.el.xml -liteflow.enable-monitor-file=true \ No newline at end of file diff --git a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/resources/monitorFile/flow.el.xml b/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/resources/monitorFile/flow.el.xml deleted file mode 100644 index 98c3cbae..00000000 --- a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/resources/monitorFile/flow.el.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - THEN(a, b, c); - - - \ No newline at end of file diff --git a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/monitorFile/LiteflowMonitorFileTest.java b/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/monitorFile/LiteflowMonitorFileTest.java deleted file mode 100644 index 70c581ec..00000000 --- a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/monitorFile/LiteflowMonitorFileTest.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.yomahub.liteflow.test.monitorFile; - -import cn.hutool.core.io.FileUtil; -import cn.hutool.core.io.resource.ClassPathResource; -import cn.hutool.core.util.CharsetUtil; -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.core.FlowExecutorHolder; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.property.LiteflowConfig; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; - -import java.io.File; - -public class LiteflowMonitorFileTest extends BaseTest { - - private static FlowExecutor flowExecutor; - - @BeforeAll - public static void init() { - LiteflowConfig config = new LiteflowConfig(); - config.setRuleSource("monitorFile/flow.el.xml"); - config.setEnableMonitorFile(true); - flowExecutor = FlowExecutorHolder.loadInstance(config); - } - - @Test - public void testMonitor() throws InterruptedException { - String absolutePath = new ClassPathResource("classpath:/monitorFile/flow.el.xml").getAbsolutePath(); - String content = FileUtil.readUtf8String(absolutePath); - String newContent = content.replace("THEN(a, b, c);", "THEN(a, c, b);"); - FileUtil.writeString(newContent, new File(absolutePath), CharsetUtil.CHARSET_UTF_8); - Thread.sleep(3000); - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assertions.assertEquals("a==>c==>b", response.getExecuteStepStr()); - } - - @AfterEach - public void afterEach(){ - String absolutePath = new ClassPathResource("classpath:/monitorFile/flow.el.xml").getAbsolutePath(); - FileUtil.writeString("THEN(a, b, c);", new File(absolutePath), CharsetUtil.CHARSET_UTF_8); - } - -} diff --git a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/monitorFile/cmp/ACmp.java b/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/monitorFile/cmp/ACmp.java deleted file mode 100644 index d99aa2b9..00000000 --- a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/monitorFile/cmp/ACmp.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - *

Title: liteflow

- *

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

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

Title: liteflow

- *

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

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

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.monitorFile.cmp; - -import com.yomahub.liteflow.core.NodeComponent; - -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/monitorFile/MonitorFileSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/monitorFile/MonitorFileSpringbootTest.java deleted file mode 100644 index 047786ac..00000000 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/monitorFile/MonitorFileSpringbootTest.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.yomahub.liteflow.test.monitorFile; - -import cn.hutool.core.io.FileUtil; -import cn.hutool.core.io.resource.ClassPathResource; -import cn.hutool.core.util.CharsetUtil; -import com.yomahub.liteflow.core.FlowExecutor; -import com.yomahub.liteflow.flow.LiteflowResponse; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.noear.solon.annotation.Inject; -import org.noear.solon.test.SolonJUnit5Extension; -import org.noear.solon.test.annotation.TestPropertySource; - -import java.io.File; - -@ExtendWith(SolonJUnit5Extension.class) -@TestPropertySource("classpath:/monitorFile/application.properties") -public class MonitorFileSpringbootTest extends BaseTest { - - @Inject - private FlowExecutor flowExecutor; - - @Test - public void testMonitor() throws Exception { - String absolutePath = new ClassPathResource("classpath:/monitorFile/flow.xml").getAbsolutePath(); - FileUtil.writeString("THEN(a, b, c);", new File(absolutePath), CharsetUtil.CHARSET_UTF_8); - String content = FileUtil.readUtf8String(absolutePath); - String newContent = content.replace("THEN(a, b, c);", "THEN(a, c, b);"); - FileUtil.writeString(newContent, new File(absolutePath), CharsetUtil.CHARSET_UTF_8); - Thread.sleep(1000); - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Assertions.assertEquals("a==>c==>b", response.getExecuteStepStr()); - } - - @AfterEach - public void afterEach(){ - String absolutePath = new ClassPathResource("classpath:/monitorFile/flow.el.xml").getAbsolutePath(); - FileUtil.writeString("THEN(a, b, c);", new File(absolutePath), CharsetUtil.CHARSET_UTF_8); - } - -} diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/monitorFile/cmp/ACmp.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/monitorFile/cmp/ACmp.java deleted file mode 100644 index 2bcc4b1b..00000000 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/monitorFile/cmp/ACmp.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.monitorFile.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.noear.solon.annotation.Component; - -import java.util.Random; - -@Component("a") -public class ACmp extends NodeComponent { - - @Override - public void process() { - System.out.println("ACmp executed!"); - } - -} diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/monitorFile/cmp/BCmp.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/monitorFile/cmp/BCmp.java deleted file mode 100644 index 54437c01..00000000 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/monitorFile/cmp/BCmp.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.monitorFile.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.noear.solon.annotation.Component; - -import java.util.Random; - -@Component("b") -public class BCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("BCmp executed!"); - } - -} diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/monitorFile/cmp/CCmp.java b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/monitorFile/cmp/CCmp.java deleted file mode 100644 index 346fdfde..00000000 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/java/com/yomahub/liteflow/test/monitorFile/cmp/CCmp.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - *

Title: liteflow

- *

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

- * @author Bryan.Zhang - * @email weenyc31@163.com - * @Date 2020/4/1 - */ -package com.yomahub.liteflow.test.monitorFile.cmp; - -import com.yomahub.liteflow.core.NodeComponent; -import org.noear.solon.annotation.Component; - -import java.util.Random; - -@Component("c") -public class CCmp extends NodeComponent { - - @Override - public void process() { - System.out.println("CCmp executed!"); - } - -} diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/resources/monitorFile/application.properties b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/resources/monitorFile/application.properties deleted file mode 100644 index c1953bc1..00000000 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/resources/monitorFile/application.properties +++ /dev/null @@ -1,2 +0,0 @@ -liteflow.rule-source=monitorFile/flow.xml -liteflow.enable-monitor-file=true \ No newline at end of file diff --git a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/resources/monitorFile/flow.xml b/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/resources/monitorFile/flow.xml deleted file mode 100644 index 98c3cbae..00000000 --- a/liteflow-testcase-el/liteflow-testcase-el-solon/src/test/resources/monitorFile/flow.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - THEN(a, b, c); - - - \ No newline at end of file diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/monitorFile/MonitorFileELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/monitorFile/MonitorFileELSpringbootTest.java index 17308d7e..ecc1f9e9 100644 --- a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/monitorFile/MonitorFileELSpringbootTest.java +++ b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/monitorFile/MonitorFileELSpringbootTest.java @@ -31,8 +31,9 @@ public class MonitorFileELSpringbootTest extends BaseTest { FileUtil.writeString("THEN(a, b, c);", new File(absolutePath), CharsetUtil.CHARSET_UTF_8); String content = FileUtil.readUtf8String(absolutePath); String newContent = content.replace("THEN(a, b, c);", "THEN(a, c, b);"); + Thread.sleep(1000); FileUtil.writeString(newContent, new File(absolutePath), CharsetUtil.CHARSET_UTF_8); - Thread.sleep(1000); + Thread.sleep(3000); LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); Assertions.assertEquals("a==>c==>b", response.getExecuteStepStr()); } @@ -44,7 +45,6 @@ public class MonitorFileELSpringbootTest extends BaseTest { @Test public void testMonitorError() throws Exception { String absolutePath = new ClassPathResource("classpath:/monitorFile/flow.el.xml").getAbsolutePath(); - FileUtil.writeString("THEN(a, b, c);", new File(absolutePath), CharsetUtil.CHARSET_UTF_8); String content = FileUtil.readUtf8String(absolutePath); // 错误规则配置