mirror of
https://gitee.com/dromara/liteFlow.git
synced 2026-06-13 03:11:10 +08:00
增加异步多嵌套WHEN多线程测试用例
This commit is contained in:
@@ -20,7 +20,7 @@ import javax.annotation.Resource;
|
||||
*
|
||||
* @author ssss
|
||||
*/
|
||||
@TestPropertySource(value = "classpath:/asyncNode/application.properties")
|
||||
@TestPropertySource(value = "classpath:/asyncNode/application1.properties")
|
||||
@SpringBootTest(classes = AsyncNodeELSpringbootTest.class)
|
||||
@EnableAutoConfiguration
|
||||
@ComponentScan({ "com.yomahub.liteflow.test.asyncNode.cmp" })
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.yomahub.liteflow.test.asyncNode;
|
||||
|
||||
import com.yomahub.liteflow.core.FlowExecutor;
|
||||
import com.yomahub.liteflow.flow.LiteflowResponse;
|
||||
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;
|
||||
|
||||
@TestPropertySource(value = "classpath:/asyncNode/application2.properties")
|
||||
@SpringBootTest(classes = AsyncNodeThreadPoolELSpringbootTest.class)
|
||||
@EnableAutoConfiguration
|
||||
@ComponentScan({ "com.yomahub.liteflow.test.asyncNode.cmp" })
|
||||
public class AsyncNodeThreadPoolELSpringbootTest {
|
||||
|
||||
@Resource
|
||||
private FlowExecutor flowExecutor;
|
||||
|
||||
@Test
|
||||
public void testAsyncFlow1() {
|
||||
LiteflowResponse response = flowExecutor.execute2Resp("chain1", "it's a base request");
|
||||
Assertions.assertTrue(response.isSuccess());
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ public class FCmp extends NodeComponent {
|
||||
|
||||
@Override
|
||||
public void process() throws Exception {
|
||||
Thread.sleep(1500);
|
||||
System.out.println("Fcomp executed!");
|
||||
}
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
liteflow.rule-source=asyncNode/flow.el.xml
|
||||
@@ -0,0 +1 @@
|
||||
liteflow.rule-source=asyncNode/flow1.xml
|
||||
@@ -0,0 +1,4 @@
|
||||
liteflow.rule-source=asyncNode/flow2.xml
|
||||
liteflow.when-max-workers=4
|
||||
liteflow.when-max-wait-time=20
|
||||
liteflow.when-max-wait-time-unit=SECONDS
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<flow>
|
||||
<!-- base test -->
|
||||
<chain name="chain1">
|
||||
WHEN(f, f, WHEN(f, WHEN(f, f, f, f, WHEN(f, f, f, f, f, f, f))), f, f);
|
||||
</chain>
|
||||
</flow>
|
||||
Reference in New Issue
Block a user