diff --git a/liteflow-benchmark/liteflow-benchmark-common/pom.xml b/liteflow-benchmark/liteflow-benchmark-common/pom.xml
index 2ca89408f..df0661fd8 100644
--- a/liteflow-benchmark/liteflow-benchmark-common/pom.xml
+++ b/liteflow-benchmark/liteflow-benchmark-common/pom.xml
@@ -12,4 +12,13 @@
Title: liteflow
+ *Description: 轻量级的组件式流程框架
+ * @author Bryan.Zhang + * @email weenyc31@163.com + * @Date 2020/4/1 + */ +package com.yomahub.liteflow.benchmark.cmp; + +import com.yomahub.liteflow.annotation.LiteflowComponent; +import com.yomahub.liteflow.core.NodeComponent; + +@LiteflowComponent("a") +public class ACmp extends NodeComponent { + + @Override + public void process() { + } + +} diff --git a/liteflow-benchmark/liteflow-benchmark-common/src/test/java/com/yomahub/liteflow/benchmark/cmp/BCmp.java b/liteflow-benchmark/liteflow-benchmark-common/src/test/java/com/yomahub/liteflow/benchmark/cmp/BCmp.java new file mode 100644 index 000000000..1dc6a517f --- /dev/null +++ b/liteflow-benchmark/liteflow-benchmark-common/src/test/java/com/yomahub/liteflow/benchmark/cmp/BCmp.java @@ -0,0 +1,20 @@ +/** + *Title: liteflow
+ *Description: 轻量级的组件式流程框架
+ * @author Bryan.Zhang + * @email weenyc31@163.com + * @Date 2020/4/1 + */ +package com.yomahub.liteflow.benchmark.cmp; + +import com.yomahub.liteflow.annotation.LiteflowComponent; +import com.yomahub.liteflow.core.NodeComponent; + +@LiteflowComponent("b") +public class BCmp extends NodeComponent { + + @Override + public void process() { + } + +} diff --git a/liteflow-benchmark/liteflow-benchmark-common/src/test/java/com/yomahub/liteflow/benchmark/cmp/CCmp.java b/liteflow-benchmark/liteflow-benchmark-common/src/test/java/com/yomahub/liteflow/benchmark/cmp/CCmp.java new file mode 100644 index 000000000..95ee9b80c --- /dev/null +++ b/liteflow-benchmark/liteflow-benchmark-common/src/test/java/com/yomahub/liteflow/benchmark/cmp/CCmp.java @@ -0,0 +1,20 @@ +/** + *Title: liteflow
+ *Description: 轻量级的组件式流程框架
+ * @author Bryan.Zhang + * @email weenyc31@163.com + * @Date 2020/4/1 + */ +package com.yomahub.liteflow.benchmark.cmp; + +import com.yomahub.liteflow.annotation.LiteflowComponent; +import com.yomahub.liteflow.core.NodeComponent; + +@LiteflowComponent("c") +public class CCmp extends NodeComponent { + + @Override + public void process() { + } + +} diff --git a/liteflow-benchmark/liteflow-benchmark-common/src/test/java/com/yomahub/liteflow/benchmark/cmp/Person.java b/liteflow-benchmark/liteflow-benchmark-common/src/test/java/com/yomahub/liteflow/benchmark/cmp/Person.java new file mode 100644 index 000000000..be665958d --- /dev/null +++ b/liteflow-benchmark/liteflow-benchmark-common/src/test/java/com/yomahub/liteflow/benchmark/cmp/Person.java @@ -0,0 +1,28 @@ +package com.yomahub.liteflow.benchmark.cmp; + +public class Person { + private String name; + + private Integer salary; + + public Person(String name, Integer salary) { + this.name = name; + this.salary = salary; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Integer getSalary() { + return salary; + } + + public void setSalary(Integer salary) { + this.salary = salary; + } +} diff --git a/liteflow-benchmark/liteflow-benchmark-common/src/test/java/com/yomahub/liteflow/benchmark/test/CommonTest.java b/liteflow-benchmark/liteflow-benchmark-common/src/test/java/com/yomahub/liteflow/benchmark/test/CommonTest.java new file mode 100644 index 000000000..2977cb4e3 --- /dev/null +++ b/liteflow-benchmark/liteflow-benchmark-common/src/test/java/com/yomahub/liteflow/benchmark/test/CommonTest.java @@ -0,0 +1,36 @@ +package com.yomahub.liteflow.benchmark.test; + +import cn.hutool.core.io.resource.ResourceUtil; +import com.yomahub.liteflow.builder.LiteFlowNodeBuilder; +import com.yomahub.liteflow.builder.el.LiteFlowChainELBuilder; +import com.yomahub.liteflow.core.FlowExecutor; +import com.yomahub.liteflow.flow.FlowBus; +import com.yomahub.liteflow.flow.LiteflowResponse; +import com.yomahub.liteflow.slot.DefaultContext; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.test.context.TestPropertySource; +import org.springframework.test.context.junit.jupiter.SpringExtension; + +import javax.annotation.Resource; +import java.util.concurrent.*; +import java.util.concurrent.atomic.AtomicLong; + +@ExtendWith(SpringExtension.class) +@TestPropertySource(value = "classpath:application.properties") +@SpringBootTest(classes = CommonTest.class) +@EnableAutoConfiguration +@ComponentScan({ "com.yomahub.liteflow.benchmark.cmp" }) +public class CommonTest { + + @Resource + private FlowExecutor flowExecutor; + + @Test + public void test1() { + flowExecutor.execute2Resp("chain1"); + } +} diff --git a/liteflow-benchmark/liteflow-benchmark-common/src/test/resources/flow.xml b/liteflow-benchmark/liteflow-benchmark-common/src/test/resources/flow.xml index ee2649be2..14bd071aa 100644 --- a/liteflow-benchmark/liteflow-benchmark-common/src/test/resources/flow.xml +++ b/liteflow-benchmark/liteflow-benchmark-common/src/test/resources/flow.xml @@ -2,54 +2,32 @@