diff --git a/acl-plug/src/test/java/org/apache/rocketmq/acl/plug/engine/PlainAclPlugEngineTest.java b/acl-plug/src/test/java/org/apache/rocketmq/acl/plug/engine/PlainAclPlugEngineTest.java index bf3ec8da58ae0142a5d0b64af3da9ea6c1a16256..f3f25f804e125ba4439a74d511697bc3b6070361 100644 --- a/acl-plug/src/test/java/org/apache/rocketmq/acl/plug/engine/PlainAclPlugEngineTest.java +++ b/acl-plug/src/test/java/org/apache/rocketmq/acl/plug/engine/PlainAclPlugEngineTest.java @@ -63,10 +63,18 @@ public class PlainAclPlugEngineTest { InputStream fis=null; if(home == null){ URL url = PlainAclPlugEngineTest.class.getResource("/conf/transport.yml"); - fis = url.openStream(); - url = PlainAclPlugEngineTest.class.getResource("/"); - home = url.toString(); - home = home.substring(0, home.length()-1).replace("file:/", ""); + if(url == null) { + url = PlainAclPlugEngineTest.class.getResource("/"); + home = url.toString(); + home = home.substring(0, home.length()-1).replace("file:/", "").replace("target/test-classes/", ""); + home = home+"resources/conf/transport.yml"; + }else { + fis = url.openStream(); + url = PlainAclPlugEngineTest.class.getResource("/"); + home = url.toString(); + home = home.substring(0, home.length()-1).replace("file:/", ""); + } + }else { String filePath = home + "/conf/transport.yml"; fis = new FileInputStream(new File(filePath));