补充测试用例

This commit is contained in:
bryan31
2022-03-05 16:02:51 +08:00
parent 9f9c15ec0c
commit 6b0cc1fd07
4 changed files with 32 additions and 7 deletions

View File

@@ -0,0 +1,29 @@
package com.yomahub.liteflow.test.emptyflow;
import com.yomahub.liteflow.core.FlowExecutor;
import com.yomahub.liteflow.property.LiteflowConfig;
import com.yomahub.liteflow.test.BaseTest;
import org.junit.BeforeClass;
import org.junit.Test;
/**
* 切面场景单元测试
* @author Bryan.Zhang
*/
public class EmptyFlowTest extends BaseTest {
private static FlowExecutor flowExecutor;
@BeforeClass
public static void init(){
LiteflowConfig config = new LiteflowConfig();
config.setRuleSource("emptyflow/flow.xml");
flowExecutor = FlowExecutor.loadInstance(config);
}
//测试空flow的情况下liteflow是否能正常启动
@Test
public void testEmptyFlow() {
//不做任何事,为的是能正常启动
}
}

View File

@@ -1,16 +1,12 @@
package com.yomahub.liteflow.test.emptyflow;
import com.yomahub.liteflow.core.FlowExecutor;
import com.yomahub.liteflow.entity.data.DefaultSlot;
import com.yomahub.liteflow.entity.data.LiteflowResponse;
import com.yomahub.liteflow.test.BaseTest;
import com.yomahub.liteflow.test.aop.aspect.CustomAspect;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Import;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringRunner;
@@ -23,10 +19,10 @@ import javax.annotation.Resource;
*/
@RunWith(SpringRunner.class)
@TestPropertySource(value = "classpath:/emptyFlow/application.properties")
@SpringBootTest(classes = EmptyFlowTest.class)
@SpringBootTest(classes = EmptyFlowSpringbootTest.class)
@EnableAutoConfiguration
@Import(CustomAspect.class)
public class EmptyFlowTest extends BaseTest {
public class EmptyFlowSpringbootTest extends BaseTest {
@Resource
private FlowExecutor flowExecutor;

View File

@@ -15,7 +15,7 @@ import javax.annotation.Resource;
*/
@RunWith(SpringRunner.class)
@ContextConfiguration("classpath:/emptyFlow/application.xml")
public class EmptyFlowTest extends BaseTest {
public class EmptyFlowSpringTest extends BaseTest {
@Resource
private FlowExecutor flowExecutor;