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

CI No environment

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