Class Parser

java.lang.Object
org.testng.xml.internal.Parser

public class Parser extends Object
Parser is a parser for a TestNG XML test suite file.
  • Field Details

  • Constructor Details

    • Parser

      public Parser(String fileName)
      Constructs a Parser 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

      public Parser(InputStream is)
  • Method Details

    • setPostProcessor

      public void setPostProcessor(IPostProcessor processor)
    • setLoadClasses

      public void setLoadClasses(boolean loadClasses)
      Parameters:
      loadClasses - If false, don't try to load the classes during the parsing.
    • parse

      public Collection<XmlSuite> parse() throws IOException
      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

      public static boolean hasFileScheme(String uri)
      Parameters:
      uri - - The uri to be verified.
      Returns:
      - true if the uri has "file:" as its scheme.
    • parseToList

      public List<XmlSuite> parseToList() throws IOException
      Throws:
      IOException
    • parse

      public static Collection<XmlSuite> parse(String suite, IPostProcessor processor) throws IOException
      Throws:
      IOException
    • parse

      public static Collection<XmlSuite> parse(InputStream is, IPostProcessor processor) throws IOException
      Throws:
      IOException
    • canParse

      public static boolean canParse(String fileName)