提交 f691013f 编写于 作者: H hujie

CI No environment 4

上级 bd6f34df
...@@ -25,7 +25,6 @@ import java.util.ArrayList; ...@@ -25,7 +25,6 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import org.apache.rocketmq.acl.plug.entity.AccessControl; import org.apache.rocketmq.acl.plug.entity.AccessControl;
import org.apache.rocketmq.acl.plug.entity.AuthenticationInfo; import org.apache.rocketmq.acl.plug.entity.AuthenticationInfo;
import org.apache.rocketmq.acl.plug.entity.AuthenticationResult; import org.apache.rocketmq.acl.plug.entity.AuthenticationResult;
...@@ -60,24 +59,15 @@ public class PlainAclPlugEngineTest { ...@@ -60,24 +59,15 @@ public class PlainAclPlugEngineTest {
public void init() throws NoSuchFieldException, SecurityException, IOException { public void init() throws NoSuchFieldException, SecurityException, IOException {
Yaml ymal = new Yaml(); Yaml ymal = new Yaml();
String home = System.getProperty(MixAll.ROCKETMQ_HOME_PROPERTY, System.getenv(MixAll.ROCKETMQ_HOME_ENV)); String home = System.getProperty(MixAll.ROCKETMQ_HOME_PROPERTY, System.getenv(MixAll.ROCKETMQ_HOME_ENV));
InputStream fis=null; InputStream fis = null;
if(home == null){ if (home == null) {
URL url = PlainAclPlugEngineTest.class.getResource("/conf/transport.yml"); URL url = PlainAclPlugEngineTest.class.getResource("/");
if(url == null) {
url = PlainAclPlugEngineTest.class.getResource("/");
home = url.toString(); home = url.toString();
home = home.substring(0, home.length()-1).replace("file:/", "").replace("target/test-classes", ""); home = home.substring(0, home.length() - 1).replace("file:/", "").replace("target/test-classes", "");
home = home+"src/test/resources"; home = home + "src/test/resources";
String filePath = home+"/conf/transport.yml"; String filePath = home + "/conf/transport.yml";
fis = new FileInputStream(new File(filePath)); fis = new FileInputStream(new File(filePath));
}else { } 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"; String filePath = home + "/conf/transport.yml";
fis = new FileInputStream(new File(filePath)); fis = new FileInputStream(new File(filePath));
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册