提交 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;
...@@ -58,28 +57,19 @@ public class PlainAclPlugEngineTest { ...@@ -58,28 +57,19 @@ public class PlainAclPlugEngineTest {
@Before @Before
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) { home = url.toString();
url = PlainAclPlugEngineTest.class.getResource("/"); home = home.substring(0, home.length() - 1).replace("file:/", "").replace("target/test-classes", "");
home = url.toString(); home = home + "src/test/resources";
home = home.substring(0, home.length()-1).replace("file:/", "").replace("target/test-classes", ""); String filePath = home + "/conf/transport.yml";
home = home+"src/test/resources"; fis = new FileInputStream(new File(filePath));
String filePath = home+"/conf/transport.yml"; } else {
fis = new FileInputStream(new File(filePath)); String filePath = home + "/conf/transport.yml";
}else { fis = new FileInputStream(new File(filePath));
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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册