增加benchmark的工程测试

This commit is contained in:
everywhere.z
2024-09-29 18:10:24 +08:00
parent 7c9bf1ebea
commit 857a6d6eac
6 changed files with 75 additions and 5 deletions

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>liteflow-benchmark</artifactId>
<groupId>com.yomahub</groupId>
<version>${revision}</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>liteflow-benchmark-common</artifactId>
</project>

View File

@@ -0,0 +1,2 @@
liteflow.rule-source=flow.xml
liteflow.print-execution-log=false

View File

@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE flow PUBLIC "liteflow" "liteflow.dtd">
<flow>
<nodes>
<node id="s1" name="普通脚本1" type="script" language="groovy">
<![CDATA[
import cn.hutool.core.collection.ListUtil
import cn.hutool.core.date.DateUtil
import java.util.function.Consumer
import java.util.function.Function
import java.util.stream.Collectors
def date = DateUtil.parse("2022-10-17 13:31:43")
defaultContext.setData("demoDate", date)
List<String> list = ListUtil.toList("a", "b", "c")
List<String> resultList = list.stream().map(s -> "hello," + s).collect(Collectors.toList())
defaultContext.setData("resultList", resultList)
class Student {
int studentID
String studentName
}
Student student = new Student()
student.studentID = 100301
student.studentName = "张三"
defaultContext.setData("student", student)
def a = 3
def b = 2
defaultContext.setData("s1", a * b)
]]>
</node>
<node id="s2" name="循环脚本1" type="for_script" language="groovy">
<![CDATA[
return 2
]]>
</node>
<node id="s3" name="选择脚本" type="switch_script" language="groovy">
<![CDATA[
return "b"
]]>
</node>
</nodes>
<chain name="chain1">
THEN(FOR(s2).DO(THEN(a, b, c, s1)), SWITCH(s3).TO(a,b));
</chain>
</flow>

View File

@@ -1,3 +1,2 @@
liteflow.rule-source=flow.xml
liteflow.print-execution-log=false
liteflow.script-setting.javax-is-cache=false
liteflow.print-execution-log=false

View File

@@ -1,3 +1,2 @@
liteflow.rule-source=flow.xml
liteflow.print-execution-log=false
liteflow.script-setting.javax-is-cache=false
liteflow.print-execution-log=false

View File

@@ -46,7 +46,7 @@
<module>liteflow-benchmark-script-javax</module>
<module>liteflow-benchmark-script-java</module>
<module>liteflow-benchmark-script-groovy</module>
<module>liteflow-benchmark-script-kotlin</module>
<module>liteflow-benchmark-common</module>
</modules>
<build>