| | |
| | | |
| | | import static org.testng.Assert.*; |
| | | |
| | | import static org.opends.server.admin.client.cli.DsServiceCliReturnCode.*; |
| | | import static org.opends.server.admin.client.cli.DsFrameworkCliReturnCode.*; |
| | | |
| | | |
| | | |
| | |
| | | "admin" |
| | | }; |
| | | |
| | | assertEquals(DsServiceCliMain.mainCLI(args, false, System.out, System.err), |
| | | assertEquals(DsFrameworkCliMain.mainCLI(args, false, System.out, System.err), |
| | | ReturnCode.SUCCESSFUL.getReturnCode()); |
| | | } |
| | | |
| | |
| | | "admin" |
| | | }; |
| | | |
| | | assertEquals(DsServiceCliMain.mainCLI(args, false, System.out, System.err), |
| | | assertEquals(DsFrameworkCliMain.mainCLI(args, false, System.out, System.err), |
| | | ReturnCode.SUCCESSFUL.getReturnCode()); |
| | | } |
| | | |
| | |
| | | "-w", "password" |
| | | }; |
| | | |
| | | assertFalse(DsServiceCliMain.mainCLI(args, false, null, null) |
| | | assertFalse(DsFrameworkCliMain.mainCLI(args, false, null, null) |
| | | == ReturnCode.SUCCESSFUL.getReturnCode()); |
| | | } |
| | | |
| | |
| | | "-w", "password" |
| | | }; |
| | | |
| | | assertFalse(DsServiceCliMain.mainCLI(args, false, System.out, System.err) |
| | | assertFalse(DsFrameworkCliMain.mainCLI(args, false, System.out, System.err) |
| | | == ReturnCode.SUCCESSFUL.getReturnCode()); |
| | | } |
| | | |
| | |
| | | "-w", "wrongPassword" |
| | | }; |
| | | |
| | | assertFalse(DsServiceCliMain.mainCLI(args, false, System.out, System.err) |
| | | assertFalse(DsFrameworkCliMain.mainCLI(args, false, System.out, System.err) |
| | | == ReturnCode.SUCCESSFUL.getReturnCode()); |
| | | } |
| | | |
| | |
| | | "-j", validPasswordFile, |
| | | }; |
| | | |
| | | assertEquals(DsServiceCliMain.mainCLI(args, false, System.out, System.err), |
| | | assertEquals(DsFrameworkCliMain.mainCLI(args, false, System.out, System.err), |
| | | ReturnCode.SUCCESSFUL.getReturnCode()); |
| | | } |
| | | |
| | |
| | | "-j",invalidPasswordFile |
| | | }; |
| | | |
| | | assertFalse(DsServiceCliMain.mainCLI(args, false, System.out, System.err) |
| | | assertFalse(DsFrameworkCliMain.mainCLI(args, false, System.out, System.err) |
| | | == ReturnCode.SUCCESSFUL.getReturnCode()); |
| | | } |
| | | |
| | |
| | | "-X" |
| | | }; |
| | | |
| | | assertEquals(DsServiceCliMain.mainCLI(args, false, System.out, System.err), |
| | | assertEquals(DsFrameworkCliMain.mainCLI(args, false, System.out, System.err), |
| | | ReturnCode.SUCCESSFUL.getReturnCode()); |
| | | } |
| | | |
| | |
| | | "-P", trustStorePath |
| | | }; |
| | | |
| | | assertEquals(DsServiceCliMain.mainCLI(args, false, System.out, System.err), |
| | | assertEquals(DsFrameworkCliMain.mainCLI(args, false, System.out, System.err), |
| | | ReturnCode.SUCCESSFUL.getReturnCode()); |
| | | } |
| | | |
| | |
| | | "-X" |
| | | }; |
| | | |
| | | assertEquals(DsServiceCliMain.mainCLI(args, false, null, System.err), |
| | | assertEquals(DsFrameworkCliMain.mainCLI(args, false, null, System.err), |
| | | ReturnCode.SUCCESSFUL.getReturnCode()); |
| | | } |
| | | |
| | |
| | | "-P", trustStorePath |
| | | }; |
| | | |
| | | assertEquals(DsServiceCliMain.mainCLI(args, false, null, System.err), |
| | | assertEquals(DsFrameworkCliMain.mainCLI(args, false, null, System.err), |
| | | ReturnCode.SUCCESSFUL.getReturnCode()); |
| | | } |
| | | |
| | |
| | | public void testHelp() |
| | | { |
| | | String[] args = { "--help" }; |
| | | assertEquals(DsServiceCliMain.mainCLI(args, false, null, null), |
| | | assertEquals(DsFrameworkCliMain.mainCLI(args, false, null, null), |
| | | ReturnCode.SUCCESSFUL.getReturnCode()); |
| | | |
| | | args = new String[] { "-H" }; |
| | | assertEquals(DsServiceCliMain.mainCLI(args, false, null, null), |
| | | assertEquals(DsFrameworkCliMain.mainCLI(args, false, null, null), |
| | | ReturnCode.SUCCESSFUL.getReturnCode()); |
| | | |
| | | args = new String[] { "-?" }; |
| | | assertEquals(DsServiceCliMain.mainCLI(args, false, null, null), |
| | | assertEquals(DsFrameworkCliMain.mainCLI(args, false, null, null), |
| | | ReturnCode.SUCCESSFUL.getReturnCode()); |
| | | } |
| | | } |