mirror of
https://gitee.com/dromara/liteFlow.git
synced 2026-05-14 12:12:08 +08:00
增加测试用例
This commit is contained in:
@@ -17,6 +17,12 @@
|
||||
<artifactId>liteflow-core</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-classic</artifactId>
|
||||
<version>1.2.3</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.yomahub.liteflow.test;
|
||||
|
||||
import com.yomahub.liteflow.flow.FlowBus;
|
||||
import com.yomahub.liteflow.property.LiteflowConfigGetter;
|
||||
import com.yomahub.liteflow.spi.holder.SpiFactoryCleaner;
|
||||
import com.yomahub.liteflow.thread.ExecutorHelper;
|
||||
import org.junit.AfterClass;
|
||||
|
||||
public class BaseTest {
|
||||
|
||||
@AfterClass
|
||||
public static void cleanScanCache(){
|
||||
FlowBus.cleanCache();
|
||||
ExecutorHelper.loadInstance().clearExecutorServiceMap();
|
||||
SpiFactoryCleaner.clean();
|
||||
LiteflowConfigGetter.clean();
|
||||
}
|
||||
}
|
||||
@@ -7,15 +7,13 @@ import com.yomahub.liteflow.property.LiteflowConfig;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
public class BaseTest {
|
||||
public class BaseCommonTest {
|
||||
|
||||
@Test
|
||||
public void testBase(){
|
||||
LiteflowConfig config = new LiteflowConfig();
|
||||
config.setRuleSource("base/flow.xml");
|
||||
FlowExecutor executor = new FlowExecutor();
|
||||
executor.setLiteflowConfig(config);
|
||||
executor.init();
|
||||
FlowExecutor executor = FlowExecutor.loadInstance(config);
|
||||
LiteflowResponse<DefaultSlot> response = executor.execute2Resp("chain1", "test0");
|
||||
Assert.assertTrue(response.isSuccess());
|
||||
}
|
||||
Reference in New Issue
Block a user