mirror of
https://gitee.com/dromara/liteFlow.git
synced 2026-05-14 12:12:08 +08:00
enhancement #I4OQIX 组件执行轨迹日志级别调整
This commit is contained in:
@@ -49,6 +49,8 @@ public abstract class AbsSlot implements Slot {
|
||||
|
||||
private final Queue<CmpStep> executeSteps = new ConcurrentLinkedQueue<>();
|
||||
|
||||
private String executeStepsStr;
|
||||
|
||||
protected ConcurrentHashMap<String, Object> dataMap = new ConcurrentHashMap<String, Object>();
|
||||
|
||||
private <T> void putDataMap(String key, T t) {
|
||||
@@ -155,7 +157,7 @@ public abstract class AbsSlot implements Slot {
|
||||
this.executeSteps.add(step);
|
||||
}
|
||||
|
||||
public String printStep(){
|
||||
public String getExecuteStepStr(){
|
||||
StringBuffer str = new StringBuffer();
|
||||
CmpStep cmpStep = null;
|
||||
for (Iterator<CmpStep> it = executeSteps.iterator(); it.hasNext();) {
|
||||
@@ -165,8 +167,15 @@ public abstract class AbsSlot implements Slot {
|
||||
str.append("==>");
|
||||
}
|
||||
}
|
||||
LOG.info("[{}]:CHAIN_NAME[{}]\n{}",getRequestId(),this.getChainName(), str);
|
||||
return str.toString();
|
||||
this.executeStepsStr = str.toString();
|
||||
return this.executeStepsStr;
|
||||
}
|
||||
|
||||
public void printStep(){
|
||||
if (ObjectUtil.isNull(this.executeStepsStr)){
|
||||
this.executeStepsStr = getExecuteStepStr();
|
||||
}
|
||||
LOG.info("[{}]:CHAIN_NAME[{}]\n{}",getRequestId(),this.getChainName(), this.executeStepsStr);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -44,7 +44,9 @@ public interface Slot {
|
||||
|
||||
void addStep(CmpStep step);
|
||||
|
||||
String printStep();
|
||||
String getExecuteStepStr();
|
||||
|
||||
void printStep();
|
||||
|
||||
void generateRequestId();
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ public class LiteflowJsonScriptFileGroovyTest extends BaseTest {
|
||||
public void testScript2() {
|
||||
LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain2", "arg");
|
||||
Assert.assertTrue(response.isSuccess());
|
||||
Assert.assertEquals("d==>s2[条件脚本]==>a", response.getSlot().printStep());
|
||||
Assert.assertEquals("d==>s2[条件脚本]==>a", response.getSlot().getExecuteStepStr());
|
||||
}
|
||||
|
||||
//测试脚本的热重载
|
||||
@@ -56,7 +56,7 @@ public class LiteflowJsonScriptFileGroovyTest extends BaseTest {
|
||||
//根据配置,加载的应该是flow.xml,执行原来的规则
|
||||
LiteflowResponse<DefaultSlot> responseOld = flowExecutor.execute2Resp("chain2", "arg");
|
||||
Assert.assertTrue(responseOld.isSuccess());
|
||||
Assert.assertEquals("d==>s2[条件脚本]==>a", responseOld.getSlot().printStep());
|
||||
Assert.assertEquals("d==>s2[条件脚本]==>a", responseOld.getSlot().getExecuteStepStr());
|
||||
//更改规则,重新加载,更改的规则内容从flow_update.xml里读取,这里只是为了模拟下获取新的内容。不一定是从文件中读取
|
||||
String newContent = ResourceUtil.readUtf8Str("classpath: /json-script-file/flow_update.json");
|
||||
//进行刷新
|
||||
@@ -65,7 +65,7 @@ public class LiteflowJsonScriptFileGroovyTest extends BaseTest {
|
||||
//重新执行chain2这个链路,结果会变
|
||||
LiteflowResponse<DefaultSlot> responseNew = flowExecutor.execute2Resp("chain2", "arg");
|
||||
Assert.assertTrue(responseNew.isSuccess());
|
||||
Assert.assertEquals("d==>s2[条件脚本_改]==>b==>s3[普通脚本_新增]", responseNew.getSlot().printStep());
|
||||
Assert.assertEquals("d==>s2[条件脚本_改]==>b==>s3[普通脚本_新增]", responseNew.getSlot().getExecuteStepStr());
|
||||
}
|
||||
|
||||
//测试脚本&规则平滑重载刷新
|
||||
|
||||
@@ -47,7 +47,7 @@ public class LiteflowJsonScriptGroovyTest extends BaseTest {
|
||||
public void testScript2() {
|
||||
LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain2", "arg");
|
||||
Assert.assertTrue(response.isSuccess());
|
||||
Assert.assertEquals("d==>s2[条件脚本]==>a", response.getSlot().printStep());
|
||||
Assert.assertEquals("d==>s2[条件脚本]==>a", response.getSlot().getExecuteStepStr());
|
||||
}
|
||||
|
||||
//测试脚本的热重载
|
||||
@@ -56,7 +56,7 @@ public class LiteflowJsonScriptGroovyTest extends BaseTest {
|
||||
//根据配置,加载的应该是flow.xml,执行原来的规则
|
||||
LiteflowResponse<DefaultSlot> responseOld = flowExecutor.execute2Resp("chain2", "arg");
|
||||
Assert.assertTrue(responseOld.isSuccess());
|
||||
Assert.assertEquals("d==>s2[条件脚本]==>a", responseOld.getSlot().printStep());
|
||||
Assert.assertEquals("d==>s2[条件脚本]==>a", responseOld.getSlot().getExecuteStepStr());
|
||||
//更改规则,重新加载,更改的规则内容从flow_update.xml里读取,这里只是为了模拟下获取新的内容。不一定是从文件中读取
|
||||
String newContent = ResourceUtil.readUtf8Str("classpath: /json-script/flow_update.json");
|
||||
//进行刷新
|
||||
@@ -65,6 +65,6 @@ public class LiteflowJsonScriptGroovyTest extends BaseTest {
|
||||
//重新执行chain2这个链路,结果会变
|
||||
LiteflowResponse<DefaultSlot> responseNew = flowExecutor.execute2Resp("chain2", "arg");
|
||||
Assert.assertTrue(responseNew.isSuccess());
|
||||
Assert.assertEquals("d==>s2[条件脚本_改]==>b==>s3[普通脚本_新增]", responseNew.getSlot().printStep());
|
||||
Assert.assertEquals("d==>s2[条件脚本_改]==>b==>s3[普通脚本_新增]", responseNew.getSlot().getExecuteStepStr());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public class LiteflowXmlScriptFileGroovyTest extends BaseTest {
|
||||
public void testScript2() {
|
||||
LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain2", "arg");
|
||||
Assert.assertTrue(response.isSuccess());
|
||||
Assert.assertEquals("d==>s2[条件脚本]==>a", response.getSlot().printStep());
|
||||
Assert.assertEquals("d==>s2[条件脚本]==>a", response.getSlot().getExecuteStepStr());
|
||||
}
|
||||
|
||||
//测试脚本的热重载
|
||||
@@ -56,7 +56,7 @@ public class LiteflowXmlScriptFileGroovyTest extends BaseTest {
|
||||
//根据配置,加载的应该是flow.xml,执行原来的规则
|
||||
LiteflowResponse<DefaultSlot> responseOld = flowExecutor.execute2Resp("chain2", "arg");
|
||||
Assert.assertTrue(responseOld.isSuccess());
|
||||
Assert.assertEquals("d==>s2[条件脚本]==>a", responseOld.getSlot().printStep());
|
||||
Assert.assertEquals("d==>s2[条件脚本]==>a", responseOld.getSlot().getExecuteStepStr());
|
||||
//更改规则,重新加载,更改的规则内容从flow_update.xml里读取,这里只是为了模拟下获取新的内容。不一定是从文件中读取
|
||||
String newContent = ResourceUtil.readUtf8Str("classpath: /xml-script-file/flow_update.xml");
|
||||
//进行刷新
|
||||
@@ -65,7 +65,7 @@ public class LiteflowXmlScriptFileGroovyTest extends BaseTest {
|
||||
//重新执行chain2这个链路,结果会变
|
||||
LiteflowResponse<DefaultSlot> responseNew = flowExecutor.execute2Resp("chain2", "arg");
|
||||
Assert.assertTrue(responseNew.isSuccess());
|
||||
Assert.assertEquals("d==>s2[条件脚本_改]==>b==>s3[普通脚本_新增]", responseNew.getSlot().printStep());
|
||||
Assert.assertEquals("d==>s2[条件脚本_改]==>b==>s3[普通脚本_新增]", responseNew.getSlot().getExecuteStepStr());
|
||||
}
|
||||
|
||||
//测试脚本&规则平滑重载刷新
|
||||
|
||||
@@ -47,7 +47,7 @@ public class LiteflowXmlScriptGroovyTest extends BaseTest {
|
||||
public void testScript2() {
|
||||
LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain2", "arg");
|
||||
Assert.assertTrue(response.isSuccess());
|
||||
Assert.assertEquals("d==>s2[条件脚本]==>a", response.getSlot().printStep());
|
||||
Assert.assertEquals("d==>s2[条件脚本]==>a", response.getSlot().getExecuteStepStr());
|
||||
}
|
||||
|
||||
//测试脚本的热重载
|
||||
@@ -56,7 +56,7 @@ public class LiteflowXmlScriptGroovyTest extends BaseTest {
|
||||
//根据配置,加载的应该是flow.xml,执行原来的规则
|
||||
LiteflowResponse<DefaultSlot> responseOld = flowExecutor.execute2Resp("chain2", "arg");
|
||||
Assert.assertTrue(responseOld.isSuccess());
|
||||
Assert.assertEquals("d==>s2[条件脚本]==>a", responseOld.getSlot().printStep());
|
||||
Assert.assertEquals("d==>s2[条件脚本]==>a", responseOld.getSlot().getExecuteStepStr());
|
||||
//更改规则,重新加载,更改的规则内容从flow_update.xml里读取,这里只是为了模拟下获取新的内容。不一定是从文件中读取
|
||||
String newContent = ResourceUtil.readUtf8Str("classpath: /xml-script/flow_update.xml");
|
||||
//进行刷新
|
||||
@@ -65,6 +65,6 @@ public class LiteflowXmlScriptGroovyTest extends BaseTest {
|
||||
//重新执行chain2这个链路,结果会变
|
||||
LiteflowResponse<DefaultSlot> responseNew = flowExecutor.execute2Resp("chain2", "arg");
|
||||
Assert.assertTrue(responseNew.isSuccess());
|
||||
Assert.assertEquals("d==>s2[条件脚本_改]==>b==>s3[普通脚本_新增]", responseNew.getSlot().printStep());
|
||||
Assert.assertEquals("d==>s2[条件脚本_改]==>b==>s3[普通脚本_新增]", responseNew.getSlot().getExecuteStepStr());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public class LiteflowJsonScriptFileQLExpressTest extends BaseTest {
|
||||
public void testScript2() {
|
||||
LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain2", "arg");
|
||||
Assert.assertTrue(response.isSuccess());
|
||||
Assert.assertEquals("d==>s2[条件脚本]==>b", response.getSlot().printStep());
|
||||
Assert.assertEquals("d==>s2[条件脚本]==>b", response.getSlot().getExecuteStepStr());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -55,7 +55,7 @@ public class LiteflowJsonScriptFileQLExpressTest extends BaseTest {
|
||||
//根据配置,加载的应该是flow.xml,执行原来的规则
|
||||
LiteflowResponse<DefaultSlot> responseOld = flowExecutor.execute2Resp("chain2", "arg");
|
||||
Assert.assertTrue(responseOld.isSuccess());
|
||||
Assert.assertEquals("d==>s2[条件脚本]==>b", responseOld.getSlot().printStep());
|
||||
Assert.assertEquals("d==>s2[条件脚本]==>b", responseOld.getSlot().getExecuteStepStr());
|
||||
//更改规则,重新加载,更改的规则内容从flow_update.xml里读取,这里只是为了模拟下获取新的内容。不一定是从文件中读取
|
||||
String newContent = ResourceUtil.readUtf8Str("classpath: /json-script-file/flow_update.json");
|
||||
//进行刷新
|
||||
@@ -64,7 +64,7 @@ public class LiteflowJsonScriptFileQLExpressTest extends BaseTest {
|
||||
//重新执行chain2这个链路,结果会变
|
||||
LiteflowResponse<DefaultSlot> responseNew = flowExecutor.execute2Resp("chain2", "arg");
|
||||
Assert.assertTrue(responseNew.isSuccess());
|
||||
Assert.assertEquals("d==>s2[条件脚本_改]==>a==>s3[普通脚本_新增]", responseNew.getSlot().printStep());
|
||||
Assert.assertEquals("d==>s2[条件脚本_改]==>a==>s3[普通脚本_新增]", responseNew.getSlot().getExecuteStepStr());
|
||||
}
|
||||
|
||||
//测试脚本&规则平滑重载刷新
|
||||
|
||||
@@ -47,7 +47,7 @@ public class LiteflowJsonScriptQLExpressTest extends BaseTest {
|
||||
public void testScript2() {
|
||||
LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain2", "arg");
|
||||
Assert.assertTrue(response.isSuccess());
|
||||
Assert.assertEquals("d==>s2[条件脚本]==>b", response.getSlot().printStep());
|
||||
Assert.assertEquals("d==>s2[条件脚本]==>b", response.getSlot().getExecuteStepStr());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -55,7 +55,7 @@ public class LiteflowJsonScriptQLExpressTest extends BaseTest {
|
||||
//根据配置,加载的应该是flow.xml,执行原来的规则
|
||||
LiteflowResponse<DefaultSlot> responseOld = flowExecutor.execute2Resp("chain2", "arg");
|
||||
Assert.assertTrue(responseOld.isSuccess());
|
||||
Assert.assertEquals("d==>s2[条件脚本]==>b", responseOld.getSlot().printStep());
|
||||
Assert.assertEquals("d==>s2[条件脚本]==>b", responseOld.getSlot().getExecuteStepStr());
|
||||
//更改规则,重新加载,更改的规则内容从flow_update.xml里读取,这里只是为了模拟下获取新的内容。不一定是从文件中读取
|
||||
String newContent = ResourceUtil.readUtf8Str("classpath: /json-script/flow_update.json");
|
||||
//进行刷新
|
||||
@@ -64,6 +64,6 @@ public class LiteflowJsonScriptQLExpressTest extends BaseTest {
|
||||
//重新执行chain2这个链路,结果会变
|
||||
LiteflowResponse<DefaultSlot> responseNew = flowExecutor.execute2Resp("chain2", "arg");
|
||||
Assert.assertTrue(responseNew.isSuccess());
|
||||
Assert.assertEquals("d==>s2[条件脚本_改]==>a==>s3[普通脚本_新增]", responseNew.getSlot().printStep());
|
||||
Assert.assertEquals("d==>s2[条件脚本_改]==>a==>s3[普通脚本_新增]", responseNew.getSlot().getExecuteStepStr());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public class LiteflowXmlScriptFileQLExpressTest extends BaseTest {
|
||||
public void testScript2() {
|
||||
LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain2", "arg");
|
||||
Assert.assertTrue(response.isSuccess());
|
||||
Assert.assertEquals("d==>s2[条件脚本]==>b", response.getSlot().printStep());
|
||||
Assert.assertEquals("d==>s2[条件脚本]==>b", response.getSlot().getExecuteStepStr());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -55,7 +55,7 @@ public class LiteflowXmlScriptFileQLExpressTest extends BaseTest {
|
||||
//根据配置,加载的应该是flow.xml,执行原来的规则
|
||||
LiteflowResponse<DefaultSlot> responseOld = flowExecutor.execute2Resp("chain2", "arg");
|
||||
Assert.assertTrue(responseOld.isSuccess());
|
||||
Assert.assertEquals("d==>s2[条件脚本]==>b", responseOld.getSlot().printStep());
|
||||
Assert.assertEquals("d==>s2[条件脚本]==>b", responseOld.getSlot().getExecuteStepStr());
|
||||
//更改规则,重新加载,更改的规则内容从flow_update.xml里读取,这里只是为了模拟下获取新的内容。不一定是从文件中读取
|
||||
String newContent = ResourceUtil.readUtf8Str("classpath: /xml-script-file/flow_update.xml");
|
||||
//进行刷新
|
||||
@@ -64,7 +64,7 @@ public class LiteflowXmlScriptFileQLExpressTest extends BaseTest {
|
||||
//重新执行chain2这个链路,结果会变
|
||||
LiteflowResponse<DefaultSlot> responseNew = flowExecutor.execute2Resp("chain2", "arg");
|
||||
Assert.assertTrue(responseNew.isSuccess());
|
||||
Assert.assertEquals("d==>s2[条件脚本_改]==>a==>s3[普通脚本_新增]", responseNew.getSlot().printStep());
|
||||
Assert.assertEquals("d==>s2[条件脚本_改]==>a==>s3[普通脚本_新增]", responseNew.getSlot().getExecuteStepStr());
|
||||
}
|
||||
|
||||
//测试脚本&规则平滑重载刷新
|
||||
|
||||
@@ -47,7 +47,7 @@ public class LiteflowXmlScriptQLExpressTest extends BaseTest {
|
||||
public void testScript2() {
|
||||
LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain2", "arg");
|
||||
Assert.assertTrue(response.isSuccess());
|
||||
Assert.assertEquals("d==>s2[条件脚本]==>b", response.getSlot().printStep());
|
||||
Assert.assertEquals("d==>s2[条件脚本]==>b", response.getSlot().getExecuteStepStr());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -55,7 +55,7 @@ public class LiteflowXmlScriptQLExpressTest extends BaseTest {
|
||||
//根据配置,加载的应该是flow.xml,执行原来的规则
|
||||
LiteflowResponse<DefaultSlot> responseOld = flowExecutor.execute2Resp("chain2", "arg");
|
||||
Assert.assertTrue(responseOld.isSuccess());
|
||||
Assert.assertEquals("d==>s2[条件脚本]==>b", responseOld.getSlot().printStep());
|
||||
Assert.assertEquals("d==>s2[条件脚本]==>b", responseOld.getSlot().getExecuteStepStr());
|
||||
//更改规则,重新加载,更改的规则内容从flow_update.xml里读取,这里只是为了模拟下获取新的内容。不一定是从文件中读取
|
||||
String newContent = ResourceUtil.readUtf8Str("classpath: /xml-script/flow_update.xml");
|
||||
//进行刷新
|
||||
@@ -64,6 +64,6 @@ public class LiteflowXmlScriptQLExpressTest extends BaseTest {
|
||||
//重新执行chain2这个链路,结果会变
|
||||
LiteflowResponse<DefaultSlot> responseNew = flowExecutor.execute2Resp("chain2", "arg");
|
||||
Assert.assertTrue(responseNew.isSuccess());
|
||||
Assert.assertEquals("d==>s2[条件脚本_改]==>a==>s3[普通脚本_新增]", responseNew.getSlot().printStep());
|
||||
Assert.assertEquals("d==>s2[条件脚本_改]==>a==>s3[普通脚本_新增]", responseNew.getSlot().getExecuteStepStr());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ public class AsyncNodeSpringbootTest extends BaseTest {
|
||||
public void testAsyncFlow1() {
|
||||
LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", "it's a base request");
|
||||
Assert.assertTrue(response.isSuccess());
|
||||
System.out.println(response.getSlot().printStep());
|
||||
System.out.println(response.getSlot().getExecuteStepStr());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -50,7 +50,7 @@ public class AsyncNodeSpringbootTest extends BaseTest {
|
||||
Assert.assertTrue(ListUtil.toList("b==>j==>g==>f==>h","b==>j==>g==>h==>f",
|
||||
"b==>j==>h==>g==>f","b==>j==>h==>f==>g",
|
||||
"b==>j==>f==>h==>g","b==>j==>f==>g==>h"
|
||||
).contains(response.getSlot().printStep()));
|
||||
).contains(response.getSlot().getExecuteStepStr()));
|
||||
}
|
||||
|
||||
//相同group的并行组,会合并,并且errorResume根据第一个when来,这里第一个when配置了不抛错
|
||||
|
||||
@@ -37,7 +37,7 @@ public class LiteflowRetrySpringbootTest extends BaseTest {
|
||||
public void testRetry1() {
|
||||
LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", "arg");
|
||||
Assert.assertTrue(response.isSuccess());
|
||||
Assert.assertEquals("a==>b==>b==>b", response.getSlot().printStep());
|
||||
Assert.assertEquals("a==>b==>b==>b", response.getSlot().getExecuteStepStr());
|
||||
}
|
||||
|
||||
//单个组件重试配置测试
|
||||
@@ -45,7 +45,7 @@ public class LiteflowRetrySpringbootTest extends BaseTest {
|
||||
public void testRetry2() {
|
||||
LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain2", "arg");
|
||||
Assert.assertFalse(response.isSuccess());
|
||||
Assert.assertEquals("c==>c==>c==>c==>c==>c", response.getSlot().printStep());
|
||||
Assert.assertEquals("c==>c==>c==>c==>c==>c", response.getSlot().getExecuteStepStr());
|
||||
}
|
||||
|
||||
//单个组件指定异常,但抛出的并不是指定异常的场景测试
|
||||
@@ -60,6 +60,6 @@ public class LiteflowRetrySpringbootTest extends BaseTest {
|
||||
public void testRetry4() {
|
||||
LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain4", "arg");
|
||||
Assert.assertFalse(response.isSuccess());
|
||||
Assert.assertEquals("e==>e==>e==>e==>e==>e", response.getSlot().printStep());
|
||||
Assert.assertEquals("e==>e==>e==>e==>e==>e", response.getSlot().getExecuteStepStr());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ public class FlowExecutorTest extends BaseTest {
|
||||
public void testIsEnd() throws Exception {
|
||||
LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain4", 10);
|
||||
Assert.assertTrue(response.isSuccess());
|
||||
Assert.assertEquals("d",response.getSlot().printStep());
|
||||
Assert.assertEquals("d",response.getSlot().getExecuteStepStr());
|
||||
}
|
||||
|
||||
//setIsEnd方法的功能点测试
|
||||
@@ -75,7 +75,7 @@ public class FlowExecutorTest extends BaseTest {
|
||||
public void testSetIsEnd1() throws Exception {
|
||||
LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain5", 10);
|
||||
Assert.assertTrue(response.isSuccess());
|
||||
Assert.assertEquals("e",response.getSlot().printStep());
|
||||
Assert.assertEquals("e",response.getSlot().getExecuteStepStr());
|
||||
}
|
||||
|
||||
//条件组件的功能点测试
|
||||
@@ -90,7 +90,7 @@ public class FlowExecutorTest extends BaseTest {
|
||||
public void testSetIsEnd2() throws Exception {
|
||||
LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain7", 10);
|
||||
Assert.assertTrue(response.isSuccess());
|
||||
Assert.assertEquals("g",response.getSlot().printStep());
|
||||
Assert.assertEquals("g",response.getSlot().getExecuteStepStr());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -33,6 +33,6 @@ public class FlowMetaSpringbootTest extends BaseTest {
|
||||
FlowBus.addCommonNode("d", "d组件", DCmp.class);
|
||||
LiteflowResponse<DefaultSlot> response= flowExecutor.execute2Resp("chain1", "it's a request");
|
||||
Assert.assertTrue(response.isSuccess());
|
||||
Assert.assertEquals("a==>b==>c==>d[d组件]", response.getSlot().printStep());
|
||||
Assert.assertEquals("a==>b==>c==>d[d组件]", response.getSlot().getExecuteStepStr());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +34,6 @@ public class LiteflowComponentSpringbootTest extends BaseTest {
|
||||
public void testConfig() {
|
||||
LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", "arg");
|
||||
Assert.assertTrue(response.isSuccess());
|
||||
Assert.assertEquals("a[A组件]==>b[B组件]==>c[C组件]==>b[B组件]==>a[A组件]==>d", response.getSlot().printStep());
|
||||
Assert.assertEquals("a[A组件]==>b[B组件]==>c[C组件]==>b[B组件]==>a[A组件]==>d", response.getSlot().getExecuteStepStr());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,9 +34,9 @@ public class LiteflowMultipleTypeSpringbootTest extends BaseTest {
|
||||
public void testConfig() {
|
||||
LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", "arg");
|
||||
Assert.assertTrue(response.isSuccess());
|
||||
Assert.assertEquals("a==>b==>c==>b==>a", response.getSlot().printStep());
|
||||
Assert.assertEquals("a==>b==>c==>b==>a", response.getSlot().getExecuteStepStr());
|
||||
response = flowExecutor.execute2Resp("chain3", "arg");
|
||||
Assert.assertTrue(response.isSuccess());
|
||||
Assert.assertEquals("a==>b==>c", response.getSlot().printStep());
|
||||
Assert.assertEquals("a==>b==>c", response.getSlot().getExecuteStepStr());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ public class PreAndFinallySpringbootTest extends BaseTest {
|
||||
public void testPreAndFinally1() throws Exception{
|
||||
LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", "arg");
|
||||
Assert.assertTrue(response.isSuccess());
|
||||
Assert.assertEquals("p1==>p2==>a==>b==>c==>f1==>f2",response.getSlot().printStep());
|
||||
Assert.assertEquals("p1==>p2==>a==>b==>c==>f1==>f2",response.getSlot().getExecuteStepStr());
|
||||
}
|
||||
|
||||
//测试pre和finally节点不放在开头和结尾的情况
|
||||
@@ -43,7 +43,7 @@ public class PreAndFinallySpringbootTest extends BaseTest {
|
||||
public void testPreAndFinally2() throws Exception{
|
||||
LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain2", "arg");
|
||||
Assert.assertTrue(response.isSuccess());
|
||||
Assert.assertEquals("p1==>p2==>a==>b==>c==>f1==>f2",response.getSlot().printStep());
|
||||
Assert.assertEquals("p1==>p2==>a==>b==>c==>f1==>f2",response.getSlot().getExecuteStepStr());
|
||||
}
|
||||
|
||||
//测试有节点报错是否还执行finally节点的情况,其中d节点会报错,但依旧执行f1,f2节点
|
||||
@@ -51,7 +51,7 @@ public class PreAndFinallySpringbootTest extends BaseTest {
|
||||
public void testPreAndFinally3() throws Exception{
|
||||
LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain3", "arg");
|
||||
Assert.assertFalse(response.isSuccess());
|
||||
Assert.assertEquals("p1==>p2==>a==>d==>f1==>f2", response.getSlot().printStep());
|
||||
Assert.assertEquals("p1==>p2==>a==>d==>f1==>f2", response.getSlot().getExecuteStepStr());
|
||||
}
|
||||
|
||||
//测试在finally节点里是否能获取exception
|
||||
|
||||
@@ -39,7 +39,7 @@ public class ImplicitSubFlowTest extends BaseTest {
|
||||
public void testImplicitSubFlow() {
|
||||
LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain3", "it's a request");
|
||||
Assert.assertTrue(response.isSuccess());
|
||||
Assert.assertEquals("f==>g==>h==>m", response.getSlot().printStep());
|
||||
Assert.assertEquals("f==>g==>h==>m", response.getSlot().getExecuteStepStr());
|
||||
|
||||
// 传递了slotIndex,则set的size==1
|
||||
Assert.assertEquals(1, RUN_TIME_SLOT.size());
|
||||
|
||||
@@ -38,7 +38,7 @@ public class SubflowInDifferentConfigTest extends BaseTest {
|
||||
public void testExplicitSubFlow1() {
|
||||
LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", "it's a request");
|
||||
Assert.assertTrue(response.isSuccess());
|
||||
Assert.assertEquals("a==>b==>b==>a==>e==>d", response.getSlot().printStep());
|
||||
Assert.assertEquals("a==>b==>b==>a==>e==>d", response.getSlot().getExecuteStepStr());
|
||||
}
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -35,6 +35,6 @@ public class SubflowJsonSpringBootTest extends BaseTest {
|
||||
public void testExplicitSubFlow() {
|
||||
LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", "it's a request");
|
||||
Assert.assertTrue(response.isSuccess());
|
||||
Assert.assertEquals("a==>b==>c==>b==>a==>e==>d", response.getSlot().printStep());
|
||||
Assert.assertEquals("a==>b==>c==>b==>a==>e==>d", response.getSlot().getExecuteStepStr());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,6 +35,6 @@ public class SubflowXMLSpringBootTest extends BaseTest {
|
||||
public void testExplicitSubFlow() {
|
||||
LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", "it's a request");
|
||||
Assert.assertTrue(response.isSuccess());
|
||||
Assert.assertEquals("a==>b==>c==>b==>a==>e==>d", response.getSlot().printStep());
|
||||
Assert.assertEquals("a==>b==>c==>b==>a==>e==>d", response.getSlot().getExecuteStepStr());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,6 +35,6 @@ public class SubflowYmlSpringBootTest extends BaseTest {
|
||||
public void testExplicitSubFlowYml() {
|
||||
LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", "it's a request");
|
||||
Assert.assertTrue(response.isSuccess());
|
||||
Assert.assertEquals("a==>b==>c==>b==>a==>e==>d", response.getSlot().printStep());
|
||||
Assert.assertEquals("a==>b==>c==>b==>a==>e==>d", response.getSlot().getExecuteStepStr());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ public class NodeTagSpringbootJsonTest extends BaseTest {
|
||||
public void testTag2() throws Exception{
|
||||
LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain2", "arg");
|
||||
Assert.assertTrue(response.isSuccess());
|
||||
Assert.assertEquals("a==>a==>a==>c==>e", response.getSlot().printStep());
|
||||
Assert.assertEquals("a==>a==>a==>c==>e", response.getSlot().getExecuteStepStr());
|
||||
}
|
||||
|
||||
//测试多线程when情况下的tag取值是否正确
|
||||
@@ -62,6 +62,6 @@ public class NodeTagSpringbootJsonTest extends BaseTest {
|
||||
public void testTag4() throws Exception{
|
||||
LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain4", "arg");
|
||||
Assert.assertTrue(response.isSuccess());
|
||||
Assert.assertEquals("g", response.getSlot().printStep());
|
||||
Assert.assertEquals("g", response.getSlot().getExecuteStepStr());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ public class NodeTagSpringbootXmlTest extends BaseTest {
|
||||
public void testTag2() throws Exception{
|
||||
LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain2", "arg");
|
||||
Assert.assertTrue(response.isSuccess());
|
||||
Assert.assertEquals("a==>a==>a==>c==>e", response.getSlot().printStep());
|
||||
Assert.assertEquals("a==>a==>a==>c==>e", response.getSlot().getExecuteStepStr());
|
||||
}
|
||||
|
||||
//测试多线程when情况下的tag取值是否正确
|
||||
@@ -62,6 +62,6 @@ public class NodeTagSpringbootXmlTest extends BaseTest {
|
||||
public void testTag4() throws Exception{
|
||||
LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain4", "arg");
|
||||
Assert.assertTrue(response.isSuccess());
|
||||
Assert.assertEquals("g", response.getSlot().printStep());
|
||||
Assert.assertEquals("g", response.getSlot().getExecuteStepStr());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,10 +54,10 @@ public class LiteflowConfigNoSpringTest extends BaseTest {
|
||||
executor.setLiteflowConfig(config);
|
||||
executor.init();
|
||||
LiteflowResponse<DefaultSlot> response0 = executor.execute2Resp("chain1", "arg");
|
||||
Assert.assertEquals("a==>b==>c", response0.getSlot().printStep());
|
||||
Assert.assertEquals("a==>b==>c", response0.getSlot().getExecuteStepStr());
|
||||
|
||||
LiteflowResponse<DefaultSlot> response1 = executor.execute2Resp("chain3", "arg");
|
||||
Assert.assertEquals("a==>c==>f==>g", response1.getSlot().printStep());
|
||||
Assert.assertEquals("a==>c==>f==>g", response1.getSlot().getExecuteStepStr());
|
||||
|
||||
}
|
||||
|
||||
@@ -75,9 +75,9 @@ public class LiteflowConfigNoSpringTest extends BaseTest {
|
||||
executor.setLiteflowConfig(config);
|
||||
executor.init();
|
||||
LiteflowResponse<DefaultSlot> response0 = executor.execute2Resp("chain1", "arg");
|
||||
Assert.assertEquals("a==>b==>c", response0.getSlot().printStep());
|
||||
Assert.assertEquals("a==>b==>c", response0.getSlot().getExecuteStepStr());
|
||||
LiteflowResponse<DefaultSlot> response1 = executor.execute2Resp("chain3", "arg");
|
||||
Assert.assertEquals("a==>c==>f==>g", response1.getSlot().printStep());
|
||||
Assert.assertEquals("a==>c==>f==>g", response1.getSlot().getExecuteStepStr());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -94,8 +94,8 @@ public class LiteflowConfigNoSpringTest extends BaseTest {
|
||||
executor.setLiteflowConfig(config);
|
||||
executor.init();
|
||||
LiteflowResponse<DefaultSlot> response0 = executor.execute2Resp("chain1", "arg");
|
||||
Assert.assertEquals("a==>b==>c", response0.getSlot().printStep());
|
||||
Assert.assertEquals("a==>b==>c", response0.getSlot().getExecuteStepStr());
|
||||
LiteflowResponse<DefaultSlot> response = executor.execute2Resp("chain3", "arg");
|
||||
Assert.assertEquals("a==>c==>f==>g", response.getSlot().printStep());
|
||||
Assert.assertEquals("a==>c==>f==>g", response.getSlot().getExecuteStepStr());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,8 +32,8 @@ public class LocalRuleSourcePatternMatchSpringTest extends BaseTest {
|
||||
@Test
|
||||
public void testLocalJsonRuleSourcePatternMatch() {
|
||||
LiteflowResponse<DefaultSlot> response0 = executor.execute2Resp("chain1", "arg");
|
||||
Assert.assertEquals("a==>b==>c", response0.getSlot().printStep());
|
||||
Assert.assertEquals("a==>b==>c", response0.getSlot().getExecuteStepStr());
|
||||
LiteflowResponse<DefaultSlot> response1 = executor.execute2Resp("chain3", "arg");
|
||||
Assert.assertEquals("a==>c==>f==>g", response1.getSlot().printStep());
|
||||
Assert.assertEquals("a==>c==>f==>g", response1.getSlot().getExecuteStepStr());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ public class ZkNodeWithJsonSpringTest extends BaseTest {
|
||||
public void test() {
|
||||
LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", "arg");
|
||||
Assert.assertTrue(response.isSuccess());
|
||||
Assert.assertEquals("a==>b==>c", response.getSlot().printStep());
|
||||
Assert.assertEquals("a==>b==>c", response.getSlot().getExecuteStepStr());
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
|
||||
@@ -67,7 +67,7 @@ public class ZkNodeWithXmlSpringTest extends BaseTest {
|
||||
public void test() {
|
||||
LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", "arg");
|
||||
Assert.assertTrue(response.isSuccess());
|
||||
Assert.assertEquals("a==>b==>c", response.getSlot().printStep());
|
||||
Assert.assertEquals("a==>b==>c", response.getSlot().getExecuteStepStr());
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
|
||||
@@ -73,7 +73,7 @@ public class ZkNodeWithYmlSpringTest extends BaseTest {
|
||||
public void test() {
|
||||
LiteflowResponse<DefaultSlot> response = flowExecutor.execute2Resp("chain1", "arg");
|
||||
Assert.assertTrue(response.isSuccess());
|
||||
Assert.assertEquals("a==>b==>c", response.getSlot().printStep());
|
||||
Assert.assertEquals("a==>b==>c", response.getSlot().getExecuteStepStr());
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
|
||||
Reference in New Issue
Block a user