Package org.testng
Class TestClass
- java.lang.Object
-
- org.testng.internal.NoOpTestClass
-
- org.testng.TestClass
-
- All Implemented Interfaces:
IClass,ITestClass
class TestClass extends NoOpTestClass implements ITestClass
This class represents a test class: - The test methods - The configuration methods (test and method) - The class file
-
-
Field Summary
Fields Modifier and Type Field Description private IAnnotationFinderannotationFinderprivate IClassiClassprivate static LoggerLOGprivate ITestMethodFindertestMethodFinderprivate java.lang.StringtestNameprivate XmlClassxmlClassprivate XmlTestxmlTest-
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
Constructors Modifier Constructor Description protectedTestClass(IClass cls, ITestMethodFinder testMethodFinder, IAnnotationFinder annotationFinder, RunInfo runInfo, XmlTest xmlTest, XmlClass xmlClass)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddInstance(java.lang.Object instance)private ITestNGMethod[]createTestMethods(ITestNGMethod[] methods)Create the test methods that belong to this class (rejects all those that belong to a different class).protected voiddump()IAnnotationFindergetAnnotationFinder()IClassgetIClass()intgetInstanceCount()Deprecated.long[]getInstanceHashCodes()java.lang.Object[]getInstances(boolean create)Returns all the instances the methods will be invoked upon.ITestMethodFindergetTestMethodFinder()java.lang.StringgetTestName()If this class implements org.testng.ITest, returns its test name, otherwise returns null.XmlClassgetXmlClass()XmlTestgetXmlTest()private voidinit(IClass cls, ITestMethodFinder testMethodFinder, IAnnotationFinder annotationFinder, XmlTest xmlTest, XmlClass xmlClass)private voidinitMethods()private voidinitTestClassesAndInstances()private voidlog(int level, java.lang.String s)java.lang.StringtoString()-
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.IClass
getName, getRealClass
-
Methods inherited from interface org.testng.ITestClass
getAfterClassMethods, getAfterGroupsMethods, getAfterSuiteMethods, getAfterTestConfigurationMethods, getAfterTestMethods, getBeforeClassMethods, getBeforeGroupsMethods, getBeforeSuiteMethods, getBeforeTestConfigurationMethods, getBeforeTestMethods, getTestMethods
-
-
-
-
Field Detail
-
annotationFinder
private IAnnotationFinder annotationFinder
-
testMethodFinder
private ITestMethodFinder testMethodFinder
-
iClass
private IClass iClass
-
testName
private java.lang.String testName
-
xmlTest
private XmlTest xmlTest
-
xmlClass
private XmlClass xmlClass
-
LOG
private static final Logger LOG
-
-
Constructor Detail
-
TestClass
protected TestClass(IClass cls, ITestMethodFinder testMethodFinder, IAnnotationFinder annotationFinder, RunInfo runInfo, XmlTest xmlTest, XmlClass xmlClass)
-
-
Method Detail
-
getTestName
public java.lang.String getTestName()
Description copied from interface:IClassIf this class implements org.testng.ITest, returns its test name, otherwise returns null.- Specified by:
getTestNamein interfaceIClass- Overrides:
getTestNamein classNoOpTestClass
-
getXmlTest
public XmlTest getXmlTest()
- Specified by:
getXmlTestin interfaceIClass- Overrides:
getXmlTestin classNoOpTestClass- Returns:
- the <test> tag this class was found in.
-
getXmlClass
public XmlClass getXmlClass()
- Specified by:
getXmlClassin interfaceIClass- Overrides:
getXmlClassin classNoOpTestClass- Returns:
- the *lt;class> tag this class was found in.
-
getAnnotationFinder
public IAnnotationFinder getAnnotationFinder()
-
init
private void init(IClass cls, ITestMethodFinder testMethodFinder, IAnnotationFinder annotationFinder, XmlTest xmlTest, XmlClass xmlClass)
-
initTestClassesAndInstances
private void initTestClassesAndInstances()
-
getInstances
public java.lang.Object[] getInstances(boolean create)
Description copied from interface:IClassReturns 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:
getInstancesin interfaceIClass- Overrides:
getInstancesin classNoOpTestClass- 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.
- See Also:
IClass.getInstances(boolean)
-
getInstanceHashCodes
public long[] getInstanceHashCodes()
- Specified by:
getInstanceHashCodesin interfaceIClass- Overrides:
getInstanceHashCodesin classNoOpTestClass- See Also:
IClass.getInstanceHashCodes()
-
getInstanceCount
@Deprecated public int getInstanceCount()
Deprecated.- Specified by:
getInstanceCountin interfaceIClass- Overrides:
getInstanceCountin classNoOpTestClass- 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:
addInstancein interfaceIClass- Overrides:
addInstancein classNoOpTestClass- See Also:
IClass.addInstance(java.lang.Object)
-
initMethods
private void initMethods()
-
createTestMethods
private ITestNGMethod[] createTestMethods(ITestNGMethod[] methods)
Create the test methods that belong to this class (rejects all those that belong to a different class).
-
getTestMethodFinder
public ITestMethodFinder getTestMethodFinder()
-
log
private void log(int level, java.lang.String s)
-
dump
protected void dump()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getIClass
public IClass getIClass()
-
-