mirror of
https://gitee.com/dromara/liteFlow.git
synced 2026-05-14 12:12:08 +08:00
修复一些测试用例
This commit is contained in:
@@ -5,6 +5,7 @@ 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.Assert;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@@ -22,7 +23,7 @@ import java.io.File;
|
||||
@SpringBootTest(classes = MonitorFileELDeclMultiSpringbootTest.class)
|
||||
@EnableAutoConfiguration
|
||||
@ComponentScan({"com.yomahub.liteflow.test.monitorFile.cmp"})
|
||||
public class MonitorFileELDeclMultiSpringbootTest {
|
||||
public class MonitorFileELDeclMultiSpringbootTest extends BaseTest {
|
||||
@Resource
|
||||
private FlowExecutor flowExecutor;
|
||||
|
||||
@@ -33,7 +34,7 @@ public class MonitorFileELDeclMultiSpringbootTest {
|
||||
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);
|
||||
Thread.sleep(1500);
|
||||
|
||||
LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg");
|
||||
Assert.assertEquals("a==>c==>b", response.getExecuteStepStr());
|
||||
|
||||
@@ -34,7 +34,7 @@ public class MonitorFileELDeclSpringbootTest extends BaseTest {
|
||||
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);
|
||||
Thread.sleep(1500);
|
||||
|
||||
LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg");
|
||||
Assert.assertEquals("a==>c==>b", response.getExecuteStepStr());
|
||||
|
||||
@@ -46,7 +46,7 @@ public class RefreshRuleELDeclSpringbootTest extends BaseTest {
|
||||
public void testRefresh2() throws Exception{
|
||||
new Thread(() -> {
|
||||
try {
|
||||
Thread.sleep(3000L);
|
||||
Thread.sleep(2000L);
|
||||
String content = ResourceUtil.readUtf8Str("classpath: /refreshRule/flow_update.el.xml");
|
||||
FlowBus.refreshFlowMetaData(FlowParserTypeEnum.TYPE_EL_XML, content);
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -36,7 +36,7 @@ public class MonitorFileGroovyELTest extends BaseTest {
|
||||
String newContent = content.replace("a=3", "a=2");
|
||||
FileUtil.writeString(newContent,new File(absolutePath), CharsetUtil.CHARSET_UTF_8);
|
||||
|
||||
Thread.sleep(1000);
|
||||
Thread.sleep(1500);
|
||||
|
||||
LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg");
|
||||
DefaultContext context = response.getFirstContextBean();
|
||||
|
||||
@@ -5,6 +5,7 @@ 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.Assert;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@@ -16,7 +17,7 @@ import java.io.File;
|
||||
|
||||
@RunWith(SolonJUnit4ClassRunner.class)
|
||||
@TestPropertySource("classpath:/monitorFile/application.properties")
|
||||
public class MonitorFileELSpringbootTest {
|
||||
public class MonitorFileELSpringbootTest extends BaseTest {
|
||||
|
||||
@Inject
|
||||
private FlowExecutor flowExecutor;
|
||||
@@ -28,7 +29,7 @@ public class MonitorFileELSpringbootTest {
|
||||
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);
|
||||
Thread.sleep(1500);
|
||||
|
||||
LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg");
|
||||
Assert.assertEquals("a==>c==>b", response.getExecuteStepStr());
|
||||
|
||||
@@ -5,6 +5,7 @@ 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.Assert;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@@ -22,7 +23,7 @@ import java.io.File;
|
||||
@SpringBootTest(classes = MonitorFileELSpringbootTest.class)
|
||||
@EnableAutoConfiguration
|
||||
@ComponentScan({"com.yomahub.liteflow.test.monitorFile.cmp"})
|
||||
public class MonitorFileELSpringbootTest {
|
||||
public class MonitorFileELSpringbootTest extends BaseTest {
|
||||
|
||||
@Resource
|
||||
private FlowExecutor flowExecutor;
|
||||
@@ -34,7 +35,7 @@ public class MonitorFileELSpringbootTest {
|
||||
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);
|
||||
Thread.sleep(1500);
|
||||
|
||||
LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg");
|
||||
Assert.assertEquals("a==>c==>b", response.getExecuteStepStr());
|
||||
|
||||
2
pom.xml
2
pom.xml
@@ -39,7 +39,7 @@
|
||||
</scm>
|
||||
|
||||
<properties>
|
||||
<revision>2.9.7</revision>
|
||||
<revision>2.9.8</revision>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
|
||||
Reference in New Issue
Block a user