Package org.testng.internal
Class ClassImpl
java.lang.Object
org.testng.internal.ClassImpl
Implementation of an IClass.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.testng.internal.IObject
IObject.IdentifiableArrayObject, IObject.IdentifiableObject
-
Constructor Summary
ConstructorsConstructorDescriptionClassImpl
(ITestContext context, Class<?> cls, XmlClass xmlClass, IObject.IdentifiableObject instance, Map<Class<?>, IClass> classes, IAnnotationFinder annotationFinder, ITestObjectFactory objectFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addInstance
(Object instance) void
addObject
(IObject.IdentifiableObject instance) long[]
Object[]
getInstances
(boolean create) Returns all the instances the methods will be invoked upon.Object[]
getInstances
(boolean create, String errorMsgPrefix) Returns all the instances the methods will be invoked upon.getName()
getObjects
(boolean create, String errorMsgPrefix) Returns all the instances the methods will be invoked upon.Class
<?> toString()
-
Constructor Details
-
ClassImpl
public ClassImpl(ITestContext context, Class<?> cls, XmlClass xmlClass, IObject.IdentifiableObject instance, Map<Class<?>, IClass> classes, IAnnotationFinder annotationFinder, ITestObjectFactory objectFactory)
-
-
Method Details
-
getTestName
- Specified by:
getTestName
in interfaceIClass
- Returns:
- its test name if this class implements org.testng.ITest, null otherwise.
-
getName
-
getRealClass
- Specified by:
getRealClass
in interfaceIClass
- Returns:
- the Java class corresponding to this IClass.
-
getInstanceHashCodes
public long[] getInstanceHashCodes()- Specified by:
getInstanceHashCodes
in interfaceIClass
- Specified by:
getInstanceHashCodes
in interfaceIObject
- Returns:
- - An array representing the hash codes of the corresponding instances.
-
getXmlTest
- Specified by:
getXmlTest
in interfaceIClass
- Returns:
- the <test> tag this class was found in.
-
getXmlClass
- Specified by:
getXmlClass
in interfaceIClass
- Returns:
- the *lt;class> tag this class was found in.
-
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
- 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.
-
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
- Parameters:
create
- flag if a new set of instances must be returned (if set tofalse
)errorMsgPrefix
- - Text that should be prefixed to the error message when there are issues. Can be empty.- Returns:
- All the instances the methods will be invoked upon.
-
addObject
-
getObjects
Description copied from interface:IObject
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:
getObjects
in interfaceIObject
- Parameters:
create
- -true
if objects should be created before returning.errorMsgPrefix
- - Text that should be prefixed to the error message when there are issues. Can be empty.- Returns:
- - An array of
IObject.IdentifiableObject
objects
-
toString
-
addInstance
- Specified by:
addInstance
in interfaceIClass
- Parameters:
instance
- - The instance to be added.
-