TestClass (TestNG)

Overview | Package | Class | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.testng
Class TestClass

    java.lang.Object
      org.testng.internal.NoOpTestClass
          org.testng.TestClass

All Implemented Interfaces:
  java.io.Serializable, IClass, ITestClass

    public class TestClass

extends org.testng.internal.NoOpTestClass
implements ITestClass

This class represents a test class: - The test methods - The configuration methods (test and method) - The class file

Author:
  Cedric Beust, Alexandru Popescu
See Also:
  Serialized Form

Field Summary

Fields inherited from class org.testng.internal.NoOpTestClass
`m_afterClassMethods, m_afterGroupsMethods, m_afterSuiteMethods, m_afterTestConfMethods, m_afterTestMethods, m_beforeClassMethods, m_beforeGroupsMethods, m_beforeSuiteMethods, m_beforeTestConfMethods, m_beforeTestMethods, m_testClass, m_testMethods`

Constructor Summary
`TestClass(IClass cls, ITestMethodFinder testMethodFinder, org.testng.internal.annotations.IAnnotationFinder annotationFinder, org.testng.internal.RunInfo runInfo, XmlTest xmlTest, XmlClass xmlClass)`

Method Summary
`void` | `addInstance(java.lang.Object instance)`
`void` | `dump()`
`org.testng.internal.annotations.IAnnotationFinder` | `getAnnotationFinder()`
`int` | `getInstanceCount()`
`long[]` | `getInstanceHashCodes()` TODO cquezel JavaDoc.
`java.lang.Object[]` | `getInstances(boolean create)` Returns all the instances the methods will be invoked upon.
`ITestMethodFinder` | `getTestMethodFinder()`
`java.lang.String` | `getTestName()` If this class implements ITest, returns its test name, otherwise returns null.
`XmlClass` | `getXmlClass()`
`XmlTest` | `getXmlTest()`
`java.lang.String` | `toString()`

Methods inherited from class org.testng.internal.NoOpTestClass
`getAfterClassMethods, getAfterGroupsMethods, getAfterSuiteMethods, getAfterTestConfigurationMethods, getAfterTestMethods, getBeforeClassMethods, getBeforeGroupsMethods, getBeforeSuiteMethods, getBeforeTestConfigurationMethods, getBeforeTestMethods, getName, getRealClass, getTestMethods, setAfterTestMethod, setBeforeTestMethods, setTestClass`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Methods inherited from interface org.testng.ITestClass
`getAfterClassMethods, getAfterGroupsMethods, getAfterSuiteMethods, getAfterTestConfigurationMethods, getAfterTestMethods, getBeforeClassMethods, getBeforeGroupsMethods, getBeforeSuiteMethods, getBeforeTestConfigurationMethods, getBeforeTestMethods, getTestMethods`

Methods inherited from interface org.testng.IClass
`getName, getRealClass`

Constructor Detail

### TestClass

    public TestClass(IClass cls,
                     ITestMethodFinder testMethodFinder,
                     org.testng.internal.annotations.IAnnotationFinder annotationFinder,
                     org.testng.internal.RunInfo runInfo,
                     XmlTest xmlTest,
                     XmlClass xmlClass)

Method Detail

### getTestName

    public java.lang.String getTestName()

  Description copied from interface: `IClass`
  If this class implements ITest, returns its test name, otherwise returns null.

  Specified by:
    `getTestName` in interface `IClass`
  Overrides:
    `getTestName` in class `org.testng.internal.NoOpTestClass`
  Returns:
    the name of this test if the class implements org.testng.ITest, null otherwise.

### getXmlTest

    public XmlTest getXmlTest()

  Specified by:
    `getXmlTest` in interface `IClass`
  Overrides:
    `getXmlTest` in class `org.testng.internal.NoOpTestClass`
  Returns:
    the <test> tag this class was found in.

### getXmlClass

    public XmlClass getXmlClass()

  Specified by:
    `getXmlClass` in interface `IClass`
  Overrides:
    `getXmlClass` in class `org.testng.internal.NoOpTestClass`
  Returns:
    the *lt;class> tag this class was found in.

### getAnnotationFinder

    public org.testng.internal.annotations.IAnnotationFinder getAnnotationFinder()

### getInstances

    public java.lang.Object[] getInstances(boolean create)

  Description copied from interface: `ITestClass`
  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`
  Specified by:
    `getInstances` in interface `ITestClass`
  Overrides:
    `getInstances` in class `org.testng.internal.NoOpTestClass`
  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.

### getInstanceHashCodes

    public long[] getInstanceHashCodes()

  Description copied from interface: `ITestClass`
  TODO cquezel JavaDoc.

  Specified by:
    `getInstanceHashCodes` in interface `IClass`
  Specified by:
    `getInstanceHashCodes` in interface `ITestClass`
  Overrides:
    `getInstanceHashCodes` in class `org.testng.internal.NoOpTestClass`

### getInstanceCount

    public int getInstanceCount()

  Specified by:
    `getInstanceCount` in interface `IClass`
  Specified by:
    `getInstanceCount` in interface `ITestClass`
  Overrides:
    `getInstanceCount` in class `org.testng.internal.NoOpTestClass`
  Returns:
    The number of instances used in this class. This method is needed for serialization since we don't know ahead of time if the instances of the test classes will be serializable.

### addInstance

    public void addInstance(java.lang.Object instance)

  Specified by:
    `addInstance` in interface `IClass`
  Overrides:
    `addInstance` in class `org.testng.internal.NoOpTestClass`

### getTestMethodFinder

    public ITestMethodFinder getTestMethodFinder()

### dump

    public void dump()

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`

Overview | Package | Class | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD