If by “connecting to a data source” you mean a backup JDBC data source, yes, you can run the report without requiring it.
There are other data source implementations that implement net.sf.jasperreports.engine.JRDataSource (such as JRCsvDataSource ) that are "lighter" than the database hits - useful for testing.
However, for unit tests, I create a mock implementation of JRDataSource that implements next () and getFieldValue () and reads from Collection of Map objects (it can read from a file instead, etc.). It was the easiest and fastest approach when it came to testing for me.
What part do you accurately load testing on? Usually interesting parts for a stress test are:
Filling out a Jasper report (running a query, reading results, and populating a JasperPrint object)
Jasper export (creating a report output format - HTML, PDF, XLS, etc.)
source share