ELBus中的commonNode方法改成element

This commit is contained in:
everywhere.z
2025-02-22 00:54:46 +08:00
parent ef6f53bd08
commit 236538079f
5 changed files with 9 additions and 9 deletions

View File

@@ -126,7 +126,7 @@ public class ELBus {
* @param nodeId 节点id
* @return {@link CommonNodeELWrapper}
*/
public static CommonNodeELWrapper commonNode(String nodeId){
public static CommonNodeELWrapper element(String nodeId){
return new CommonNodeELWrapper(nodeId);
}

View File

@@ -14,8 +14,8 @@ public class MaxWaitSecondBuilderTest extends BaseTest {
// node层面
@Test
public void testMaxWaitSecond1(){
CommonNodeELWrapper nodeA = ELBus.commonNode("a").maxWaitSeconds(4);
CommonNodeELWrapper nodeB = ELBus.commonNode("b").maxWaitSeconds(4);
CommonNodeELWrapper nodeA = ELBus.element("a").maxWaitSeconds(4);
CommonNodeELWrapper nodeB = ELBus.element("b").maxWaitSeconds(4);
WhenELWrapper whenELWrapper = ELBus.when(nodeA, nodeB);
Assertions.assertEquals("WHEN(a.maxWaitSeconds(4),b.maxWaitSeconds(4));", whenELWrapper.toEL());
}

View File

@@ -16,8 +16,8 @@ public class RetryBuilderTest extends BaseTest {
// node上进行retry
@Test
public void testRetry1(){
CommonNodeELWrapper nodeA = ELBus.commonNode("a").retry(2);
CommonNodeELWrapper nodeB = ELBus.commonNode("b").retry(3);
CommonNodeELWrapper nodeA = ELBus.element("a").retry(2);
CommonNodeELWrapper nodeB = ELBus.element("b").retry(3);
WhenELWrapper whenELWrapper = ELBus.when(nodeA, nodeB);
Assertions.assertEquals("WHEN(a.retry(2),b.retry(3));", whenELWrapper.toEL());
}
@@ -25,8 +25,8 @@ public class RetryBuilderTest extends BaseTest {
// node上进行retry带exception
@Test
public void testRetry2(){
CommonNodeELWrapper nodeA = ELBus.commonNode("a").retry(2, "java.lang.NullPointerException");
CommonNodeELWrapper nodeB = ELBus.commonNode("b").retry(3, "java.lang.NullPointerException", "java.lang.ArrayIndexOutOfBoundsException");
CommonNodeELWrapper nodeA = ELBus.element("a").retry(2, "java.lang.NullPointerException");
CommonNodeELWrapper nodeB = ELBus.element("b").retry(3, "java.lang.NullPointerException", "java.lang.ArrayIndexOutOfBoundsException");
WhenELWrapper whenELWrapper = ELBus.when(nodeA, nodeB);
Assertions.assertEquals("WHEN(a.retry(2,\"java.lang.NullPointerException\"),b.retry(3,\"java.lang.NullPointerException\",\"java.lang.ArrayIndexOutOfBoundsException\"));",
whenELWrapper.toEL());

View File

@@ -28,7 +28,7 @@ public class ThenELBuilderTest extends BaseTest {
name2Value.put("name", "zhangsan");
name2Value.put("age", 18);
String expected = "nodeData = '{\"name\":\"zhangsan\",\"age\":18}';\nTHEN(\n\ta.tag(\"tagA\").data(nodeData).maxWaitSeconds(10).retry(2),\n\tnode(\"b\")\n);";
String actualEl = ELBus.then(ELBus.commonNode("a").data("nodeData", name2Value).tag("tagA").maxWaitSeconds(10).retry(2), ELBus.node("b")).toEL(true);
String actualEl = ELBus.then(ELBus.element("a").data("nodeData", name2Value).tag("tagA").maxWaitSeconds(10).retry(2), ELBus.node("b")).toEL(true);
System.out.println(actualEl);
Assertions.assertEquals(expected, actualEl);
}

View File

@@ -42,7 +42,7 @@ public class LiteflowConfigTest1 extends BaseTest {
Assertions.assertEquals(300000L, config.getDelay().longValue());
Assertions.assertEquals(300000L, config.getPeriod().longValue());
Assertions.assertFalse(config.getEnableLog());
Assertions.assertEquals(16, config.getGlobalThreadPoolSize().longValue());
Assertions.assertEquals(64, config.getGlobalThreadPoolSize().longValue());
Assertions.assertEquals(512, config.getGlobalThreadPoolQueueSize().longValue());
Assertions.assertEquals(ParseModeEnum.PARSE_ALL_ON_START, config.getParseMode());
}