public class XMLTestSuiteRunner extends Object implements XTRunConstants, XTSConstants
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: Tests
to be
run and their configuration.TestReportProcessor
and
their configuration that should be used to process the reports
generated by the various TestSuites
.Modifier and Type | Class and Description |
---|---|
static class |
XMLTestSuiteRunner.AcceptAllTestsFilter
Test filter which accepts all tests
|
static class |
XMLTestSuiteRunner.IdBasedTestFilter
Test filter which only accepts tests with ids matching
the ones passed to its constructor.
|
Modifier and Type | Field and Description |
---|---|
static String |
CANNOT_CREATE_TEST_REPORT_PROCESSOR
An error happened while processing a
TestreportProcessor
description. |
static String |
COULD_NOT_CONVERT_FILE_NAME_TO_URI
Displayed when the input file name cannot be turned into a URL
|
static String |
ERROR_RUNNING_TEST_SUITE
Error displayed when an error occurs while running the
test suite
|
static String |
INVALID_DOCUMENT
Displayed when the input document cannot be parsed.
|
static String |
INVALID_URI
Displayed when the input argument does not represent a valid
URI
|
static String |
MESSAGE_UNMATCHED_TEST_IDS
Displayed when no test or testSuite matching the input id was
found.
|
static String |
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.
|
static String |
TEST_REPORT_PROCESSING_EXCEPTION
An error happened while processing the
TestReport
generated by the TestSuite
{0} : TestReportProcessor class name. |
static String |
TEST_SUITE_EXCEPTION
An error happened while running the
TestSuite
{0} : TestSuite name
{1} : TestSuite class name. |
static String |
USAGE
Displayed when the user passes no arguments to the command line.
|
XTRun_HREF_ATTRIBUTE, XTRun_ID_ATTRIBUTE, XTRun_NAME_ATTRIBUTE, XTRun_NAMESPACE_URI, XTRun_TEST_REPORT_PROCESSOR_TAG, XTRun_TEST_RUN_TAG, XTRun_TEST_SUITE_TAG
XTS_ID_ATTRIBUTE, XTS_NAME_ATTRIBUTE, XTS_NAMESPACE_URI, XTS_TEST_GROUP_TAG, XTS_TEST_SUITE_TAG, XTS_TEST_TAG
XR_ARG_TAG, XR_CLASS_ATTRIBUTE, XR_NAME_ATTRIBUTE, XR_PROPERTY_TAG, XR_VALUE_ATTRIBUTE
Constructor and Description |
---|
XMLTestSuiteRunner() |
Modifier and Type | Method and Description |
---|---|
protected TestReportProcessor |
buildProcessor(Element element)
Builds a
TestResultProcessor from an element. |
protected DefaultTestSuite |
buildTestRunTestSuite(Element element)
Builds a
TestSuite from an input element. |
protected TestReportProcessor[] |
extractTestReportProcessor(Element element)
Builds an array of
TestReportProcessor from 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 void |
main(String[] args) |
protected void |
processReport(TestReport report,
TestReportProcessor[] processors) |
TestReport |
run(Document doc,
String[] ids)
Runs the test suite described by the input
Document object.
|
protected TestReport |
run(Element testRunElement,
String[] ids) |
protected TestReport |
runTest(Test test) |
public static final String MESSAGE_UNMATCHED_TEST_IDS
public static final String CANNOT_CREATE_TEST_REPORT_PROCESSOR
TestreportProcessor
description.
{0} : the <testReportProcessor> "className" attribute value
{1} : exception's class name
{2} : exception's message
{3} : exception's stack tracepublic static final String TEST_SUITE_EXCEPTION
TestSuite
{0} : TestSuite
name
{1} : TestSuite
class name.
{1} : exception's class name.
{2} : exception's message
{3} : exception's stack trace.public static final String TEST_REPORT_PROCESSING_EXCEPTION
TestReport
generated by the TestSuite
{0} : TestReportProcessor
class name.
{1} : exception's class name.
{2} : exception's message
{3} : exception's stack trace.public static final String USAGE
public static final String NOT_A_FILE_TRY_URI
public static final String COULD_NOT_CONVERT_FILE_NAME_TO_URI
public static final String INVALID_URI
public static final String INVALID_DOCUMENT
public static final String ERROR_RUNNING_TEST_SUITE
protected TestReportProcessor[] extractTestReportProcessor(Element element) throws TestException
TestReportProcessor
from the input
element, assuming the input element is a <testSuite> instance,TestException
protected TestReportProcessor buildProcessor(Element element) throws TestException
TestResultProcessor
from an element.TestException
protected DefaultTestSuite buildTestRunTestSuite(Element element) throws TestException
TestSuite
from an input element.
This method assumes that element is a <testRun>
instance. The element is scanned for children
<testSuite> elements which is loaded into
a Test
and composited into a TestSuite
TestException
protected Element[] getChildrenByTagName(Element element, String tagName)
public TestReport run(Document doc, String[] ids) throws TestException
TestException
protected TestReport runTest(Test test) throws TestException
TestException
protected void processReport(TestReport report, TestReportProcessor[] processors) throws TestException
TestException
protected TestReport run(Element testRunElement, String[] ids) throws TestException
TestException
public static void main(String[] args)
Copyright © 2000–2023 Apache Software Foundation. All rights reserved.