提交 56f81dde 编写于 作者: H hujie

CI no environment 9

上级 d6d15834
...@@ -71,23 +71,23 @@ public class PlainAclPlugEngineTest { ...@@ -71,23 +71,23 @@ public class PlainAclPlugEngineTest {
} }
String filePath = home + "/conf/transport.yml"; String filePath = home + "/conf/transport.yml";
try { try {
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) {
AccessControl accessControl = new BorkerAccessControl(); AccessControl accessControl = new BorkerAccessControl();
accessControl.setAccount("onlyNetAddress"); accessControl.setAccount("onlyNetAddress");
accessControl.setPassword("aliyun11"); accessControl.setPassword("aliyun11");
accessControl.setNetaddress("127.0.0.1"); accessControl.setNetaddress("127.0.0.1");
accessControl.setRecognition("127.0.0.1:1"); accessControl.setRecognition("127.0.0.1:1");
AccessControl accessControlTwo = new BorkerAccessControl(); AccessControl accessControlTwo = new BorkerAccessControl();
accessControlTwo.setAccount("listtransport"); accessControlTwo.setAccount("listTransport");
accessControlTwo.setPassword("aliyun1"); accessControlTwo.setPassword("aliyun1");
accessControlTwo.setNetaddress("127.0.0.1"); accessControlTwo.setNetaddress("127.0.0.1");
accessControlTwo.setRecognition("127.0.0.1:2"); accessControlTwo.setRecognition("127.0.0.1:2");
transport = new BorkerAccessControlTransport(); transport = new BorkerAccessControlTransport();
transport.setOnlyNetAddress((BorkerAccessControl) accessControl); transport.setOnlyNetAddress((BorkerAccessControl)accessControl);
} }
ControllerParameters controllerParametersEntity = new ControllerParameters(); ControllerParameters controllerParametersEntity = new ControllerParameters();
controllerParametersEntity.setFileHome(null); controllerParametersEntity.setFileHome(null);
...@@ -97,20 +97,18 @@ public class PlainAclPlugEngineTest { ...@@ -97,20 +97,18 @@ public class PlainAclPlugEngineTest {
} catch (Exception e) { } catch (Exception e) {
} }
accessControl = new BorkerAccessControl(); accessControl = new BorkerAccessControl();
accessControl.setAccount("onlyNetAddress"); accessControl.setAccount("rokcetmq");
accessControl.setPassword("aliyun11"); accessControl.setPassword("aliyun11");
accessControl.setNetaddress("127.0.0.1"); accessControl.setNetaddress("127.0.0.1");
accessControl.setRecognition("127.0.0.1:1"); accessControl.setRecognition("127.0.0.1:1");
accessControlTwo = new BorkerAccessControl(); accessControlTwo = new BorkerAccessControl();
accessControlTwo.setAccount("listtransport"); accessControlTwo.setAccount("rokcet1");
accessControlTwo.setPassword("aliyun1"); accessControlTwo.setPassword("aliyun1");
accessControlTwo.setNetaddress("127.0.0.1"); accessControlTwo.setNetaddress("127.0.0.1");
accessControlTwo.setRecognition("127.0.0.1:2"); accessControlTwo.setRecognition("127.0.0.1:2");
transport = new BorkerAccessControlTransport();
transport.setOnlyNetAddress((BorkerAccessControl) accessControl);
loginInfoMap = new ConcurrentHashMap<>(); loginInfoMap = new ConcurrentHashMap<>();
FieldSetter.setField(plainAclPlugEngine, plainAclPlugEngine.getClass().getSuperclass().getDeclaredField("loginInfoMap"), loginInfoMap); FieldSetter.setField(plainAclPlugEngine, plainAclPlugEngine.getClass().getSuperclass().getDeclaredField("loginInfoMap"), loginInfoMap);
...@@ -275,18 +273,18 @@ public class PlainAclPlugEngineTest { ...@@ -275,18 +273,18 @@ public class PlainAclPlugEngineTest {
@Test @Test
public void getAuthenticationInfo() { public void getAuthenticationInfo() {
AccessControl accessControl = new AccessControl(); AccessControl newAccessControl = new AccessControl();
accessControl.setAccount("rokcetmq"); newAccessControl.setAccount("rokcetmq");
accessControl.setPassword("aliyun11"); newAccessControl.setPassword("aliyun11");
accessControl.setNetaddress("127.0.0.1"); newAccessControl.setNetaddress("127.0.0.1");
accessControl.setRecognition("127.0.0.1:1"); newAccessControl.setRecognition("127.0.0.1:1");
AuthenticationResult authenticationResult = new AuthenticationResult(); AuthenticationResult authenticationResult = new AuthenticationResult();
plainAclPlugEngine.getAuthenticationInfo(accessControl, authenticationResult); plainAclPlugEngine.getAuthenticationInfo(newAccessControl, authenticationResult);
Assert.assertEquals("Login information does not exist, Please check login, password, IP", authenticationResult.getResultString()); Assert.assertEquals("Login information does not exist, Please check login, password, IP", authenticationResult.getResultString());
plainAclPlugEngine.setAccessControl(this.accessControl); plainAclPlugEngine.setAccessControl(accessControl);
AuthenticationInfo authenticationInfo = plainAclPlugEngine.getAuthenticationInfo(accessControl, authenticationResult); AuthenticationInfo authenticationInfo = plainAclPlugEngine.getAuthenticationInfo(newAccessControl, authenticationResult);
Assert.assertNotNull(authenticationInfo); Assert.assertNotNull(authenticationInfo);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册