提交 eeab571a 编写于 作者: H hujie

CI no environment 6

上级 45343af2
......@@ -35,10 +35,7 @@ public class DefaultAclRemotingServiceImpl implements AclRemotingService {
if (authenticationResult.getException() != null) {
throw new AclPlugRuntimeException(String.format("eachCheck the inspection appear exception, accessControl data is %s", accessControl.toString()), authenticationResult.getException());
}
if (authenticationResult.getAccessControl() == null) {
throw new AclPlugRuntimeException(String.format("%s accessControl data is %s", authenticationResult.getResultString(), accessControl.toString()));
}
if (!authenticationResult.isSucceed()) {
if (authenticationResult.getAccessControl() == null || !authenticationResult.isSucceed()) {
throw new AclPlugRuntimeException(String.format("%s accessControl data is %s", authenticationResult.getResultString(), accessControl.toString()));
}
return authenticationResult;
......
......@@ -41,7 +41,7 @@ public class PlainAclPlugEngine extends LoginInfoAclPlugEngine {
fis = new FileInputStream(new File(filePath));
transport = ymal.loadAs(fis, BorkerAccessControlTransport.class);
} catch (Exception e) {
throw new AclPlugRuntimeException(String.format("The transport.yml file for Plain mode was not found , paths %s" , filePath), e);
throw new AclPlugRuntimeException(String.format("The transport.yml file for Plain mode was not found , paths %s", filePath), e);
} finally {
if (fis != null) {
try {
......
......@@ -20,6 +20,7 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
......@@ -60,13 +61,17 @@ public class PlainAclPlugEngineTest {
String home = System.getProperty(MixAll.ROCKETMQ_HOME_PROPERTY, System.getenv(MixAll.ROCKETMQ_HOME_ENV));
InputStream fis = null;
if (home == null) {
home = "/home/travis/build/githublaohu/rocketmq/acl-plug/src/test/resources";
String filePath = home + "/conf/transport.yml";
fis = new FileInputStream(new File(filePath));
} else {
String filePath = home + "/conf/transport.yml";
fis = new FileInputStream(new File(filePath));
URL url = PlainAclPlugEngineTest.class.getResource("/");
home = url.toString();
home = home.substring(0, home.length() - 1).replace("file:/", "").replace("target/test-classes", "");
home = home + "src/test/resources";
if (!new File(home + "/conf/transport.yml").exists()) {
home = "/home/travis/build/githublaohu/rocketmq/acl-plug/src/test/resources";
}
}
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.
先完成此消息的编辑!
想要评论请 注册