Package org.testng.xml.internal
Class Parser
java.lang.Object
org.testng.xml.internal.Parser
Parser
is a parser for a TestNG XML test suite file.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The default file name for the TestNG test suite if none is specified (testng.xml).static final String
static final String
The URL to the deprecated TestNG DTD.static final String
The name of the TestNG DTD.static final String
The URL to the TestNG DTD. -
Constructor Summary
ConstructorsConstructorDescriptionParser()
Creates a parser that will try to find the DEFAULT_FILENAME from the jar.Parser
(InputStream is) Constructs aParser
to use the inputStream as the source of the xml test suite to parse. -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
static boolean
hasFileScheme
(String uri) parse()
Parses the TestNG test suite and returns the corresponding XmlSuite, and possibly, other XmlSuite that are pointed to by<suite-files>
tags.static Collection<XmlSuite>
parse
(InputStream is, IPostProcessor processor) static Collection<XmlSuite>
parse
(String suite, IPostProcessor processor) void
setLoadClasses
(boolean loadClasses) void
setPostProcessor
(IPostProcessor processor)
-
Field Details
-
TESTNG_DTD
The name of the TestNG DTD.- See Also:
-
OLD_TESTNG_DTD_URL
The URL to the deprecated TestNG DTD.- See Also:
-
TESTNG_DTD_URL
The URL to the TestNG DTD.- See Also:
-
HTTPS_TESTNG_DTD_URL
- See Also:
-
DEFAULT_FILENAME
The default file name for the TestNG test suite if none is specified (testng.xml).- See Also:
-
-
Constructor Details
-
Parser
Constructs aParser
to use the inputStream as the source of the xml test suite to parse.- Parameters:
fileName
- the filename corresponding to the inputStream or null if unknown.
-
Parser
public Parser()Creates a parser that will try to find the DEFAULT_FILENAME from the jar. -
Parser
-
-
Method Details
-
setPostProcessor
-
setLoadClasses
public void setLoadClasses(boolean loadClasses) - Parameters:
loadClasses
- If false, don't try to load the classes during the parsing.
-
parse
Parses the TestNG test suite and returns the corresponding XmlSuite, and possibly, other XmlSuite that are pointed to by<suite-files>
tags.- Returns:
- the parsed TestNG test suite.
- Throws:
IOException
- if an I/O error occurs while parsing the test suite file or if the default testng.xml file is not found.
-
hasFileScheme
- Parameters:
uri
- - The uri to be verified.- Returns:
- -
true
if the uri has "file:" as its scheme.
-
parseToList
- Throws:
IOException
-
parse
- Throws:
IOException
-
parse
public static Collection<XmlSuite> parse(InputStream is, IPostProcessor processor) throws IOException - Throws:
IOException
-
canParse
-