From 7b09f76c7501f692657385025ccb10be5d974c7a Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Tue, 10 Jul 2007 20:30:09 +0000
Subject: [PATCH] Update all of the tools provided with OpenDS to ensure that they are easier to invoke programmatically. This includes:
---
opends/tests/unit-tests-testng/src/server/org/opends/server/tools/LDIFDiffTestCase.java | 30 ++++++++++++++++--------------
1 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/opends/tests/unit-tests-testng/src/server/org/opends/server/tools/LDIFDiffTestCase.java b/opends/tests/unit-tests-testng/src/server/org/opends/server/tools/LDIFDiffTestCase.java
index 88d0ffb..d16a3ba 100644
--- a/opends/tests/unit-tests-testng/src/server/org/opends/server/tools/LDIFDiffTestCase.java
+++ b/opends/tests/unit-tests-testng/src/server/org/opends/server/tools/LDIFDiffTestCase.java
@@ -86,13 +86,13 @@
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);
}
@@ -108,7 +108,7 @@
"--invalid"
};
- assertFalse(LDIFDiff.mainDiff(args, true) == 0);
+ assertFalse(LDIFDiff.mainDiff(args, true, System.out, System.err) == 0);
}
@@ -279,12 +279,12 @@
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));
@@ -358,12 +358,12 @@
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));
@@ -438,7 +438,7 @@
"-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.
@@ -453,7 +453,8 @@
"-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
@@ -468,7 +469,7 @@
"-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
@@ -549,7 +550,7 @@
"-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.
@@ -564,7 +565,8 @@
"-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
@@ -579,7 +581,7 @@
"-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
--
Gitblit v1.10.0