views:

67

answers:

1

Hi,

I want to test all the jasper reports of my application. I want to be able to detect:

  • Compilation problems (Would checking that JasperCompileManager.compileReport(some inputStream) doesn´t throw JRException is a good option for this?)
  • Filling problems (Would checking that JasperFillManager.fillReport(someReport, someParameters, someDataSource) doesn´t throw JRException is a good option for this?)
  • Rendering problems: detect "null" strings appearing, text looking truncated in the exported PDF file
  • Any other idea?

Ideally I would like to keep the testing process the most generic possible. The thing is that each jasper has a different data source so for detecting this errors i need to generate at list some data (right?) and this data I need to generate is different for each jasper of my application. So i don´t know how much testing code I would be able to reuse. What approach would you take?

Thanks!

A: 

Hi,

For compilation problems , one approach would be to use iReport tool and all report templates are compiles successfully; assuming that you are using templates and then populating data into it.

I found the following link useful ,

http://flexingcode.blogspot.com/2009/04/junit-for-jasper-reports.html

Hope that helps,

Manju

Manjum