enhancement #I4OQIX 组件执行轨迹日志级别调整

This commit is contained in:
bryan31
2022-01-05 22:49:42 +08:00
parent 5e0aef9349
commit 1442dda987
29 changed files with 74 additions and 63 deletions

View File

@@ -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配置了不抛错

View File

@@ -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());
}
}

View File

@@ -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());
}
}

View File

@@ -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());
}
}

View File

@@ -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());
}
}

View File

@@ -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());
}
}

View File

@@ -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

View File

@@ -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());

View File

@@ -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

View File

@@ -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());
}
}

View File

@@ -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());
}
}

View File

@@ -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());
}
}

View File

@@ -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());
}
}

View File

@@ -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());
}
}