mirror of
https://gitee.com/dromara/liteFlow.git
synced 2026-05-15 04:22:09 +08:00
@@ -1,6 +1,7 @@
|
||||
package com.yomahub.liteflow.test.exception;
|
||||
|
||||
import com.yomahub.liteflow.core.FlowExecutor;
|
||||
import com.yomahub.liteflow.exception.ChainDuplicateException;
|
||||
import com.yomahub.liteflow.exception.ConfigErrorException;
|
||||
import com.yomahub.liteflow.exception.FlowExecutorNotInitException;
|
||||
import com.yomahub.liteflow.property.LiteflowConfig;
|
||||
@@ -26,6 +27,16 @@ public class Exception1SpringTest extends BaseTest {
|
||||
@Resource
|
||||
private FlowExecutor flowExecutor;
|
||||
|
||||
/**
|
||||
* 验证 chain 节点重复的异常
|
||||
*/
|
||||
@Test(expected = ChainDuplicateException.class)
|
||||
public void testChainDuplicateException() {
|
||||
LiteflowConfig config = LiteflowConfigGetter.get();
|
||||
config.setRuleSource("exception/flow-exception.xml");
|
||||
flowExecutor.init();
|
||||
}
|
||||
|
||||
@Test(expected = ConfigErrorException.class)
|
||||
public void testConfigErrorException() {
|
||||
flowExecutor.setLiteflowConfig(null);
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<flow>
|
||||
<chain name="chain1">
|
||||
<then value="a,b,c"/>
|
||||
</chain>
|
||||
|
||||
<chain name="chain1">
|
||||
<then value="a,b,c"/>
|
||||
</chain>
|
||||
</flow>
|
||||
Reference in New Issue
Block a user