I'm now using the Unix diff built in to Apache Jakarta Commons JRCS
(which I found on suigeneris.org, not apache.org) in order to bulletproof the Tibetan Converter tests. They used to fail due to nondeterminism in the Java RTF writer; they should no longer fail. I've also changed it so that the Tibetan Converter tests run in headless mode, which means that they'll run on the nightly builds server.
This commit is contained in:
parent
06fb77a82b
commit
1c29566aee
10 changed files with 41 additions and 1032 deletions
|
@ -26,7 +26,8 @@ import java.io.FileOutputStream;
|
|||
import java.io.FileNotFoundException;
|
||||
|
||||
import org.thdl.util.ThdlOptions;
|
||||
import org.thdl.util.javaxdelta.Delta;
|
||||
import org.apache.commons.jrcs.tools.JDiff;
|
||||
import org.apache.commons.jrcs.diff.Revision;
|
||||
|
||||
/**
|
||||
* @author David Chandler
|
||||
|
@ -78,9 +79,21 @@ public class TMW_RTF_TO_THDL_WYLIETest extends TestCase {
|
|||
+ "TMW_RTF_TO_THDL_WYLIE" + testName + ".expected";
|
||||
assertTrue(new File(actualFile).exists());
|
||||
assertTrue(new File(expectedFile).exists());
|
||||
rc = Delta.areFilesDifferent(actualFile, expectedFile);
|
||||
if (0 != rc) System.out.println("0: rc is " + rc);
|
||||
assertTrue(0 == rc);
|
||||
Revision rev = JDiff.getDiff(expectedFile, actualFile);
|
||||
assertTrue(null != rev);
|
||||
String lineSep = System.getProperty("line.separator");
|
||||
boolean foundExpectedDiff = false;
|
||||
String expectedDiff
|
||||
= ("3c3" + lineSep
|
||||
+ "< {\\stylesheet{\\s1\\li0\\ri0\\fi0\\ql\\sbasedon2\\snext1 Body Text;}{\\s2 default;}}\n"
|
||||
+ "---" + lineSep
|
||||
+ "> {\\stylesheet{\\s2 default;}{\\s1\\li0\\ri0\\fi0\\ql\\sbasedon2\\snext1 Body Text;}}\n");
|
||||
if (0 != rev.size()
|
||||
&& !(foundExpectedDiff = expectedDiff.equals(rev.toString()))) {
|
||||
System.out.println("Oops! the diff is this:");
|
||||
System.out.print(rev.toString());
|
||||
assertTrue(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue