提交 3aa43594 编写于 作者: H hujie

CI No environment

上级 da09320d
...@@ -18,11 +18,14 @@ package org.apache.rocketmq.acl.plug.engine; ...@@ -18,11 +18,14 @@ package org.apache.rocketmq.acl.plug.engine;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FileNotFoundException; import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.ArrayList; 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;
...@@ -54,11 +57,20 @@ public class PlainAclPlugEngineTest { ...@@ -54,11 +57,20 @@ public class PlainAclPlugEngineTest {
Map<String, LoginInfo> loginInfoMap; Map<String, LoginInfo> loginInfoMap;
@Before @Before
public void init() throws FileNotFoundException, NoSuchFieldException, SecurityException { public void init() throws NoSuchFieldException, SecurityException, IOException {
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));
Yaml ymal = new Yaml(); InputStream fis=null;
String filePath = home + "/conf/transport.yml"; if(home == null){
FileInputStream fis = new FileInputStream(new File(filePath)); 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:/", "");
}else {
String filePath = home + "/conf/transport.yml";
fis = new FileInputStream(new File(filePath));
}
transport = ymal.loadAs(fis, BorkerAccessControlTransport.class); transport = ymal.loadAs(fis, BorkerAccessControlTransport.class);
ControllerParameters controllerParametersEntity = new ControllerParameters(); ControllerParameters controllerParametersEntity = new ControllerParameters();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册