增加测试用例

This commit is contained in:
bryan31
2022-02-23 18:24:57 +08:00
parent b9198df609
commit 4a5f436716
60 changed files with 1307 additions and 239 deletions

View File

@@ -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>

View File

@@ -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();
}
}

View File

@@ -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());
}