Hi all,
I tried to produce a concept for some automated JUnit test, with
the intent to quickly uncover regressions during wholesale
refactoring.
I came up with
 http://cvs.apache.org/~pietsch/FopTest.java
sample control file at
 http://cvs.apache.org/~pietsch/regression.xml

Overview: the control file holds a source, a MD5 for it so you
can detect test failures caused by a changed source rather than
a regression easier and a MD5 for the result file. If the test
runs through, all is well. If a test fails, you can investigate
the file and see whether the change was a regression (fix it)
or an improvement (update the MD5 for the result).

Problems:
- PDFInfo unconditionally puts the creation time into the
  PDF. This thwarts the whole thing. On my machine I can
  disable it temporarily, but there should be a more
  sustainable solution. Ideas:
  o pass a flag to the renderer which inhibits creation time
    creation
  o pass a creation date value (can be abused, but abusers can
    implement it anyway)
  o patch it in the result array before digesting (hack alert)
- Source FO line endings: both CVS and ZIP may alter them,
  making the source MD5 invalid. I'm not sure whether FixCRLF
  can be of use here. Either way, running the tests from Eclipse
  unprepared could be a bad idea. Possible fixes:
  o have two MD5 in the control one for the source with CRLF,
    one with LF only. Makes updating more unconvenient.
  o use another FilterStream to transform CRLF->LF before
    digesting. Adds unwanted complexity, but probably the way
    to go...
- Hidden regressions: a checksum mismatch does not necesarily
  cause a visible problem, lets say the author string gets spaces
  appended or such. For proper inspection of failures we probably
  need a more sophisticated tool than simply display two PDFs
  side-by-side. For a starter, a sort of PDF diff which extracts
  the streams, uncompresses and displays mismatches with a bit of
  context would certainly be valuable. Any takers?

Comments?

J.Pietschmann




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]



Reply via email to