Package org.testng
Class TestClass
java.lang.Object
org.testng.internal.NoOpTestClass
org.testng.TestClass
- All Implemented Interfaces:
IClass,ITestClassConfigInfo,ITestClass
This class represents a test class: - The test methods - The configuration methods (test and
method) - The class file
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate IAnnotationFinderprivate final IdentityHashMap<Object, List<ITestNGMethod>> private IClassprivate static final Loggerprivate final Stringprivate final ITestObjectFactoryprivate ITestMethodFinderprivate Stringprivate XmlClassprivate XmlTestFields 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
ConstructorsModifierConstructorDescriptionprotectedTestClass(ITestObjectFactory objectFactory, IClass cls, ITestMethodFinder testMethodFinder, IAnnotationFinder annotationFinder, XmlTest xmlTest, XmlClass xmlClass, String errorMsgPrefix) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddInstance(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()get all before class config methodsgetInstanceBeforeClassMethods(Object instance) Query the instance before class methods from config methods map.long[]Object[]getInstances(boolean create) Returns all the instances the methods will be invoked upon.Object[]getInstances(boolean create, String errorMsgPrefix) private voidinit(IClass cls, ITestMethodFinder testMethodFinder, IAnnotationFinder annotationFinder, XmlTest xmlTest, XmlClass xmlClass) private voidprivate voidprivate voidtoString()Methods inherited from class org.testng.internal.NoOpTestClass
getAfterClassMethods, getAfterGroupsMethods, getAfterSuiteMethods, getAfterTestConfigurationMethods, getAfterTestMethods, getBeforeClassMethods, getBeforeGroupsMethods, getBeforeSuiteMethods, getBeforeTestConfigurationMethods, getBeforeTestMethods, getName, getRealClass, getTestMethods, setAfterTestMethod, setBeforeTestMethods, setTestClassMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.testng.IClass
getName, getRealClassMethods inherited from interface org.testng.ITestClass
getAfterClassMethods, getAfterGroupsMethods, getAfterSuiteMethods, getAfterTestConfigurationMethods, getAfterTestMethods, getBeforeClassMethods, getBeforeGroupsMethods, getBeforeSuiteMethods, getBeforeTestConfigurationMethods, getBeforeTestMethods, getTestMethods
-
Field Details
-
annotationFinder
-
testMethodFinder
-
iClass
-
testName
-
xmlTest
-
xmlClass
-
objectFactory
-
m_errorMsgPrefix
-
beforeClassConfig
-
LOG
-
-
Constructor Details
-
TestClass
protected TestClass(ITestObjectFactory objectFactory, IClass cls, ITestMethodFinder testMethodFinder, IAnnotationFinder annotationFinder, XmlTest xmlTest, XmlClass xmlClass, String errorMsgPrefix)
-
-
Method Details
-
getAllBeforeClassMethods
Description copied from interface:ITestClassConfigInfoget all before class config methods- Specified by:
getAllBeforeClassMethodsin interfaceITestClassConfigInfo- Returns:
- all before class config methods
-
getInstanceBeforeClassMethods
Description copied from interface:ITestClassConfigInfoQuery the instance before class methods from config methods map.- Specified by:
getInstanceBeforeClassMethodsin interfaceITestClassConfigInfo- Parameters:
instance- object hashcode- Returns:
- All before class methods of instance
-
getTestName
- Specified by:
getTestNamein interfaceIClass- Overrides:
getTestNamein classNoOpTestClass- Returns:
- its test name if this class implements org.testng.ITest, null otherwise.
-
getXmlTest
- Specified by:
getXmlTestin interfaceIClass- Overrides:
getXmlTestin classNoOpTestClass- Returns:
- the <test> tag this class was found in.
-
getXmlClass
- Specified by:
getXmlClassin interfaceIClass- Overrides:
getXmlClassin classNoOpTestClass- Returns:
- the *lt;class> tag this class was found in.
-
getAnnotationFinder
-
init
private void init(IClass cls, ITestMethodFinder testMethodFinder, IAnnotationFinder annotationFinder, XmlTest xmlTest, XmlClass xmlClass) -
initTestClassesAndInstances
private void initTestClassesAndInstances() -
getInstances
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:
-
getInstances
- Specified by:
getInstancesin interfaceIClass
-
getInstanceHashCodes
public long[] getInstanceHashCodes()- Specified by:
getInstanceHashCodesin interfaceIClass- Overrides:
getInstanceHashCodesin classNoOpTestClass- See Also:
-
addInstance
- Specified by:
addInstancein interfaceIClass- Overrides:
addInstancein classNoOpTestClass- See Also:
-
initMethods
private void initMethods() -
createTestMethods
Create the test methods that belong to this class (rejects all those that belong to a different class). -
getTestMethodFinder
-
log
-
dump
protected void dump() -
toString
-
getIClass
-