commit
1dbcc9bba7
|
@ -136,8 +136,8 @@ public class FlowExecutor {
|
||||||
// 查找对应的解析器
|
// 查找对应的解析器
|
||||||
parser = FlowParserProvider.lookup(path);
|
parser = FlowParserProvider.lookup(path);
|
||||||
parserNameSet.add(parser.getClass().getName());
|
parserNameSet.add(parser.getClass().getName());
|
||||||
// 替换掉前缀标识(如:xml:/json:),保留剩下的完整地址
|
// 替换掉前缀标识(如:xml:/json:),保留剩下的完整地址,并统一路径格式
|
||||||
path = ReUtil.replaceAll(path, PREFIX_FORMAT_CONFIG_REGEX, "");
|
path = ReUtil.replaceAll(path, PREFIX_FORMAT_CONFIG_REGEX, "").replace("\\", "/");
|
||||||
rulePathList.add(path);
|
rulePathList.add(path);
|
||||||
|
|
||||||
// 支持多类型的配置文件,分别解析
|
// 支持多类型的配置文件,分别解析
|
||||||
|
|
|
@ -63,6 +63,16 @@ public class AbsoluteConfigPathELDeclMultiSpringbootTest extends BaseTest {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testAbsPath() throws Exception{
|
||||||
|
Assertions.assertTrue(() -> {
|
||||||
|
LiteflowConfig config = LiteflowConfigGetter.get();
|
||||||
|
config.setRuleSource(StrUtil.format("{}\\sub\\**\\*.xml",rootDir));
|
||||||
|
flowExecutor.reloadRule();
|
||||||
|
return flowExecutor.execute2Resp("chain1", "arg").isSuccess();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
public static void createFiles() {
|
public static void createFiles() {
|
||||||
rootDir = FileUtil.getAbsolutePath(ResourceUtil.getResource("").getPath());
|
rootDir = FileUtil.getAbsolutePath(ResourceUtil.getResource("").getPath());
|
||||||
|
|
|
@ -65,6 +65,16 @@ public class AbsoluteConfigPathELDeclSpringbootTest extends BaseTest {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testAbsPath() throws Exception{
|
||||||
|
Assertions.assertTrue(() -> {
|
||||||
|
LiteflowConfig config = LiteflowConfigGetter.get();
|
||||||
|
config.setRuleSource(StrUtil.format("{}\\sub\\**\\*.xml",rootDir));
|
||||||
|
flowExecutor.reloadRule();
|
||||||
|
return flowExecutor.execute2Resp("chain1", "arg").isSuccess();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
public static void createFiles() {
|
public static void createFiles() {
|
||||||
rootDir = FileUtil.getAbsolutePath(ResourceUtil.getResource("").getPath());
|
rootDir = FileUtil.getAbsolutePath(ResourceUtil.getResource("").getPath());
|
||||||
|
|
|
@ -50,6 +50,16 @@ public class AbsoluteConfigPathTest extends BaseTest {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testAbsPath() throws Exception{
|
||||||
|
Assertions.assertTrue(() -> {
|
||||||
|
LiteflowConfig config = new LiteflowConfig();
|
||||||
|
config.setRuleSource(StrUtil.format("{}\\sub\\**\\*.xml",rootDir));
|
||||||
|
flowExecutor = FlowExecutorHolder.loadInstance(config);
|
||||||
|
return flowExecutor.execute2Resp("chain1", "arg").isSuccess();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
public static void createFiles() {
|
public static void createFiles() {
|
||||||
rootDir = FileUtil.getAbsolutePath(ResourceUtil.getResource("").getPath());
|
rootDir = FileUtil.getAbsolutePath(ResourceUtil.getResource("").getPath());
|
||||||
|
|
|
@ -56,6 +56,16 @@ public class AbsoluteConfigPathELSpringbootTest extends BaseTest {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testAbsTest() throws Exception {
|
||||||
|
Assertions.assertTrue(() -> {
|
||||||
|
LiteflowConfig config = LiteflowConfigGetter.get();
|
||||||
|
config.setRuleSource(StrUtil.format("{}\\sub\\**\\*.xml",rootDir));
|
||||||
|
flowExecutor.reloadRule();
|
||||||
|
return flowExecutor.execute2Resp("chain1", "arg").isSuccess();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
public static void createFiles() {
|
public static void createFiles() {
|
||||||
rootDir = FileUtil.getAbsolutePath(ResourceUtil.getResource("").getPath());
|
rootDir = FileUtil.getAbsolutePath(ResourceUtil.getResource("").getPath());
|
||||||
|
|
|
@ -70,6 +70,16 @@ public class AbsoluteConfigPathELSpringbootTest extends BaseTest {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testAbsPath4() throws Exception{
|
||||||
|
Assertions.assertTrue(() -> {
|
||||||
|
LiteflowConfig config = LiteflowConfigGetter.get();
|
||||||
|
config.setRuleSource(StrUtil.format("{}\\sub\\a\\*.xml,sub\\b\\*.xml",rootDir));
|
||||||
|
flowExecutor.reloadRule();
|
||||||
|
return flowExecutor.execute2Resp("chain2", "arg").isSuccess();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
public static void createFiles() {
|
public static void createFiles() {
|
||||||
rootDir = FileUtil.getAbsolutePath(ResourceUtil.getResource("").getPath());
|
rootDir = FileUtil.getAbsolutePath(ResourceUtil.getResource("").getPath());
|
||||||
|
|
|
@ -55,6 +55,16 @@ public class AbsoluteConfigPathELSpringTest extends BaseTest {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testAbsPath() throws Exception{
|
||||||
|
Assertions.assertTrue(() -> {
|
||||||
|
LiteflowConfig config = LiteflowConfigGetter.get();
|
||||||
|
config.setRuleSource(StrUtil.format("{}\\sub\\**\\*.xml",rootDir));
|
||||||
|
flowExecutor.reloadRule();
|
||||||
|
return flowExecutor.execute2Resp("chain1", "arg").isSuccess();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
public static void createFiles() {
|
public static void createFiles() {
|
||||||
rootDir = FileUtil.getAbsolutePath(ResourceUtil.getResource("").getPath());
|
rootDir = FileUtil.getAbsolutePath(ResourceUtil.getResource("").getPath());
|
||||||
|
|
Loading…
Reference in New Issue