mirror of
https://gitee.com/dromara/liteFlow.git
synced 2026-05-15 04:22:09 +08:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
@@ -24,7 +24,7 @@ public class ToOperator extends Operator {
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
if (objects.length <= 2){
|
||||
if (objects.length <= 1){
|
||||
LOG.error("parameter error");
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import com.yomahub.liteflow.flow.FlowBus;
|
||||
import com.yomahub.liteflow.flow.LiteflowResponse;
|
||||
import com.yomahub.liteflow.flow.element.Chain;
|
||||
import com.yomahub.liteflow.flow.element.Node;
|
||||
import com.yomahub.liteflow.flow.id.IdGeneratorHolder;
|
||||
import com.yomahub.liteflow.parser.*;
|
||||
import com.yomahub.liteflow.parser.base.FlowParser;
|
||||
import com.yomahub.liteflow.parser.el.*;
|
||||
@@ -113,6 +114,9 @@ public class FlowExecutor {
|
||||
//在非spring体系下是一个空实现,等于不做此步骤
|
||||
ContextCmpInitHolder.loadContextCmpInit().initCmp();
|
||||
|
||||
//进行id生成器的初始化
|
||||
IdGeneratorHolder.init();
|
||||
|
||||
//如果没有配置规则文件路径,就停止初始化。
|
||||
//规则文件路径不是一定要有,因为liteflow分基于规则和基于代码两种,有可能是动态代码构建的
|
||||
if (StrUtil.isBlank(liteflowConfig.getRuleSource())) {
|
||||
|
||||
@@ -10,7 +10,6 @@ package com.yomahub.liteflow.flow.element.condition;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.yomahub.liteflow.enums.ConditionTypeEnum;
|
||||
import com.yomahub.liteflow.exception.WhenExecuteException;
|
||||
import com.yomahub.liteflow.flow.element.Executable;
|
||||
import com.yomahub.liteflow.flow.parallel.CompletableFutureTimeout;
|
||||
import com.yomahub.liteflow.flow.parallel.ParallelSupplier;
|
||||
import com.yomahub.liteflow.flow.parallel.WhenFutureObj;
|
||||
@@ -26,7 +25,6 @@ import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
|
||||
@@ -32,8 +32,7 @@ public class NodeExecutorHelper {
|
||||
}
|
||||
|
||||
public NodeExecutor buildNodeExecutor(Class<? extends NodeExecutor> nodeExecutorClass) {
|
||||
// 高频操作-采取apache判空操作-效率高于hutool的isBlank将近3倍
|
||||
if (ObjectUtil.isNull(nodeExecutorClass)) {
|
||||
if (nodeExecutorClass == null) {
|
||||
// 此处使用默认的节点执行器进行执行
|
||||
nodeExecutorClass = DefaultNodeExecutor.class;
|
||||
}
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
package com.yomahub.liteflow.flow.id;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.yomahub.liteflow.exception.RequestIdGeneratorException;
|
||||
import com.yomahub.liteflow.property.LiteflowConfig;
|
||||
import com.yomahub.liteflow.property.LiteflowConfigGetter;
|
||||
import com.yomahub.liteflow.spi.holder.ContextAwareHolder;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Id 生成器帮助器
|
||||
*
|
||||
* @author tangkc
|
||||
*/
|
||||
public class IdGeneratorHelper {
|
||||
|
||||
private static RequestIdGenerator requestIdGenerator;
|
||||
|
||||
private volatile static IdGeneratorHelper INSTANCE;
|
||||
|
||||
private IdGeneratorHelper() {
|
||||
|
||||
}
|
||||
|
||||
public static IdGeneratorHelper getInstance() {
|
||||
if (Objects.isNull(INSTANCE)) {
|
||||
//这里加同步锁是为了避免启动后第一次多并发获取requestId而造成重复初始化的场景
|
||||
//并非每次都会执行这个同步锁,所以不存在性能问题
|
||||
synchronized (IdGeneratorHelper.class) {
|
||||
if (Objects.isNull(INSTANCE)) {
|
||||
INSTANCE = new IdGeneratorHelper();
|
||||
LiteflowConfig liteflowConfig = LiteflowConfigGetter.get();
|
||||
String requestIdGeneratorClass = liteflowConfig.getRequestIdGeneratorClass();
|
||||
if (StrUtil.isBlank(requestIdGeneratorClass)) {
|
||||
requestIdGenerator = new DefaultRequestIdGenerator();
|
||||
}
|
||||
try {
|
||||
Class<RequestIdGenerator> idGenerateClass = (Class<RequestIdGenerator>) Class.forName(requestIdGeneratorClass);
|
||||
requestIdGenerator = ContextAwareHolder.loadContextAware().registerBean(idGenerateClass);
|
||||
} catch (Exception e) {
|
||||
throw new RequestIdGeneratorException(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
public String generate() {
|
||||
return requestIdGenerator.generate();
|
||||
}
|
||||
|
||||
public void clear(){
|
||||
INSTANCE = null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.yomahub.liteflow.flow.id;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.yomahub.liteflow.exception.RequestIdGeneratorException;
|
||||
import com.yomahub.liteflow.property.LiteflowConfig;
|
||||
import com.yomahub.liteflow.property.LiteflowConfigGetter;
|
||||
import com.yomahub.liteflow.spi.holder.ContextAwareHolder;
|
||||
|
||||
/**
|
||||
* Id 生成器帮助器
|
||||
*
|
||||
* @author tangkc
|
||||
*/
|
||||
public class IdGeneratorHolder {
|
||||
|
||||
private RequestIdGenerator requestIdGenerator;
|
||||
|
||||
private static IdGeneratorHolder INSTANCE;
|
||||
|
||||
public static void init(){
|
||||
try{
|
||||
INSTANCE = new IdGeneratorHolder();
|
||||
LiteflowConfig liteflowConfig = LiteflowConfigGetter.get();
|
||||
String requestIdGeneratorClass = liteflowConfig.getRequestIdGeneratorClass();
|
||||
|
||||
RequestIdGenerator requestIdGenerator;
|
||||
if (StrUtil.isBlank(requestIdGeneratorClass)) {
|
||||
requestIdGenerator = new DefaultRequestIdGenerator();
|
||||
} else {
|
||||
Class<RequestIdGenerator> idGenerateClass = (Class<RequestIdGenerator>) Class.forName(requestIdGeneratorClass);
|
||||
requestIdGenerator = ContextAwareHolder.loadContextAware().registerBean(idGenerateClass);
|
||||
}
|
||||
INSTANCE.setRequestIdGenerator(requestIdGenerator);
|
||||
}catch (Exception e) {
|
||||
throw new RequestIdGeneratorException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public static IdGeneratorHolder getInstance() {
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
public String generate() {
|
||||
return requestIdGenerator.generate();
|
||||
}
|
||||
|
||||
public RequestIdGenerator getRequestIdGenerator() {
|
||||
return requestIdGenerator;
|
||||
}
|
||||
|
||||
public void setRequestIdGenerator(RequestIdGenerator requestIdGenerator) {
|
||||
this.requestIdGenerator = requestIdGenerator;
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import com.yomahub.liteflow.exception.NoSuchContextBeanException;
|
||||
import com.yomahub.liteflow.exception.NullParamException;
|
||||
import com.yomahub.liteflow.flow.entity.CmpStep;
|
||||
import com.yomahub.liteflow.flow.id.IdGeneratorHelper;
|
||||
import com.yomahub.liteflow.flow.id.IdGeneratorHolder;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@@ -223,7 +223,7 @@ public class Slot{
|
||||
}
|
||||
|
||||
public void generateRequestId() {
|
||||
metaDataMap.put(REQUEST_ID, IdGeneratorHelper.getInstance().generate());
|
||||
metaDataMap.put(REQUEST_ID, IdGeneratorHolder.getInstance().generate());
|
||||
}
|
||||
|
||||
public String getRequestId() {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.yomahub.liteflow.test;
|
||||
|
||||
import com.yomahub.liteflow.flow.FlowBus;
|
||||
import com.yomahub.liteflow.flow.id.IdGeneratorHelper;
|
||||
import com.yomahub.liteflow.flow.id.IdGeneratorHolder;
|
||||
import com.yomahub.liteflow.property.LiteflowConfigGetter;
|
||||
import com.yomahub.liteflow.spi.holder.SpiFactoryCleaner;
|
||||
import com.yomahub.liteflow.spring.ComponentScanner;
|
||||
@@ -17,7 +17,6 @@ public class BaseTest {
|
||||
ExecutorHelper.loadInstance().clearExecutorServiceMap();
|
||||
SpiFactoryCleaner.clean();
|
||||
LiteflowConfigGetter.clean();
|
||||
IdGeneratorHelper.getInstance().clear();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.yomahub.liteflow.test.note;
|
||||
package com.yomahub.liteflow.test.comments;
|
||||
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import com.yomahub.liteflow.core.FlowExecutor;
|
||||
@@ -16,10 +16,10 @@ import org.springframework.test.context.junit4.SpringRunner;
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@TestPropertySource(value = "classpath:/note/application.properties")
|
||||
@TestPropertySource(value = "classpath:/comments/application.properties")
|
||||
@SpringBootTest(classes = LiteflowNodeELSpringbootTest.class)
|
||||
@EnableAutoConfiguration
|
||||
@ComponentScan({"com.yomahub.liteflow.test.note.cmp"})
|
||||
@ComponentScan({"com.yomahub.liteflow.test.comments.cmp"})
|
||||
public class LiteflowNodeELSpringbootTest extends BaseTest {
|
||||
|
||||
@Resource
|
||||
@@ -5,7 +5,7 @@
|
||||
* @email weenyc31@163.com
|
||||
* @Date 2020/4/1
|
||||
*/
|
||||
package com.yomahub.liteflow.test.note.cmp;
|
||||
package com.yomahub.liteflow.test.comments.cmp;
|
||||
|
||||
import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
|
||||
import com.yomahub.liteflow.annotation.LiteflowMethod;
|
||||
@@ -5,7 +5,7 @@
|
||||
* @email weenyc31@163.com
|
||||
* @Date 2020/4/1
|
||||
*/
|
||||
package com.yomahub.liteflow.test.note.cmp;
|
||||
package com.yomahub.liteflow.test.comments.cmp;
|
||||
|
||||
import cn.hutool.core.thread.ThreadUtil;
|
||||
import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
|
||||
@@ -5,7 +5,7 @@
|
||||
* @email weenyc31@163.com
|
||||
* @Date 2020/4/1
|
||||
*/
|
||||
package com.yomahub.liteflow.test.note.cmp;
|
||||
package com.yomahub.liteflow.test.comments.cmp;
|
||||
|
||||
import cn.hutool.core.thread.ThreadUtil;
|
||||
import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* 测试注释
|
||||
*/
|
||||
package com.yomahub.liteflow.test.comments;
|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* 测试注释
|
||||
*/
|
||||
package com.yomahub.liteflow.test.note;
|
||||
@@ -0,0 +1 @@
|
||||
liteflow.rule-source=comments/flow.el.xml
|
||||
@@ -1 +0,0 @@
|
||||
liteflow.rule-source=note/flow.el.xml
|
||||
@@ -2,7 +2,7 @@ package com.yomahub.liteflow.test;
|
||||
|
||||
import com.yomahub.liteflow.core.FlowExecutorHolder;
|
||||
import com.yomahub.liteflow.flow.FlowBus;
|
||||
import com.yomahub.liteflow.flow.id.IdGeneratorHelper;
|
||||
import com.yomahub.liteflow.flow.id.IdGeneratorHolder;
|
||||
import com.yomahub.liteflow.property.LiteflowConfigGetter;
|
||||
import com.yomahub.liteflow.spi.holder.SpiFactoryCleaner;
|
||||
import com.yomahub.liteflow.thread.ExecutorHelper;
|
||||
@@ -17,6 +17,5 @@ public class BaseTest {
|
||||
SpiFactoryCleaner.clean();
|
||||
LiteflowConfigGetter.clean();
|
||||
FlowExecutorHolder.clean();
|
||||
IdGeneratorHelper.getInstance().clear();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.yomahub.liteflow.test.note;
|
||||
package com.yomahub.liteflow.test.comments;
|
||||
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import com.yomahub.liteflow.core.FlowExecutor;
|
||||
@@ -20,7 +20,7 @@ public class LiteflowNodeTest extends BaseTest {
|
||||
@BeforeClass
|
||||
public static void init(){
|
||||
LiteflowConfig config = new LiteflowConfig();
|
||||
config.setRuleSource("note/flow.el.xml");
|
||||
config.setRuleSource("comments/flow.el.xml");
|
||||
flowExecutor = FlowExecutorHolder.loadInstance(config);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* @email weenyc31@163.com
|
||||
* @Date 2020/4/1
|
||||
*/
|
||||
package com.yomahub.liteflow.test.note.cmp;
|
||||
package com.yomahub.liteflow.test.comments.cmp;
|
||||
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* @email weenyc31@163.com
|
||||
* @Date 2020/4/1
|
||||
*/
|
||||
package com.yomahub.liteflow.test.note.cmp;
|
||||
package com.yomahub.liteflow.test.comments.cmp;
|
||||
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* @email weenyc31@163.com
|
||||
* @Date 2020/4/1
|
||||
*/
|
||||
package com.yomahub.liteflow.test.note.cmp;
|
||||
package com.yomahub.liteflow.test.comments.cmp;
|
||||
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* 测试注释
|
||||
*/
|
||||
package com.yomahub.liteflow.test.comments;
|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* 测试注释
|
||||
*/
|
||||
package com.yomahub.liteflow.test.note;
|
||||
@@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<flow>
|
||||
<nodes>
|
||||
<node id="a" class="com.yomahub.liteflow.test.note.cmp.ACmp"/>
|
||||
<node id="b" class="com.yomahub.liteflow.test.note.cmp.BCmp"/>
|
||||
<node id="c" class="com.yomahub.liteflow.test.note.cmp.CCmp"/>
|
||||
<node id="a" class="com.yomahub.liteflow.test.comments.cmp.ACmp"/>
|
||||
<node id="b" class="com.yomahub.liteflow.test.comments.cmp.BCmp"/>
|
||||
<node id="c" class="com.yomahub.liteflow.test.comments.cmp.CCmp"/>
|
||||
</nodes>
|
||||
|
||||
<chain name="chain1">
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.yomahub.liteflow.test;
|
||||
|
||||
import com.yomahub.liteflow.flow.FlowBus;
|
||||
import com.yomahub.liteflow.flow.id.IdGeneratorHelper;
|
||||
import com.yomahub.liteflow.flow.id.IdGeneratorHolder;
|
||||
import com.yomahub.liteflow.property.LiteflowConfigGetter;
|
||||
import com.yomahub.liteflow.spi.holder.SpiFactoryCleaner;
|
||||
import com.yomahub.liteflow.spring.ComponentScanner;
|
||||
@@ -17,6 +17,5 @@ public class BaseTest {
|
||||
ExecutorHelper.loadInstance().clearExecutorServiceMap();
|
||||
SpiFactoryCleaner.clean();
|
||||
LiteflowConfigGetter.clean();
|
||||
IdGeneratorHelper.getInstance().clear();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.yomahub.liteflow.test;
|
||||
|
||||
import com.yomahub.liteflow.flow.FlowBus;
|
||||
import com.yomahub.liteflow.flow.id.IdGeneratorHelper;
|
||||
import com.yomahub.liteflow.flow.id.IdGeneratorHolder;
|
||||
import com.yomahub.liteflow.property.LiteflowConfigGetter;
|
||||
import com.yomahub.liteflow.spi.holder.SpiFactoryCleaner;
|
||||
import com.yomahub.liteflow.spring.ComponentScanner;
|
||||
@@ -17,6 +17,5 @@ public class BaseTest {
|
||||
ExecutorHelper.loadInstance().clearExecutorServiceMap();
|
||||
SpiFactoryCleaner.clean();
|
||||
LiteflowConfigGetter.clean();
|
||||
IdGeneratorHelper.getInstance().clear();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.yomahub.liteflow.test;
|
||||
|
||||
import com.yomahub.liteflow.flow.FlowBus;
|
||||
import com.yomahub.liteflow.flow.id.IdGeneratorHelper;
|
||||
import com.yomahub.liteflow.flow.id.IdGeneratorHolder;
|
||||
import com.yomahub.liteflow.property.LiteflowConfigGetter;
|
||||
import com.yomahub.liteflow.spi.holder.SpiFactoryCleaner;
|
||||
import com.yomahub.liteflow.spring.ComponentScanner;
|
||||
@@ -17,6 +17,5 @@ public class BaseTest {
|
||||
ExecutorHelper.loadInstance().clearExecutorServiceMap();
|
||||
SpiFactoryCleaner.clean();
|
||||
LiteflowConfigGetter.clean();
|
||||
IdGeneratorHelper.getInstance().clear();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.yomahub.liteflow.test.note;
|
||||
package com.yomahub.liteflow.test.comments;
|
||||
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import com.yomahub.liteflow.core.FlowExecutor;
|
||||
@@ -16,10 +16,10 @@ import org.springframework.test.context.junit4.SpringRunner;
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@TestPropertySource(value = "classpath:/note/application.properties")
|
||||
@TestPropertySource(value = "classpath:/comments/application.properties")
|
||||
@SpringBootTest(classes = LiteflowNodeELSpringbootTest.class)
|
||||
@EnableAutoConfiguration
|
||||
@ComponentScan({"com.yomahub.liteflow.test.note.cmp"})
|
||||
@ComponentScan({"com.yomahub.liteflow.test.comments.cmp"})
|
||||
public class LiteflowNodeELSpringbootTest extends BaseTest {
|
||||
|
||||
@Resource
|
||||
@@ -5,7 +5,7 @@
|
||||
* @email weenyc31@163.com
|
||||
* @Date 2020/4/1
|
||||
*/
|
||||
package com.yomahub.liteflow.test.note.cmp;
|
||||
package com.yomahub.liteflow.test.comments.cmp;
|
||||
|
||||
import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
|
||||
import com.yomahub.liteflow.annotation.LiteflowMethod;
|
||||
@@ -5,7 +5,7 @@
|
||||
* @email weenyc31@163.com
|
||||
* @Date 2020/4/1
|
||||
*/
|
||||
package com.yomahub.liteflow.test.note.cmp;
|
||||
package com.yomahub.liteflow.test.comments.cmp;
|
||||
|
||||
import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
|
||||
import com.yomahub.liteflow.annotation.LiteflowMethod;
|
||||
@@ -5,7 +5,7 @@
|
||||
* @email weenyc31@163.com
|
||||
* @Date 2020/4/1
|
||||
*/
|
||||
package com.yomahub.liteflow.test.note.cmp;
|
||||
package com.yomahub.liteflow.test.comments.cmp;
|
||||
|
||||
import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
|
||||
import com.yomahub.liteflow.annotation.LiteflowMethod;
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* 测试注释
|
||||
*/
|
||||
package com.yomahub.liteflow.test.comments;
|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* 测试注释
|
||||
*/
|
||||
package com.yomahub.liteflow.test.note;
|
||||
@@ -0,0 +1 @@
|
||||
liteflow.rule-source=comments/flow.el.xml
|
||||
@@ -1 +0,0 @@
|
||||
liteflow.rule-source=note/flow.el.xml
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.yomahub.liteflow.test;
|
||||
|
||||
import com.yomahub.liteflow.flow.FlowBus;
|
||||
import com.yomahub.liteflow.flow.id.IdGeneratorHelper;
|
||||
import com.yomahub.liteflow.flow.id.IdGeneratorHolder;
|
||||
import com.yomahub.liteflow.property.LiteflowConfigGetter;
|
||||
import com.yomahub.liteflow.spi.holder.SpiFactoryCleaner;
|
||||
import com.yomahub.liteflow.spring.ComponentScanner;
|
||||
@@ -17,6 +17,5 @@ public class BaseTest {
|
||||
ExecutorHelper.loadInstance().clearExecutorServiceMap();
|
||||
SpiFactoryCleaner.clean();
|
||||
LiteflowConfigGetter.clean();
|
||||
IdGeneratorHelper.getInstance().clear();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.yomahub.liteflow.test.note;
|
||||
package com.yomahub.liteflow.test.comments;
|
||||
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import com.yomahub.liteflow.core.FlowExecutor;
|
||||
@@ -13,7 +13,7 @@ import org.springframework.test.context.junit4.SpringRunner;
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@ContextConfiguration("classpath:/note/application.xml")
|
||||
@ContextConfiguration("classpath:/comments/application.xml")
|
||||
public class LiteflowNodeELSpringbootTest extends BaseTest {
|
||||
|
||||
@Resource
|
||||
@@ -5,7 +5,7 @@
|
||||
* @email weenyc31@163.com
|
||||
* @Date 2020/4/1
|
||||
*/
|
||||
package com.yomahub.liteflow.test.note.cmp;
|
||||
package com.yomahub.liteflow.test.comments.cmp;
|
||||
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
@@ -6,7 +6,7 @@
|
||||
* @email weenyc31@163.com
|
||||
* @Date 2020/4/1
|
||||
*/
|
||||
package com.yomahub.liteflow.test.note.cmp;
|
||||
package com.yomahub.liteflow.test.comments.cmp;
|
||||
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
@@ -6,7 +6,7 @@
|
||||
* @email weenyc31@163.com
|
||||
* @Date 2020/4/1
|
||||
*/
|
||||
package com.yomahub.liteflow.test.note.cmp;
|
||||
package com.yomahub.liteflow.test.comments.cmp;
|
||||
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* 测试注释
|
||||
*/
|
||||
package com.yomahub.liteflow.test.comments;
|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* 测试注释
|
||||
*/
|
||||
package com.yomahub.liteflow.test.note;
|
||||
@@ -7,14 +7,14 @@
|
||||
http://www.springframework.org/schema/context
|
||||
http://www.springframework.org/schema/context/spring-context-4.0.xsd">
|
||||
|
||||
<context:component-scan base-package="com.yomahub.liteflow.test.note.cmp" />
|
||||
<context:component-scan base-package="com.yomahub.liteflow.test.comments.cmp" />
|
||||
|
||||
<bean id="springAware" class="com.yomahub.liteflow.spi.spring.SpringAware"/>
|
||||
|
||||
<bean class="com.yomahub.liteflow.spring.ComponentScanner"/>
|
||||
|
||||
<bean id="liteflowConfig" class="com.yomahub.liteflow.property.LiteflowConfig">
|
||||
<property name="ruleSource" value="note/flow.el.xml"/>
|
||||
<property name="ruleSource" value="comments/flow.el.xml"/>
|
||||
</bean>
|
||||
|
||||
<bean id="flowExecutor" class="com.yomahub.liteflow.core.FlowExecutor">
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.yomahub.liteflow.test;
|
||||
|
||||
import com.yomahub.liteflow.flow.FlowBus;
|
||||
import com.yomahub.liteflow.flow.id.IdGeneratorHelper;
|
||||
import com.yomahub.liteflow.flow.id.IdGeneratorHolder;
|
||||
import com.yomahub.liteflow.property.LiteflowConfigGetter;
|
||||
import com.yomahub.liteflow.spi.holder.SpiFactoryCleaner;
|
||||
import com.yomahub.liteflow.spring.ComponentScanner;
|
||||
@@ -17,7 +17,6 @@ public class BaseTest {
|
||||
ExecutorHelper.loadInstance().clearExecutorServiceMap();
|
||||
SpiFactoryCleaner.clean();
|
||||
LiteflowConfigGetter.clean();
|
||||
IdGeneratorHelper.getInstance().clear();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.yomahub.liteflow.test;
|
||||
|
||||
import com.yomahub.liteflow.core.FlowExecutorHolder;
|
||||
import com.yomahub.liteflow.flow.FlowBus;
|
||||
import com.yomahub.liteflow.flow.id.IdGeneratorHelper;
|
||||
import com.yomahub.liteflow.flow.id.IdGeneratorHolder;
|
||||
import com.yomahub.liteflow.property.LiteflowConfigGetter;
|
||||
import com.yomahub.liteflow.spi.holder.SpiFactoryCleaner;
|
||||
import com.yomahub.liteflow.thread.ExecutorHelper;
|
||||
@@ -17,6 +17,5 @@ public class BaseTest {
|
||||
SpiFactoryCleaner.clean();
|
||||
LiteflowConfigGetter.clean();
|
||||
FlowExecutorHolder.clean();
|
||||
IdGeneratorHelper.getInstance().clear();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.yomahub.liteflow.test.requestId;
|
||||
import com.yomahub.liteflow.core.FlowExecutor;
|
||||
import com.yomahub.liteflow.core.FlowExecutorHolder;
|
||||
import com.yomahub.liteflow.flow.LiteflowResponse;
|
||||
import com.yomahub.liteflow.flow.id.IdGeneratorHelper;
|
||||
import com.yomahub.liteflow.property.LiteflowConfig;
|
||||
import com.yomahub.liteflow.test.BaseTest;
|
||||
import org.junit.Assert;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.yomahub.liteflow.test;
|
||||
|
||||
import com.yomahub.liteflow.flow.FlowBus;
|
||||
import com.yomahub.liteflow.flow.id.IdGeneratorHelper;
|
||||
import com.yomahub.liteflow.flow.id.IdGeneratorHolder;
|
||||
import com.yomahub.liteflow.property.LiteflowConfigGetter;
|
||||
import com.yomahub.liteflow.spi.holder.SpiFactoryCleaner;
|
||||
import com.yomahub.liteflow.spring.ComponentScanner;
|
||||
@@ -17,6 +17,5 @@ public class BaseTest {
|
||||
ExecutorHelper.loadInstance().clearExecutorServiceMap();
|
||||
SpiFactoryCleaner.clean();
|
||||
LiteflowConfigGetter.clean();
|
||||
IdGeneratorHelper.getInstance().clear();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,10 +2,8 @@ package com.yomahub.liteflow.test.requestId;
|
||||
|
||||
import com.yomahub.liteflow.core.FlowExecutor;
|
||||
import com.yomahub.liteflow.flow.LiteflowResponse;
|
||||
import com.yomahub.liteflow.flow.id.IdGeneratorHelper;
|
||||
import com.yomahub.liteflow.test.BaseTest;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.yomahub.liteflow.test;
|
||||
|
||||
import com.yomahub.liteflow.flow.FlowBus;
|
||||
import com.yomahub.liteflow.flow.id.IdGeneratorHelper;
|
||||
import com.yomahub.liteflow.flow.id.IdGeneratorHolder;
|
||||
import com.yomahub.liteflow.property.LiteflowConfigGetter;
|
||||
import com.yomahub.liteflow.spi.holder.SpiFactoryCleaner;
|
||||
import com.yomahub.liteflow.spring.ComponentScanner;
|
||||
@@ -17,6 +17,5 @@ public class BaseTest {
|
||||
ExecutorHelper.loadInstance().clearExecutorServiceMap();
|
||||
SpiFactoryCleaner.clean();
|
||||
LiteflowConfigGetter.clean();
|
||||
IdGeneratorHelper.getInstance().clear();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,10 +2,8 @@ package com.yomahub.liteflow.test.requestId;
|
||||
|
||||
import com.yomahub.liteflow.core.FlowExecutor;
|
||||
import com.yomahub.liteflow.flow.LiteflowResponse;
|
||||
import com.yomahub.liteflow.flow.id.IdGeneratorHelper;
|
||||
import com.yomahub.liteflow.test.BaseTest;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
|
||||
Reference in New Issue
Block a user