• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

testing images and PDFs

 
Greenhorn
Posts: 27
Google Web Toolkit Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you have an advice on automated testing for images and PDFs? I must generate TIFF, JPEG, PDF, etc. by merging database records, text files, format files, and other images. All the JUnit testing I can think to are things like size, depth, and dpi, things that are done by the 3rd party libraries and not by me. I have to check my code's results manually: Is the right font used? Is the text or image correctly placed? Are things scaled correctly on the page? Any ideas or libraries for automating more of that would be appreciated.
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Thad Humphries wrote:Do you have an advice on automated testing for images and PDFs? I must generate TIFF, JPEG, PDF, etc. by merging database records, text files, format files, and other images. All the JUnit testing I can think to are things like size, depth, and dpi, things that are done by the 3rd party libraries and not by me. I have to check my code's results manually: Is the right font used? Is the text or image correctly placed? Are things scaled correctly on the page? Any ideas or libraries for automating more of that would be appreciated.


What I'd look at doing would be to detect each aspect individually by, for example, looking for specific shapes in the resulting bitmap to detect the correct font being used and checking the position of a known image in the resulting bitmap. Some of these tests would make heavy use of image processing algorithms (which likely means you wouldn't implement them just for one or two tests' needs) and while some tests can be made simpler with smart setup (e.g. using a solid red image that's easy to look for in the resulting bitmap), these tests will certainly look and feel quite different from the kind of tests you'd write for typical application logic.
 
reply
    Bookmark Topic Watch Topic
  • New Topic