提交 e2c3eaa8 编写于 作者: H hujie

CI no environment

上级 eeab571a
......@@ -35,6 +35,7 @@ public class AclPlugController {
try {
this.controllerParameters = controllerParameters;
aclPlugEngine = new PlainAclPlugEngine(controllerParameters);
aclPlugEngine.initialize();
aclRemotingService = new DefaultAclRemotingServiceImpl(aclPlugEngine);
this.startSucceed = true;
} catch (Exception e) {
......
......@@ -30,4 +30,6 @@ public interface AclPlugEngine {
public void deleteLoginInfo(String remoteAddr);
public AuthenticationResult eachCheckLoginAndAuthentication(AccessControl accessControl);
public void initialize();
}
......@@ -29,10 +29,9 @@ public class PlainAclPlugEngine extends LoginInfoAclPlugEngine {
public PlainAclPlugEngine(
ControllerParameters controllerParameters) throws AclPlugRuntimeException {
super(controllerParameters);
init();
}
void init() throws AclPlugRuntimeException {
public void initialize() throws AclPlugRuntimeException {
String filePath = controllerParameters.getFileHome() + "/conf/transport.yml";
Yaml ymal = new Yaml();
FileInputStream fis = null;
......
......@@ -75,9 +75,13 @@ public class PlainAclPlugEngineTest {
transport = ymal.loadAs(fis, BorkerAccessControlTransport.class);
ControllerParameters controllerParametersEntity = new ControllerParameters();
controllerParametersEntity.setFileHome(home);
plainAclPlugEngine = new PlainAclPlugEngine(controllerParametersEntity);
controllerParametersEntity.setFileHome(null);
try {
plainAclPlugEngine = new PlainAclPlugEngine(controllerParametersEntity);
plainAclPlugEngine.initialize();
} catch (Exception e) {
}
accessControl = new BorkerAccessControl();
accessControl.setAccount("rokcetmq");
accessControl.setPassword("aliyun11");
......@@ -122,7 +126,7 @@ public class PlainAclPlugEngineTest {
@Test(expected = AclPlugRuntimeException.class)
public void testPlainAclPlugEngineInit() {
ControllerParameters controllerParametersEntity = new ControllerParameters();
new PlainAclPlugEngine(controllerParametersEntity);
new PlainAclPlugEngine(controllerParametersEntity).initialize();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册