Merge branch 'dev' of https://gitee.com/dromara/liteFlow into issue/#I8MW6Q-2

This commit is contained in:
Dale Lee
2024-01-17 21:24:59 +08:00
112 changed files with 366 additions and 237 deletions

View File

@@ -26,7 +26,7 @@ import javax.annotation.Resource;
@TestPropertySource(value = "classpath:/common/application.properties")
@SpringBootTest(classes = ScriptPythonCommonELTest.class)
@EnableAutoConfiguration
@ComponentScan({ "com.yomahub.liteflow.test.script.python.common.cmp" })
@ComponentScan({ "com.yomahub.liteflow.test.script.python.common.cmp","com.yomahub.liteflow.test.script.python.common.domain" })
public class ScriptPythonCommonELTest extends BaseTest {
@Resource
@@ -40,6 +40,7 @@ public class ScriptPythonCommonELTest extends BaseTest {
Assertions.assertTrue(response.isSuccess());
Assertions.assertEquals(Integer.valueOf(30), context.getData("s1"));
Assertions.assertEquals("杰克", context.getData("name"));
Assertions.assertEquals("hi,jack", context.getData("td"));
}
}

View File

@@ -0,0 +1,13 @@
package com.yomahub.liteflow.test.script.python.common.domain;
import com.yomahub.liteflow.script.annotation.ScriptBean;
import org.springframework.stereotype.Component;
@Component
@ScriptBean("td")
public class TestDomain {
public String sayHi(String name){
return "hi," + name;
}
}

View File

@@ -16,10 +16,11 @@
b=10
if a>5:
b=5
print 'hello'
print '你好'.decode('UTF-8')
else:
print 'hi'
defaultContext.setData("s1",a*b)
defaultContext.setData("td", td.sayHi("jack"))
]]>
</node>