mirror of
https://gitee.com/dromara/liteFlow.git
synced 2026-05-15 04:22:09 +08:00
补充测试用例
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user