mirror of
https://gitee.com/dromara/liteFlow.git
synced 2026-05-14 20:22:07 +08:00
Merge branch 'dev' of https://gitee.com/dromara/liteFlow into issue/#I8MW6Q-2
This commit is contained in:
@@ -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"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user