diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/core/NodeComponent.java b/liteflow-core/src/main/java/com/yomahub/liteflow/core/NodeComponent.java index 1f2f06074..36424aaec 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/core/NodeComponent.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/core/NodeComponent.java @@ -24,7 +24,7 @@ import com.yomahub.liteflow.entity.flow.Node; import com.yomahub.liteflow.entity.monitor.CompStatistics; import com.yomahub.liteflow.flow.FlowBus; import com.yomahub.liteflow.monitor.MonitorBus; -import com.yomahub.liteflow.spring.ComponentScaner; +import com.yomahub.liteflow.spring.ComponentScanner; /** * 普通组件抽象类 @@ -56,15 +56,15 @@ public abstract class NodeComponent { stopWatch.start(); // process前置处理 - if (ObjectUtil.isNotNull(ComponentScaner.cmpAroundAspect)) { - ComponentScaner.cmpAroundAspect.beforeProcess(this.getNodeId(), slot); + if (ObjectUtil.isNotNull(ComponentScanner.cmpAroundAspect)) { + ComponentScanner.cmpAroundAspect.beforeProcess(this.getNodeId(), slot); } self.process(); // process后置处理 - if (ObjectUtil.isNotNull(ComponentScaner.cmpAroundAspect)) { - ComponentScaner.cmpAroundAspect.afterProcess(this.getNodeId(), slot); + if (ObjectUtil.isNotNull(ComponentScanner.cmpAroundAspect)) { + ComponentScanner.cmpAroundAspect.afterProcess(this.getNodeId(), slot); } stopWatch.stop(); diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/JsonFlowParser.java b/liteflow-core/src/main/java/com/yomahub/liteflow/parser/JsonFlowParser.java index 46029074f..e5efcaf97 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/JsonFlowParser.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/parser/JsonFlowParser.java @@ -10,7 +10,7 @@ import com.yomahub.liteflow.core.NodeComponent; import com.yomahub.liteflow.entity.flow.*; import com.yomahub.liteflow.exception.ExecutableItemNotFoundException; import com.yomahub.liteflow.flow.FlowBus; -import com.yomahub.liteflow.spring.ComponentScaner; +import com.yomahub.liteflow.spring.ComponentScanner; import com.yomahub.liteflow.util.SpringAware; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -39,7 +39,7 @@ public abstract class JsonFlowParser extends FlowParser{ public void parse(JSONObject flowJsonObject) throws Exception { try { //判断是以spring方式注册节点,还是以json方式注册 - if(ComponentScaner.nodeComponentMap.isEmpty()){ + if(ComponentScanner.nodeComponentMap.isEmpty()){ JSONArray nodeArrayList = flowJsonObject.getJSONObject("flow").getJSONObject("nodes").getJSONArray("node"); String id; String clazz; @@ -67,7 +67,7 @@ public abstract class JsonFlowParser extends FlowParser{ FlowBus.addNode(id, node); } } else { - for(Map.Entry componentEntry : ComponentScaner.nodeComponentMap.entrySet()){ + for(Map.Entry componentEntry : ComponentScanner.nodeComponentMap.entrySet()){ if(!FlowBus.containNode(componentEntry.getKey())){ FlowBus.addNode(componentEntry.getKey(), new Node(componentEntry.getKey(), componentEntry.getValue().getClass().getName(), componentEntry.getValue())); } diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/XmlFlowParser.java b/liteflow-core/src/main/java/com/yomahub/liteflow/parser/XmlFlowParser.java index 11ad191e8..d74741b5b 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/XmlFlowParser.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/parser/XmlFlowParser.java @@ -1,23 +1,16 @@ package com.yomahub.liteflow.parser; -import cn.hutool.core.collection.CollectionUtil; -import cn.hutool.core.lang.PatternPool; import cn.hutool.core.util.ObjectUtil; -import cn.hutool.core.util.ReUtil; import cn.hutool.core.util.StrUtil; -import com.google.common.collect.Lists; import com.yomahub.liteflow.common.LocalDefaultFlowConstant; import com.yomahub.liteflow.core.NodeComponent; import com.yomahub.liteflow.entity.flow.Chain; import com.yomahub.liteflow.entity.flow.Condition; import com.yomahub.liteflow.entity.flow.Executable; import com.yomahub.liteflow.entity.flow.Node; -import com.yomahub.liteflow.entity.flow.ThenCondition; -import com.yomahub.liteflow.entity.flow.WhenCondition; import com.yomahub.liteflow.exception.ExecutableItemNotFoundException; -import com.yomahub.liteflow.exception.ParseException; import com.yomahub.liteflow.flow.FlowBus; -import com.yomahub.liteflow.spring.ComponentScaner; +import com.yomahub.liteflow.spring.ComponentScanner; import com.yomahub.liteflow.util.SpringAware; import org.dom4j.Document; import org.dom4j.DocumentHelper; @@ -29,7 +22,6 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Map.Entry; -import java.util.regex.Pattern; /** * xml形式的解析器 @@ -52,7 +44,7 @@ public abstract class XmlFlowParser extends FlowParser{ Element rootElement = document.getRootElement(); //判断是以spring方式注册节点,还是以xml方式注册 - if (ComponentScaner.nodeComponentMap.isEmpty()) { + if (ComponentScanner.nodeComponentMap.isEmpty()) { // 解析node节点 List nodeList = rootElement.element("nodes").elements("node"); String id; @@ -81,7 +73,7 @@ public abstract class XmlFlowParser extends FlowParser{ FlowBus.addNode(id, node); } } else { - for (Entry componentEntry : ComponentScaner.nodeComponentMap.entrySet()) { + for (Entry componentEntry : ComponentScanner.nodeComponentMap.entrySet()) { FlowBus.addNode(componentEntry.getKey(), new Node(componentEntry.getKey(), componentEntry.getValue().getClass().getName(), componentEntry.getValue())); } } diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/spring/ComponentScaner.java b/liteflow-core/src/main/java/com/yomahub/liteflow/spring/ComponentScanner.java similarity index 86% rename from liteflow-core/src/main/java/com/yomahub/liteflow/spring/ComponentScaner.java rename to liteflow-core/src/main/java/com/yomahub/liteflow/spring/ComponentScanner.java index 136b3aea4..9cdce584c 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/spring/ComponentScaner.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/spring/ComponentScanner.java @@ -13,10 +13,7 @@ import java.util.Map; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeansException; -import org.springframework.beans.factory.config.BeanPostProcessor; import org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessor; -import org.springframework.core.Ordered; -import org.springframework.core.PriorityOrdered; import com.yomahub.liteflow.aop.ICmpAroundAspect; import com.yomahub.liteflow.core.NodeComponent; @@ -26,11 +23,11 @@ import com.yomahub.liteflow.util.LOGOPrinter; * 组件扫描类,只要是NodeComponent的实现类,都可以被这个扫描器扫到 * @author Bryan.Zhang */ -public class ComponentScaner implements InstantiationAwareBeanPostProcessor { +public class ComponentScanner implements InstantiationAwareBeanPostProcessor { - private static final Logger LOG = LoggerFactory.getLogger(ComponentScaner.class); + private static final Logger LOG = LoggerFactory.getLogger(ComponentScanner.class); - public static Map nodeComponentMap = new HashMap(); + public static Map nodeComponentMap = new HashMap<>(); public static ICmpAroundAspect cmpAroundAspect; @@ -65,4 +62,8 @@ public class ComponentScaner implements InstantiationAwareBeanPostProcessor { return bean; } + + public static void cleanCache(){ + nodeComponentMap.clear(); + } } diff --git a/liteflow-spring-boot-starter/src/main/java/com/yomahub/liteflow/springboot/LiteflowComponentScannerAutoConfiguration.java b/liteflow-spring-boot-starter/src/main/java/com/yomahub/liteflow/springboot/LiteflowComponentScannerAutoConfiguration.java index efeb21516..24829dfb6 100644 --- a/liteflow-spring-boot-starter/src/main/java/com/yomahub/liteflow/springboot/LiteflowComponentScannerAutoConfiguration.java +++ b/liteflow-spring-boot-starter/src/main/java/com/yomahub/liteflow/springboot/LiteflowComponentScannerAutoConfiguration.java @@ -1,6 +1,6 @@ package com.yomahub.liteflow.springboot; -import com.yomahub.liteflow.spring.ComponentScaner; +import com.yomahub.liteflow.spring.ComponentScanner; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -12,7 +12,7 @@ import org.springframework.context.annotation.Configuration; public class LiteflowComponentScannerAutoConfiguration { @Bean - public ComponentScaner componentScaner(){ - return new ComponentScaner(); + public ComponentScanner componentScaner(){ + return new ComponentScanner(); } } diff --git a/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/BaseTest.java b/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/BaseTest.java new file mode 100644 index 000000000..f32ba2dc5 --- /dev/null +++ b/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/BaseTest.java @@ -0,0 +1,12 @@ +package com.yomahub.liteflow.test; + +import com.yomahub.liteflow.spring.ComponentScanner; +import org.junit.AfterClass; + +public class BaseTest { + + @AfterClass + public static void cleanScanCache(){ + ComponentScanner.cleanCache(); + } +} diff --git a/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/aop/LFCustomAOPTest.java b/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/aop/LFCustomAOPTest.java index 90df12546..ce7b4c180 100644 --- a/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/aop/LFCustomAOPTest.java +++ b/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/aop/LFCustomAOPTest.java @@ -3,6 +3,7 @@ package com.yomahub.liteflow.test.aop; import com.yomahub.liteflow.core.FlowExecutor; import com.yomahub.liteflow.entity.data.LiteflowResponse; import com.yomahub.liteflow.entity.data.Slot; +import com.yomahub.liteflow.test.BaseTest; import com.yomahub.liteflow.test.aop.aspect.CustomAspect; import org.junit.Assert; import org.junit.Test; @@ -27,7 +28,7 @@ import javax.annotation.Resource; @EnableAutoConfiguration @Import(CustomAspect.class) @ComponentScan({"com.yomahub.liteflow.test.aop.cmp1","com.yomahub.liteflow.test.aop.cmp2"}) -public class LFCustomAOPTest { +public class LFCustomAOPTest extends BaseTest { @Resource private FlowExecutor flowExecutor; diff --git a/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/aop/LFGlobalAOPTest.java b/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/aop/LFGlobalAOPTest.java index e681f8663..6a1981a01 100644 --- a/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/aop/LFGlobalAOPTest.java +++ b/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/aop/LFGlobalAOPTest.java @@ -3,6 +3,7 @@ package com.yomahub.liteflow.test.aop; import com.yomahub.liteflow.core.FlowExecutor; import com.yomahub.liteflow.entity.data.LiteflowResponse; import com.yomahub.liteflow.entity.data.Slot; +import com.yomahub.liteflow.test.BaseTest; import com.yomahub.liteflow.test.aop.aspect.CmpAspect; import org.junit.Assert; import org.junit.Test; @@ -27,7 +28,7 @@ import javax.annotation.Resource; @EnableAutoConfiguration @Import(CmpAspect.class) @ComponentScan({"com.yomahub.liteflow.test.aop.cmp1","com.yomahub.liteflow.test.aop.cmp2"}) -public class LFGlobalAOPTest { +public class LFGlobalAOPTest extends BaseTest { @Resource private FlowExecutor flowExecutor; diff --git a/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/exception/FlowExecutorTest.java b/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/exception/FlowExecutorTest.java index 50a3bcf68..eae7b0941 100644 --- a/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/exception/FlowExecutorTest.java +++ b/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/exception/FlowExecutorTest.java @@ -7,6 +7,8 @@ import com.yomahub.liteflow.exception.ConfigErrorException; import com.yomahub.liteflow.exception.FlowExecutorNotInitException; import com.yomahub.liteflow.exception.FlowSystemException; import com.yomahub.liteflow.property.LiteflowConfig; +import com.yomahub.liteflow.test.BaseTest; +import org.junit.AfterClass; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; @@ -35,7 +37,7 @@ import javax.annotation.Resource; @SpringBootTest(classes = FlowExecutorTest.class) @EnableAutoConfiguration @ComponentScan({"com.yomahub.liteflow.test.exception.cmp1", "com.yomahub.liteflow.test.exception.cmp2"}) -public class FlowExecutorTest { +public class FlowExecutorTest extends BaseTest { private static final Logger LOG = LoggerFactory.getLogger(FlowExecutorTest.class); @Resource diff --git a/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/parser/LFParserJsonNoSpringTest.java b/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/parser/LFParserJsonNoSpringTest.java index 4964c2c5a..992fb4027 100644 --- a/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/parser/LFParserJsonNoSpringTest.java +++ b/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/parser/LFParserJsonNoSpringTest.java @@ -4,6 +4,7 @@ import com.yomahub.liteflow.core.FlowExecutor; import com.yomahub.liteflow.entity.data.LiteflowResponse; import com.yomahub.liteflow.entity.data.Slot; import com.yomahub.liteflow.property.LiteflowConfig; +import com.yomahub.liteflow.test.BaseTest; import org.junit.Assert; import org.junit.Test; @@ -12,7 +13,7 @@ import org.junit.Test; * @author Bryan.Zhang * @since 2.5.0 */ -public class LFParserJsonNoSpringTest { +public class LFParserJsonNoSpringTest extends BaseTest { //测试无spring场景的json parser @Test diff --git a/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/parser/LFParserJsonSpringTest.java b/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/parser/LFParserJsonSpringTest.java index b0feb0bc1..f07a38df5 100644 --- a/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/parser/LFParserJsonSpringTest.java +++ b/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/parser/LFParserJsonSpringTest.java @@ -3,6 +3,7 @@ package com.yomahub.liteflow.test.parser; import com.yomahub.liteflow.core.FlowExecutor; import com.yomahub.liteflow.entity.data.LiteflowResponse; import com.yomahub.liteflow.entity.data.Slot; +import com.yomahub.liteflow.test.BaseTest; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; @@ -11,9 +12,14 @@ import org.springframework.test.context.junit4.SpringRunner; import javax.annotation.Resource; +/** + * spring环境的json parser单元测试 + * @author Bryan.Zhang + * @since 2.5.0 + */ @RunWith(SpringRunner.class) @ContextConfiguration("classpath:/parser/application-json.xml") -public class LFParserJsonSpringTest { +public class LFParserJsonSpringTest extends BaseTest { @Resource private FlowExecutor flowExecutor; diff --git a/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/parser/LFParserJsonSpringbootTest.java b/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/parser/LFParserJsonSpringbootTest.java index d0ecef599..18ca6b6c8 100644 --- a/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/parser/LFParserJsonSpringbootTest.java +++ b/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/parser/LFParserJsonSpringbootTest.java @@ -3,6 +3,7 @@ package com.yomahub.liteflow.test.parser; import com.yomahub.liteflow.core.FlowExecutor; import com.yomahub.liteflow.entity.data.LiteflowResponse; import com.yomahub.liteflow.entity.data.Slot; +import com.yomahub.liteflow.test.BaseTest; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; @@ -24,7 +25,7 @@ import javax.annotation.Resource; @SpringBootTest(classes = LFParserJsonSpringbootTest.class) @EnableAutoConfiguration @ComponentScan({"com.yomahub.liteflow.test.parser.cmp"}) -public class LFParserJsonSpringbootTest { +public class LFParserJsonSpringbootTest extends BaseTest { @Resource private FlowExecutor flowExecutor; diff --git a/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/parser/LFParserXmlNoSpringTest.java b/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/parser/LFParserXmlNoSpringTest.java index 58e145cbe..e7b9fdac6 100644 --- a/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/parser/LFParserXmlNoSpringTest.java +++ b/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/parser/LFParserXmlNoSpringTest.java @@ -4,6 +4,7 @@ import com.yomahub.liteflow.core.FlowExecutor; import com.yomahub.liteflow.entity.data.LiteflowResponse; import com.yomahub.liteflow.entity.data.Slot; import com.yomahub.liteflow.property.LiteflowConfig; +import com.yomahub.liteflow.test.BaseTest; import org.junit.Assert; import org.junit.Test; @@ -12,7 +13,7 @@ import org.junit.Test; * @author Bryan.Zhang * @since 2.5.0 */ -public class LFParserXmlNoSpringTest { +public class LFParserXmlNoSpringTest extends BaseTest { //测试无spring场景的xml parser @Test diff --git a/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/parser/LFParserXmlSpringTest.java b/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/parser/LFParserXmlSpringTest.java index f7666ae5d..fdcddc2b3 100644 --- a/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/parser/LFParserXmlSpringTest.java +++ b/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/parser/LFParserXmlSpringTest.java @@ -3,6 +3,7 @@ package com.yomahub.liteflow.test.parser; import com.yomahub.liteflow.core.FlowExecutor; import com.yomahub.liteflow.entity.data.LiteflowResponse; import com.yomahub.liteflow.entity.data.Slot; +import com.yomahub.liteflow.test.BaseTest; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; @@ -18,7 +19,7 @@ import javax.annotation.Resource; */ @RunWith(SpringRunner.class) @ContextConfiguration("classpath:/parser/application-xml.xml") -public class LFParserXmlSpringTest { +public class LFParserXmlSpringTest extends BaseTest { @Resource private FlowExecutor flowExecutor; diff --git a/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/parser/LFParserXmlSpringbootTest.java b/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/parser/LFParserXmlSpringbootTest.java index 0e59b088c..48371531f 100644 --- a/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/parser/LFParserXmlSpringbootTest.java +++ b/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/parser/LFParserXmlSpringbootTest.java @@ -4,6 +4,7 @@ import com.yomahub.liteflow.core.FlowExecutor; import com.yomahub.liteflow.entity.data.LiteflowResponse; import com.yomahub.liteflow.entity.data.Slot; import com.yomahub.liteflow.property.LiteflowConfig; +import com.yomahub.liteflow.test.BaseTest; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; @@ -25,7 +26,7 @@ import javax.annotation.Resource; @SpringBootTest(classes = LFParserXmlSpringbootTest.class) @EnableAutoConfiguration @ComponentScan({"com.yomahub.liteflow.test.parser.cmp"}) -public class LFParserXmlSpringbootTest { +public class LFParserXmlSpringbootTest extends BaseTest { @Resource private FlowExecutor flowExecutor; diff --git a/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/parser/LFParserYmlNoSpringTest.java b/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/parser/LFParserYmlNoSpringTest.java index 07f8171d7..8db23d8df 100644 --- a/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/parser/LFParserYmlNoSpringTest.java +++ b/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/parser/LFParserYmlNoSpringTest.java @@ -4,6 +4,7 @@ import com.yomahub.liteflow.core.FlowExecutor; import com.yomahub.liteflow.entity.data.LiteflowResponse; import com.yomahub.liteflow.entity.data.Slot; import com.yomahub.liteflow.property.LiteflowConfig; +import com.yomahub.liteflow.test.BaseTest; import org.junit.Assert; import org.junit.Test; @@ -12,7 +13,7 @@ import org.junit.Test; * @author Bryan.Zhang * @since 2.5.0 */ -public class LFParserYmlNoSpringTest { +public class LFParserYmlNoSpringTest extends BaseTest { //测试无spring场景的yml parser @Test diff --git a/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/parser/LFParserYmlSpringTest.java b/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/parser/LFParserYmlSpringTest.java index 4a129e543..34e2549b4 100644 --- a/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/parser/LFParserYmlSpringTest.java +++ b/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/parser/LFParserYmlSpringTest.java @@ -3,6 +3,7 @@ package com.yomahub.liteflow.test.parser; import com.yomahub.liteflow.core.FlowExecutor; import com.yomahub.liteflow.entity.data.LiteflowResponse; import com.yomahub.liteflow.entity.data.Slot; +import com.yomahub.liteflow.test.BaseTest; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; @@ -18,7 +19,7 @@ import javax.annotation.Resource; */ @RunWith(SpringRunner.class) @ContextConfiguration("classpath:/parser/application-yml.xml") -public class LFParserYmlSpringTest { +public class LFParserYmlSpringTest extends BaseTest { @Resource private FlowExecutor flowExecutor; diff --git a/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/parser/LFParserYmlSpringbootTest.java b/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/parser/LFParserYmlSpringbootTest.java index 018ad49ed..2f3308613 100644 --- a/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/parser/LFParserYmlSpringbootTest.java +++ b/liteflow-spring-boot-starter/src/test/java/com/yomahub/liteflow/test/parser/LFParserYmlSpringbootTest.java @@ -3,6 +3,7 @@ package com.yomahub.liteflow.test.parser; import com.yomahub.liteflow.core.FlowExecutor; import com.yomahub.liteflow.entity.data.LiteflowResponse; import com.yomahub.liteflow.entity.data.Slot; +import com.yomahub.liteflow.test.BaseTest; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; @@ -24,7 +25,7 @@ import javax.annotation.Resource; @SpringBootTest(classes = LFParserYmlSpringbootTest.class) @EnableAutoConfiguration @ComponentScan({"com.yomahub.liteflow.test.parser.cmp"}) -public class LFParserYmlSpringbootTest { +public class LFParserYmlSpringbootTest extends BaseTest { @Resource private FlowExecutor flowExecutor; diff --git a/liteflow-spring-boot-starter/src/test/resources/parser/application-json.xml b/liteflow-spring-boot-starter/src/test/resources/parser/application-json.xml index 097caad32..b04869223 100644 --- a/liteflow-spring-boot-starter/src/test/resources/parser/application-json.xml +++ b/liteflow-spring-boot-starter/src/test/resources/parser/application-json.xml @@ -11,7 +11,7 @@ - + diff --git a/liteflow-spring-boot-starter/src/test/resources/parser/application-xml.xml b/liteflow-spring-boot-starter/src/test/resources/parser/application-xml.xml index 2f490e128..264d48316 100644 --- a/liteflow-spring-boot-starter/src/test/resources/parser/application-xml.xml +++ b/liteflow-spring-boot-starter/src/test/resources/parser/application-xml.xml @@ -11,7 +11,7 @@ - + diff --git a/liteflow-spring-boot-starter/src/test/resources/parser/application-yml.xml b/liteflow-spring-boot-starter/src/test/resources/parser/application-yml.xml index fa166b5ae..4a869d5bd 100644 --- a/liteflow-spring-boot-starter/src/test/resources/parser/application-yml.xml +++ b/liteflow-spring-boot-starter/src/test/resources/parser/application-yml.xml @@ -11,7 +11,7 @@ - + diff --git a/liteflow-test-spring/src/main/resources/applicationContext.xml b/liteflow-test-spring/src/main/resources/applicationContext.xml index 6c9fb5111..d913fcc11 100644 --- a/liteflow-test-spring/src/main/resources/applicationContext.xml +++ b/liteflow-test-spring/src/main/resources/applicationContext.xml @@ -11,7 +11,7 @@ - +