Class ClassImpl

java.lang.Object
org.testng.internal.ClassImpl
All Implemented Interfaces:
IClass, IObject

public class ClassImpl extends Object implements IClass, IObject
Implementation of an IClass.
  • Constructor Details

  • Method Details

    • getTestName

      public String getTestName()
      Specified by:
      getTestName in interface IClass
      Returns:
      its test name if this class implements org.testng.ITest, null otherwise.
    • getName

      public String getName()
      Specified by:
      getName in interface IClass
      Returns:
      this test class name. This is the name of the corresponding Java class.
    • getRealClass

      public Class<?> getRealClass()
      Specified by:
      getRealClass in interface IClass
      Returns:
      the Java class corresponding to this IClass.
    • getInstanceHashCodes

      public long[] getInstanceHashCodes()
      Specified by:
      getInstanceHashCodes in interface IClass
      Specified by:
      getInstanceHashCodes in interface IObject
      Returns:
      - An array representing the hash codes of the corresponding instances.
    • getXmlTest

      public XmlTest getXmlTest()
      Specified by:
      getXmlTest in interface IClass
      Returns:
      the <test> tag this class was found in.
    • getXmlClass

      public XmlClass getXmlClass()
      Specified by:
      getXmlClass in interface IClass
      Returns:
      the *lt;class> tag this class was found in.
    • getInstances

      public Object[] getInstances(boolean create)
      Description copied from interface: IClass
      Returns all the instances the methods will be invoked upon. This will typically be an array of one object in the absence of a @Factory annotation.
      Specified by:
      getInstances in interface IClass
      Parameters:
      create - flag if a new set of instances must be returned (if set to false)
      Returns:
      All the instances the methods will be invoked upon.
    • getInstances

      public Object[] getInstances(boolean create, String errorMsgPrefix)
      Description copied from interface: IClass
      Returns all the instances the methods will be invoked upon. This will typically be an array of one object in the absence of a @Factory annotation.
      Specified by:
      getInstances in interface IClass
      Parameters:
      create - flag if a new set of instances must be returned (if set to false)
      errorMsgPrefix - - Text that should be prefixed to the error message when there are issues. Can be empty.
      Returns:
      All the instances the methods will be invoked upon.
    • addObject

      public void addObject(IObject.IdentifiableObject instance)
      Specified by:
      addObject in interface IObject
      Parameters:
      instance - - The instance that should be added to the list of instances.
    • getObjects

      public IObject.IdentifiableObject[] getObjects(boolean create, String errorMsgPrefix)
      Description copied from interface: IObject
      Returns all the instances the methods will be invoked upon. This will typically be an array of one object in the absence of a @Factory annotation.
      Specified by:
      getObjects in interface IObject
      Parameters:
      create - - true if objects should be created before returning.
      errorMsgPrefix - - Text that should be prefixed to the error message when there are issues. Can be empty.
      Returns:
      - An array of IObject.IdentifiableObject objects
    • toString

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

      public void addInstance(Object instance)
      Specified by:
      addInstance in interface IClass
      Parameters:
      instance - - The instance to be added.