Unit Testing and Automated Testing Questions

I have been searching for some unit tests for the program iText with no luck. Is anyone aware of any such tests? Also, does anyone know if the developers use any automatic testing tools on iText, such

I have been searching for some unit tests for the program iText with no luck. Is anyone aware of any such tests? Also, does anyone know if the developers use any automatic testing tools on iText, such as Jenkins?

Posted on StackOverflow on Feb 21, 2014 by user3338813

Internally, we use Jenkins as well as TeamCity.

We have two types of tests:

  1. The tests that are added when new core functionality is added. You can find these where Maven expects them: each Maven project has a src directory with 2 sub directories: main and test. For instance: if you look at iText kernel, you'll find the released stuff here and the tests here. Most of these tests are built on top of our testutils and abstract test classes.
  2. The tests that are added when we get questions on SO or when we create code samples for the books. For these we create a sample inherited from GenericTest class and annotate that with SampleTest category. You need to follow a specific pattern when writing a sample: always use SRC and DEST for source PDFs and resulting PDFs, always use a createPdf() or manipulatePdf() method, and always give the cmp file the same name as the DEST file prefixed with cmp_.

In both cases, you'll find PDF files of which the name starts with cmp_, see for instance the filling of the sandbox folder for the examples.

Click this link if you want to see how to answer this question in iText 5.


Share this article

Ready to use iText?

Try our iText 7 Library and add-ons FREE for 30 days. Test your proof of concept, and see if our solution is right for you.

Get my FREE trial
Contact

Still have questions? 

We're happy to answer your questions. Reach out to us and we'll get back to you shortly.

Contact us
Stay updated

Join 11,000+ subscribers and become an iText PDF expert by staying up to date with our new products, updates, tips, technical solutions and happenings.

Subscribe Now