-
Notifications
You must be signed in to change notification settings - Fork 1k
/
IClass.java
74 lines (61 loc) · 1.76 KB
/
IClass.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
package org.testng;
import org.testng.xml.XmlClass;
import org.testng.xml.XmlTest;
/**
* <code>IClass</code> represents a test class and a collection of its instances.
*/
public interface IClass {
/**
* @return this test class name. This is the name of the
* corresponding Java class.
*/
default String getName() {
return getXmlClass().getName();
}
/**
* @return the <test> tag this class was found in.
*/
XmlTest getXmlTest();
/**
* @return the *lt;class> tag this class was found in.
*/
XmlClass getXmlClass();
default String getNameIndex() {
return getXmlClass().getNameIndex();
}
default int getIndex() {
return getXmlClass().getIndex();
}
/**
* If this class implements org.testng.ITest, returns its test name, otherwise returns null.
*/
default String getTestName() {
return getXmlTest().getName();
}
/**
* @return the Java class corresponding to this IClass.
*/
default Class<?> getRealClass() {
return getXmlClass().getSupportClass();
}
/**
* 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.
*
* @param create flag if a new set of instances must be returned
* (if set to <tt>false</tt>)
* @return All the instances the methods will be invoked upon.
*/
Object[] getInstances(boolean create);
/**
* @return 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.
* @deprecated Not used
*/
@Deprecated
int getInstanceCount();
long[] getInstanceHashCodes();
void addInstance(Object instance);
}