| | |
| | | public void testUsage() |
| | | { |
| | | String[] args = { "--help" }; |
| | | assertEquals(LDIFDiff.mainDiff(args, true), 0); |
| | | assertEquals(LDIFDiff.mainDiff(args, true, System.out, System.err), 0); |
| | | |
| | | args = new String[] { "-H" }; |
| | | assertEquals(LDIFDiff.mainDiff(args, true), 0); |
| | | assertEquals(LDIFDiff.mainDiff(args, true, System.out, System.err), 0); |
| | | |
| | | args = new String[] { "-?" }; |
| | | assertEquals(LDIFDiff.mainDiff(args, true), 0); |
| | | assertEquals(LDIFDiff.mainDiff(args, true, System.out, System.err), 0); |
| | | } |
| | | |
| | | |
| | |
| | | "--invalid" |
| | | }; |
| | | |
| | | assertFalse(LDIFDiff.mainDiff(args, true) == 0); |
| | | assertFalse(LDIFDiff.mainDiff(args, true, System.out, System.err) == 0); |
| | | } |
| | | |
| | | |
| | |
| | | if (normalDiffFile == null) |
| | | { |
| | | // We expect this to fail, so just make sure that it does. |
| | | assertFalse(LDIFDiff.mainDiff(args, true) == 0); |
| | | assertFalse(LDIFDiff.mainDiff(args, true, System.out, System.err) == 0); |
| | | outputFile.delete(); |
| | | return; |
| | | } |
| | | |
| | | assertEquals(LDIFDiff.mainDiff(args, true), 0); |
| | | assertEquals(LDIFDiff.mainDiff(args, true, System.out, System.err), 0); |
| | | |
| | | long outputChecksum = 0L; |
| | | BufferedReader reader = new BufferedReader(new FileReader(outputFile)); |
| | |
| | | if (singleValueDiffFile == null) |
| | | { |
| | | // We expect this to fail, so just make sure that it does. |
| | | assertFalse(LDIFDiff.mainDiff(args, true) == 0); |
| | | assertFalse(LDIFDiff.mainDiff(args, true, System.out, System.err) == 0); |
| | | outputFile.delete(); |
| | | return; |
| | | } |
| | | |
| | | assertEquals(LDIFDiff.mainDiff(args, true), 0); |
| | | assertEquals(LDIFDiff.mainDiff(args, true, System.out, System.err), 0); |
| | | |
| | | long outputChecksum = 0L; |
| | | BufferedReader reader = new BufferedReader(new FileReader(outputFile)); |
| | |
| | | "-o", diffOutputFile.getAbsolutePath() |
| | | }; |
| | | |
| | | assertEquals(LDIFDiff.mainDiff(args, true), 0); |
| | | assertEquals(LDIFDiff.mainDiff(args, true, System.out, System.err), 0); |
| | | |
| | | |
| | | // Use LDIFModify to generate a new target file. |
| | |
| | | "-t", newTargetFile.getAbsolutePath() |
| | | }; |
| | | |
| | | assertEquals(LDIFModify.ldifModifyMain(args, true), 0); |
| | | assertEquals(LDIFModify.ldifModifyMain(args, true, System.out, System.err), |
| | | 0); |
| | | |
| | | |
| | | // Use LDIFDiff again to verify that there are effectively no differences |
| | |
| | | "-o", newDiffFile.getAbsolutePath() |
| | | }; |
| | | |
| | | assertEquals(LDIFDiff.mainDiff(args, true), 0); |
| | | assertEquals(LDIFDiff.mainDiff(args, true, System.out, System.err), 0); |
| | | |
| | | |
| | | // Read the contents of the new diff file and make sure it matches the |
| | |
| | | "-S" |
| | | }; |
| | | |
| | | assertEquals(LDIFDiff.mainDiff(args, true), 0); |
| | | assertEquals(LDIFDiff.mainDiff(args, true, System.out, System.err), 0); |
| | | |
| | | |
| | | // Use LDIFModify to generate a new target file. |
| | |
| | | "-t", newTargetFile.getAbsolutePath() |
| | | }; |
| | | |
| | | assertEquals(LDIFModify.ldifModifyMain(args, true), 0); |
| | | assertEquals(LDIFModify.ldifModifyMain(args, true, System.out, System.err), |
| | | 0); |
| | | |
| | | |
| | | // Use LDIFDiff again to verify that there are effectively no differences |
| | |
| | | "-o", newDiffFile.getAbsolutePath() |
| | | }; |
| | | |
| | | assertEquals(LDIFDiff.mainDiff(args, true), 0); |
| | | assertEquals(LDIFDiff.mainDiff(args, true, System.out, System.err), 0); |
| | | |
| | | |
| | | // Read the contents of the new diff file and make sure it matches the |