Package org.testng.xml.internal
Class Parser
java.lang.Object
org.testng.xml.internal.Parser
- Direct Known Subclasses:
Parser
Parser is a parser for a TestNG XML test suite file.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final ISuiteParserstatic final StringThe default file name for the TestNG test suite if none is specified (testng.xml).static final Stringprivate StringThe file name of the xml suite being parsed.private InputStreamprivate booleanprivate IPostProcessorstatic final StringThe URL to the deprecated TestNG DTD.private static final List<ISuiteParser> 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 booleanprivate static URIconstructURI(String text) private static IFileParserstatic booleanhasFileScheme(String uri) private voidinit(String fileName, InputStream is) private static ParsernewParser(InputStream is, IPostProcessor processor) private static ParsernewParser(String path, IPostProcessor processor) 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
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:
-
DEFAULT_FILE_PARSER
-
PARSERS
-
m_fileName
The file name of the xml suite being parsed. This may be null if the Parser has not been initialized with a file name. TODO CQ This member is never used. -
m_inputStream
-
m_postProcessor
-
m_loadClasses
private boolean m_loadClasses
-
-
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
-
init
-
setPostProcessor
-
setLoadClasses
public void setLoadClasses(boolean loadClasses) - Parameters:
loadClasses- If false, don't try to load the classes during the parsing.
-
getParser
-
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
-
newParser
-
newParser
-
constructURI
-