提交 eeab571a 编写于 作者: H hujie

CI no environment 6

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