The test infrastructure
High-level interfaces
The following are the high level interfaces in the infrastructure.
Test : A Test is performing whatever check is needed in its run method, and each run produces a TestReport.
TestReport : A TestReport describes whether a Test run passed or failed and provides a description of the failure in terms of an error code (unique in the context of a given Test) and a set of key/value pairs.
TestSuite : A TestSuite is a test aggregation which can run a set of Test instances.
TestReportProcessor : A TestReportProcessor is used to analyze a TestReport. A specific implementation can choose to create graphs, send an email or write an HTML file.
Default implementations
The test infrastructure comes with a number of default implementations for the interfaces described above. Specifically:
AbstractTest : This implementation of the Test interface is intended to make it easier to write a “safe” Test implementation. See the Writing new tests section for a description of how to use that class.
DefaultTestReport : This class provides a simple implementation of the TestReport interface that most Test implementations will be able to use. See the Writing new tests section for more details.
DefaultTestSuite : This class provides an implementation of the TestSuite interface and makes it easy to aggregate Test instances.
SimpleTestReportProcessor : This class is a sample TestReportProcessor implementation that simply traces the content of a TestReport to an output stream.
TestReportMailer : This is another implementation of the TestReportProcessor interface that emails a test report to a list of destination e-mail addresses.
XML implementations
The test infrastructure is using XML-out (and XML-in too, see the Running a test suite section) as a favorite way to generate test reports. The XMLTestReportProcessor implementation of the TestReportProcessor interface. It outputs reports in XML in a configurable directory.
The XMLTestReportProcessor can notify an XMLReportConsumer when it has created a new report. There is one implementation of that interface that can run an XSL stylesheet on the XML report (e.g., to generate an HTML report), called XSLXMLReportConsumer. This is used by the regard rule in the Batik build to produce an HTML report for the default regression test suite.