增加tag的测试用例

This commit is contained in:
everywhere.z
2025-09-05 12:44:16 +08:00
parent 11695222b9
commit a6fd30fd4a
2 changed files with 30 additions and 1 deletions

View File

@@ -20,6 +20,7 @@ import javax.annotation.Resource;
@TestPropertySource(value = "classpath:/tag/application.properties")
@SpringBootTest(classes = ScriptJavaxProTagTest.class)
@EnableAutoConfiguration
@ComponentScan({ "com.yomahub.liteflow.test.script.javapro.tag.aspect" })
public class ScriptJavaxProTagTest extends BaseTest {
@Resource
@@ -28,7 +29,7 @@ public class ScriptJavaxProTagTest extends BaseTest {
// 测试同id的节点在when场景中tag是否正常
@Test
public void testTag1() throws Exception {
for (int i = 0; i < 1000; i++) {
for (int i = 0; i < 1; i++) {
LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg");
DefaultContext context = response.getFirstContextBean();
Assertions.assertTrue(response.isSuccess());

View File

@@ -0,0 +1,28 @@
package com.yomahub.liteflow.test.script.javapro.tag.aspect;
import com.yomahub.liteflow.aop.ICmpAroundAspect;
import com.yomahub.liteflow.core.NodeComponent;
import org.springframework.stereotype.Component;
@Component
public class GlobalAspect implements ICmpAroundAspect {
@Override
public void beforeProcess(NodeComponent cmp) {
System.out.println("组件" + cmp.getNodeId() + "切面获取的tag" + cmp.getTag());
}
@Override
public void afterProcess(NodeComponent cmp) {
}
@Override
public void onSuccess(NodeComponent cmp) {
}
@Override
public void onError(NodeComponent cmp, Exception e) {
}
}