补充测试用例

This commit is contained in:
bryan31
2022-03-08 01:14:20 +08:00
parent 7435a9742b
commit 7e41ee441d
17 changed files with 347 additions and 50 deletions

View File

@@ -1,5 +1,6 @@
package com.yomahub.liteflow.test.zookeeper;
import cn.hutool.core.io.resource.ResourceUtil;
import com.yomahub.liteflow.core.FlowExecutor;
import com.yomahub.liteflow.entity.data.DefaultSlot;
import com.yomahub.liteflow.entity.data.LiteflowResponse;
@@ -48,7 +49,7 @@ public class ZkNodeWithJsonSpringbootTest extends BaseTest {
zkServer = new TestingServer(21810);
CountDownLatch latch = new CountDownLatch(1);
new Thread(() -> {
String data = "{\"flow\":{\"chain\":[{\"name\":\"chain1\",\"condition\":[{\"type\":\"then\",\"value\":\"a,b,c\"}]}]}}";
String data = ResourceUtil.readUtf8Str("zookeeper/flow.json");
ZkClient zkClient = new ZkClient("127.0.0.1:21810");
zkClient.setZkSerializer(new ZkSerializer() {
@Override

View File

@@ -1,5 +1,6 @@
package com.yomahub.liteflow.test.zookeeper;
import cn.hutool.core.io.resource.ResourceUtil;
import com.yomahub.liteflow.core.FlowExecutor;
import com.yomahub.liteflow.entity.data.DefaultSlot;
import com.yomahub.liteflow.entity.data.LiteflowResponse;
@@ -48,7 +49,7 @@ public class ZkNodeWithXmlSpringbootTest extends BaseTest {
zkServer = new TestingServer(21810);
CountDownLatch latch = new CountDownLatch(1);
new Thread(() -> {
String data = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><flow><chain name=\"chain1\"><then value=\"a,b,c\"/></chain></flow>";
String data = ResourceUtil.readUtf8Str("zookeeper/flow.xml");
ZkClient zkClient = new ZkClient("127.0.0.1:21810");
zkClient.setZkSerializer(new ZkSerializer() {
@Override

View File

@@ -1,5 +1,6 @@
package com.yomahub.liteflow.test.zookeeper;
import cn.hutool.core.io.resource.ResourceUtil;
import com.yomahub.liteflow.core.FlowExecutor;
import com.yomahub.liteflow.entity.data.DefaultSlot;
import com.yomahub.liteflow.entity.data.LiteflowResponse;
@@ -48,13 +49,7 @@ public class ZkNodeWithYmlSpringbootTest extends BaseTest {
zkServer = new TestingServer(21810);
CountDownLatch latch = new CountDownLatch(1);
new Thread(() -> {
StringBuilder data = new StringBuilder()
.append("flow:\n")
.append(" chain:\n")
.append(" - name: chain1\n")
.append(" condition:\n")
.append(" - type: then\n")
.append(" value: 'a,b,c'");
String data = ResourceUtil.readUtf8Str("zookeeper/flow.yml");
ZkClient zkClient = new ZkClient("127.0.0.1:21810");
zkClient.setZkSerializer(new ZkSerializer() {
@Override

View File

@@ -1,21 +1,5 @@
{
"flow": {
"nodes": {
"node": [
{
"id": "a",
"class": "com.yomahub.liteflow.test.config.cmp.ACmp"
},
{
"id": "b",
"class": "com.yomahub.liteflow.test.config.cmp.BCmp"
},
{
"id": "c",
"class": "com.yomahub.liteflow.test.config.cmp.CCmp"
}
]
},
"chain": [
{
"name": "chain1",