修复windows场景下无法解析模糊路径的bug
This commit is contained in:
parent
252c81dd15
commit
3a25c35b62
|
@ -136,8 +136,8 @@ public class FlowExecutor {
|
|||
// 查找对应的解析器
|
||||
parser = FlowParserProvider.lookup(path);
|
||||
parserNameSet.add(parser.getClass().getName());
|
||||
// 替换掉前缀标识(如:xml:/json:),保留剩下的完整地址
|
||||
path = ReUtil.replaceAll(path, PREFIX_FORMAT_CONFIG_REGEX, "");
|
||||
// 替换掉前缀标识(如:xml:/json:),保留剩下的完整地址,并统一路径格式
|
||||
path = ReUtil.replaceAll(path, PREFIX_FORMAT_CONFIG_REGEX, "").replace("\\", "/");
|
||||
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
|
||||
public static void createFiles() {
|
||||
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
|
||||
public static void createFiles() {
|
||||
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
|
||||
public static void createFiles() {
|
||||
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
|
||||
public static void createFiles() {
|
||||
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
|
||||
public static void createFiles() {
|
||||
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
|
||||
public static void createFiles() {
|
||||
rootDir = FileUtil.getAbsolutePath(ResourceUtil.getResource("").getPath());
|
||||
|
|
Loading…
Reference in New Issue