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 StringThe default file name for the TestNG test suite if none is specified (testng.xml).static final Stringstatic final StringThe URL to the deprecated TestNG DTD.static final StringThe name of the TestNG DTD.static final StringThe 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 aParserto use the inputStream as the source of the xml test suite to parse. -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanstatic booleanhasFileScheme(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) voidsetLoadClasses(boolean loadClasses) voidsetPostProcessor(IPostProcessor processor)
-
Field Details
-
TESTNG_DTD
-
OLD_TESTNG_DTD_URL
-
TESTNG_DTD_URL
-
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 aParserto 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:
- -
trueif 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
-