My java program writes information on PDF form. Does anyone know a good way to write test cases using JUnit to make sure it has printed the required information on PDF form.
+1
A:
Do you create the PDF with code you've written, or do you use a third-party PDF library?
If the latter, you shouldn't be testing this. You should assume the library works, and just test whether you make the right calls to it by mocking/stubbing it out.
dty
2010-10-20 21:41:14
I use third-party PDF library.
yogsma
2010-10-20 21:46:40
... if you're writing a unit test. If you're doing integration testing the OP's use case is valid
rjohnston
2010-10-20 21:48:33
+4
A:
Use the same library you are using to write to the PDF form to look for the expected results in the pdf form
Aaron Saunders
2010-10-20 21:41:46