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 IAnnotationFinder
private Map<String,
List<ITestNGMethod>> private IClass
private static final Logger
private final String
private ITestMethodFinder
private String
private XmlClass
private XmlTest
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
ConstructorsModifierConstructorDescriptionprotected
TestClass
(IClass cls, ITestMethodFinder testMethodFinder, IAnnotationFinder annotationFinder, XmlTest xmlTest, XmlClass xmlClass, String errorMsgPrefix) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addInstance
(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 void
dump()
get all before class config methodsgetInstanceBeforeClassMethods
(String instance) Query the instance before class methods from config methods maplong[]
Object[]
getInstances
(boolean create) Returns all the instances the methods will be invoked upon.Object[]
getInstances
(boolean create, String errorMsgPrefix) private void
init
(IClass cls, ITestMethodFinder testMethodFinder, IAnnotationFinder annotationFinder, XmlTest xmlTest, XmlClass xmlClass) private void
private void
private void
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.IClass
getName, getRealClass
Methods 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
-
m_errorMsgPrefix
-
beforeClassConfig
-
LOG
-
-
Constructor Details
-
TestClass
protected TestClass(IClass cls, ITestMethodFinder testMethodFinder, IAnnotationFinder annotationFinder, XmlTest xmlTest, XmlClass xmlClass, String errorMsgPrefix)
-
-
Method Details
-
getAllBeforeClassMethods
Description copied from interface:ITestClassConfigInfo
get all before class config methods- Specified by:
getAllBeforeClassMethods
in interfaceITestClassConfigInfo
- Returns:
- all before class config methods
-
getInstanceBeforeClassMethods
Description copied from interface:ITestClassConfigInfo
Query the instance before class methods from config methods map- Specified by:
getInstanceBeforeClassMethods
in interfaceITestClassConfigInfo
- Parameters:
instance
- object hashcode- Returns:
- All before class methods of instance
-
getTestName
- Specified by:
getTestName
in interfaceIClass
- Overrides:
getTestName
in classNoOpTestClass
- Returns:
- its test name if this class implements org.testng.ITest, null otherwise.
-
getXmlTest
- Specified by:
getXmlTest
in interfaceIClass
- Overrides:
getXmlTest
in classNoOpTestClass
- Returns:
- the <test> tag this class was found in.
-
getXmlClass
- Specified by:
getXmlClass
in interfaceIClass
- Overrides:
getXmlClass
in 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: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 interfaceIClass
- Overrides:
getInstances
in 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:
getInstances
in interfaceIClass
-
getInstanceHashCodes
public long[] getInstanceHashCodes()- Specified by:
getInstanceHashCodes
in interfaceIClass
- Overrides:
getInstanceHashCodes
in classNoOpTestClass
- See Also:
-
addInstance
- Specified by:
addInstance
in interfaceIClass
- Overrides:
addInstance
in 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
-