Class XMLTestSuiteRunner
java.lang.Object
org.apache.batik.test.xml.XMLTestSuiteRunner
- All Implemented Interfaces:
XMLReflectConstants, XTRunConstants, XTSConstants
This class can be used to build and run a
+ pointers to a number of "Test Suite" XML descriptions, which contain the definition of the set of
+ a description of the set of
TestSuite from
an XML description following the "XML Test Run" and "XML Test Suite"
formats, whose constants are defined in the XTRunConstants
and XTSConstants interfaces.
This class takes a "Test Run" XML description as an input. That
description contains: + pointers to a number of "Test Suite" XML descriptions, which contain the definition of the set of
Tests to be
run and their configuration.+ a description of the set of
TestReportProcessor and
their configuration that should be used to process the reports
generated by the various TestSuites.- Version:
- $Id$
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classTest filter which accepts all testsstatic classTest filter which only accepts tests with ids matching the ones passed to its constructor. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringAn error happened while processing aTestreportProcessordescription.static final StringDisplayed when the input file name cannot be turned into a URLstatic final StringError displayed when an error occurs while running the test suitestatic final StringDisplayed when the input document cannot be parsed.static final StringDisplayed when the input argument does not represent a valid URIstatic final StringDisplayed when no test or testSuite matching the input id was found.static final StringDisplayed when the input argument does not represent an existing file to notify the user that the argument is going to be interpreted as a URI.static final StringAn error happened while processing theTestReportgenerated by theTestSuite{0} :TestReportProcessorclass name.static final StringAn error happened while running theTestSuite{0} :TestSuitename {1} :TestSuiteclass name.static final StringDisplayed when the user passes no arguments to the command line.Fields inherited from interface XMLReflectConstants
XR_ARG_TAG, XR_CLASS_ATTRIBUTE, XR_NAME_ATTRIBUTE, XR_PROPERTY_TAG, XR_VALUE_ATTRIBUTEFields inherited from interface XTRunConstants
XTRun_HREF_ATTRIBUTE, XTRun_ID_ATTRIBUTE, XTRun_NAME_ATTRIBUTE, XTRun_NAMESPACE_URI, XTRun_TEST_REPORT_PROCESSOR_TAG, XTRun_TEST_RUN_TAG, XTRun_TEST_SUITE_TAGFields inherited from interface XTSConstants
XTS_ID_ATTRIBUTE, XTS_NAME_ATTRIBUTE, XTS_NAMESPACE_URI, XTS_TEST_GROUP_TAG, XTS_TEST_SUITE_TAG, XTS_TEST_TAG -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected TestReportProcessorbuildProcessor(Element element) Builds aTestResultProcessorfrom an element.protected DefaultTestSuitebuildTestRunTestSuite(Element element) Builds aTestSuitefrom an input element.protected TestReportProcessor[]extractTestReportProcessor(Element element) Builds an array ofTestReportProcessorfrom the input element, assuming the input element is a <testSuite> instance,protected Element[]getChildrenByTagName(Element element, String tagName) Gets all the children of a given type.static voidprotected voidprocessReport(TestReport report, TestReportProcessor[] processors) Runs the test suite described by the input Document object.protected TestReportprotected TestReport
-
Field Details
-
MESSAGE_UNMATCHED_TEST_IDS
Displayed when no test or testSuite matching the input id was found. {0} : unmatched id set- See Also:
-
CANNOT_CREATE_TEST_REPORT_PROCESSOR
An error happened while processing aTestreportProcessordescription. {0} : the <testReportProcessor> "className" attribute value {1} : exception's class name {2} : exception's message {3} : exception's stack trace- See Also:
-
TEST_SUITE_EXCEPTION
An error happened while running theTestSuite{0} :TestSuitename {1} :TestSuiteclass name. {1} : exception's class name. {2} : exception's message {3} : exception's stack trace.- See Also:
-
TEST_REPORT_PROCESSING_EXCEPTION
An error happened while processing theTestReportgenerated by theTestSuite{0} :TestReportProcessorclass name. {1} : exception's class name. {2} : exception's message {3} : exception's stack trace.- See Also:
-
USAGE
Displayed when the user passes no arguments to the command line.- See Also:
-
NOT_A_FILE_TRY_URI
Displayed when the input argument does not represent an existing file to notify the user that the argument is going to be interpreted as a URI.- See Also:
-
COULD_NOT_CONVERT_FILE_NAME_TO_URI
Displayed when the input file name cannot be turned into a URL- See Also:
-
INVALID_URI
Displayed when the input argument does not represent a valid URI- See Also:
-
INVALID_DOCUMENT
Displayed when the input document cannot be parsed. {0} : uri of the invalid document. {1} : exception generated while parsing {2} : exception message- See Also:
-
ERROR_RUNNING_TEST_SUITE
Error displayed when an error occurs while running the test suite- See Also:
-
-
Constructor Details
-
XMLTestSuiteRunner
public XMLTestSuiteRunner()
-
-
Method Details
-
extractTestReportProcessor
Builds an array ofTestReportProcessorfrom the input element, assuming the input element is a <testSuite> instance,- Throws:
TestException
-
buildProcessor
Builds aTestResultProcessorfrom an element.- Throws:
TestException
-
buildTestRunTestSuite
Builds aTestSuitefrom an input element. This method assumes that element is a <testRun> instance. The element is scanned for children <testSuite> elements which is loaded into aTestand composited into aTestSuite- Throws:
TestException
-
getChildrenByTagName
-
run
Runs the test suite described by the input Document object. If the input ids array is null or of zero length, then all the tests will be run. Otherwise, only the tests identified by the array will be run.- Throws:
TestException
-
runTest
- Throws:
TestException
-
processReport
protected void processReport(TestReport report, TestReportProcessor[] processors) throws TestException - Throws:
TestException
-
run
- Throws:
TestException
-
main
-