From a3b94804d4d328847ea14d66de548df2693e8d2e Mon Sep 17 00:00:00 2001 From: hujie Date: Thu, 11 Oct 2018 19:07:47 +0800 Subject: [PATCH] CI No environment --- .../acl/plug/engine/PlainAclPlugEngineTest.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) 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 bf3ec8da..f3f25f80 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)); -- GitLab