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 java.lang.Stringm_errorMsgPrefixprivate 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, XmlTest xmlTest, XmlClass xmlClass, java.lang.String errorMsgPrefix)
-
Method Summary
All Methods Instance Methods Concrete 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()long[]getInstanceHashCodes()java.lang.Object[]getInstances(boolean create)Returns all the instances the methods will be invoked upon.java.lang.Object[]getInstances(boolean create, java.lang.String errorMsgPrefix)ITestMethodFindergetTestMethodFinder()java.lang.StringgetTestName()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
-
m_errorMsgPrefix
private java.lang.String m_errorMsgPrefix
-
LOG
private static final Logger LOG
-
-
Constructor Detail
-
TestClass
protected TestClass(IClass cls, ITestMethodFinder testMethodFinder, IAnnotationFinder annotationFinder, XmlTest xmlTest, XmlClass xmlClass, java.lang.String errorMsgPrefix)
-
-
Method Detail
-
getTestName
public java.lang.String getTestName()
- Specified by:
getTestNamein interfaceIClass- Overrides:
getTestNamein classNoOpTestClass- Returns:
- its test name if this class implements org.testng.ITest, null otherwise.
-
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 tofalse)- Returns:
- All the instances the methods will be invoked upon.
- See Also:
IClass.getInstances(boolean)
-
getInstances
public java.lang.Object[] getInstances(boolean create, java.lang.String errorMsgPrefix)- Specified by:
getInstancesin interfaceIClass
-
getInstanceHashCodes
public long[] getInstanceHashCodes()
- Specified by:
getInstanceHashCodesin interfaceIClass- Overrides:
getInstanceHashCodesin classNoOpTestClass- See Also:
IClass.getInstanceHashCodes()
-
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()
-
-