Class XmlClass

java.lang.Object
org.testng.xml.XmlClass
All Implemented Interfaces:
Cloneable

public class XmlClass extends Object implements Cloneable
This class describes the tag <class> in testng.xml.
  • Field Details

    • m_includedMethods

      private List<XmlInclude> m_includedMethods
    • m_excludedMethods

      private List<String> m_excludedMethods
    • m_name

      private String m_name
    • m_class

      private Class m_class
    • m_index

      private int m_index
      The index of this class in the <test> tag
    • m_loadClasses

      private boolean m_loadClasses
      True if the classes need to be loaded
    • m_parameters

      private Map<String,String> m_parameters
    • m_xmlTest

      private XmlTest m_xmlTest
  • Constructor Details

    • XmlClass

      public XmlClass()
    • XmlClass

      public XmlClass(String name)
    • XmlClass

      public XmlClass(String name, boolean loadClasses)
    • XmlClass

      public XmlClass(Class cls)
    • XmlClass

      public XmlClass(Class cls, boolean loadClasses)
    • XmlClass

      public XmlClass(String className, int index)
    • XmlClass

      public XmlClass(String className, int index, boolean loadClasses)
  • Method Details

    • init

      private void init(String className, Class cls, int index)
    • init

      private void init(String className, Class cls, int index, boolean resolveClass)
    • loadClass

      private void loadClass()
    • getSupportClass

      public Class<?> getSupportClass()
      Returns:
      Returns the className.
    • setClass

      public void setClass(Class className)
      Parameters:
      className - The className to set.
    • getExcludedMethods

      public List<String> getExcludedMethods()
      Returns:
      Returns the excludedMethods.
    • setExcludedMethods

      public void setExcludedMethods(List<String> excludedMethods)
      Parameters:
      excludedMethods - The excludedMethods to set.
    • getIncludedMethods

      public List<XmlInclude> getIncludedMethods()
      Returns:
      Returns the includedMethods.
    • setIncludedMethods

      public void setIncludedMethods(List<XmlInclude> includedMethods)
      Parameters:
      includedMethods - The includedMethods to set.
    • getName

      public String getName()
      Returns:
      Returns the name.
    • setName

      public void setName(String name)
      Parameters:
      name - The name to set.
    • loadClasses

      public boolean loadClasses()
      Returns:
      true if the classes need to be loaded.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toXml

      public String toXml(String indent)
    • listToString

      public static String listToString(List<Integer> invocationNumbers)
    • clone

      public Object clone()
      Clone an XmlClass by copying all its components.
      Overrides:
      clone in class Object
    • getIndex

      public int getIndex()
      Note that this attribute does not come from the XML file, it's calculated internally and represents the order in which this class was found in its <test> tag. It's used to calculate the ordering of the classes when preserve-order is true.
      Returns:
      the value
    • setIndex

      public void setIndex(int index)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • setParameters

      public void setParameters(Map<String,String> parameters)
    • getAllParameters

      public Map<String,String> getAllParameters()
      Returns:
      The parameters defined in this test tag and the tags above it.
    • getLocalParameters

      public Map<String,String> getLocalParameters()
      Returns:
      The parameters defined in this tag, and only this test tag. To retrieve the inherited parameters as well, call getAllParameters().
    • setXmlTest

      public void setXmlTest(XmlTest test)