!60 chain重名的检测

Merge pull request !60 from 与或非/issues/I5BR5M
This commit is contained in:
铂赛东
2022-06-13 12:57:34 +00:00
committed by Gitee
20 changed files with 176 additions and 55 deletions

View File

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

View File

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