From 3daa807f47c8f477d27a0bb9bb10c266b36154bb Mon Sep 17 00:00:00 2001 From: "everywhere.z" Date: Thu, 16 Mar 2023 17:46:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E6=8E=89=E4=B8=8D=E5=BF=85=E8=A6=81?= =?UTF-8?q?=E7=9A=84=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../monitorFile/MonitorFileGroovyELTest.java | 45 ------------------- 1 file changed, 45 deletions(-) delete mode 100644 liteflow-testcase-el/liteflow-testcase-el-script-groovy-springboot/src/test/java/com/yomahub/liteflow/test/script/groovy/monitorFile/MonitorFileGroovyELTest.java diff --git a/liteflow-testcase-el/liteflow-testcase-el-script-groovy-springboot/src/test/java/com/yomahub/liteflow/test/script/groovy/monitorFile/MonitorFileGroovyELTest.java b/liteflow-testcase-el/liteflow-testcase-el-script-groovy-springboot/src/test/java/com/yomahub/liteflow/test/script/groovy/monitorFile/MonitorFileGroovyELTest.java deleted file mode 100644 index 6d39ae9e3..000000000 --- a/liteflow-testcase-el/liteflow-testcase-el-script-groovy-springboot/src/test/java/com/yomahub/liteflow/test/script/groovy/monitorFile/MonitorFileGroovyELTest.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.yomahub.liteflow.test.script.groovy.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.slot.DefaultContext; -import com.yomahub.liteflow.test.BaseTest; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import javax.annotation.Resource; -import java.io.File; - -@RunWith(SpringRunner.class) -@TestPropertySource(value = "classpath:/monitorFile/application.properties") -@SpringBootTest(classes = MonitorFileGroovyELTest.class) -@EnableAutoConfiguration -@ComponentScan({"com.yomahub.liteflow.test.script.groovy.monitorFile.cmp"}) -public class MonitorFileGroovyELTest extends BaseTest { - - @Resource - private FlowExecutor flowExecutor; - - @Test - public void testMonitor() throws Exception{ - String absolutePath = new ClassPathResource("classpath:/monitorFile/s1.groovy").getAbsolutePath(); - String content = FileUtil.readUtf8String(absolutePath); - String newContent = content.replace("a=3", "a=2"); - FileUtil.writeString(newContent,new File(absolutePath), CharsetUtil.CHARSET_UTF_8); - LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg"); - Thread.sleep(1500L); - DefaultContext context = response.getFirstContextBean(); - Assert.assertTrue(response.isSuccess()); - Assert.assertEquals(Integer.valueOf(4), context.getData("s1")); - - } -}