| Modifier and Type | Field and Description |
|---|---|
| private static final Comparator | COMPARATOR
A Custom comparator that helps in |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private static boolean | |
| private static boolean | |
| private static List | findMethodListSuperClass(Map<Class<?>, List<ITestNGMethod>> map, Class<? extends ITestNGMethod> methodClass)
Look in map for a class that is a superclass of methodClass |
| private static Class | findSubClass(Map<Class<?>, List<ITestNGMethod>> map, Class<? extends ITestNGMethod> methodClass)
Look in map for a class that is a subclass of methodClass |
| public static void | fixMethodInheritance(ITestNGMethod[]
the list of methods methods, boolean true if we are handling a before method (meaning, the methods need to be sorted
base class first and subclass last). false otherwise (subclass methods first, base classes
last). before)Fix the methodsDependedUpon to make sure that @Configuration methods respect inheritance (before methods are invoked in the order Base first and after methods are invoked in the order Child first) |
| private static boolean | |
| private static boolean | |
| private static void | sortMethodsByInheritance(List<ITestNGMethod> methods, boolean baseClassToChild)
Given a list of methods belonging to the same class hierarchy, orders them from the base class to the child (if true) or from child to base class (if false) |
| COMPARATOR | back to summary |
|---|---|
| private static final Comparator<ITestNGMethod> COMPARATOR A Custom comparator that helps in
Lets say we have :
| |
| MethodInheritance | back to summary |
|---|---|
| public MethodInheritance() | |
| dependencyExists | back to summary |
|---|---|
| private static boolean dependencyExists(ITestNGMethod m1, ITestNGMethod m2, ITestNGMethod[] methods) | |
| equalsEffectiveClass | back to summary |
|---|---|
| private static boolean equalsEffectiveClass(ITestNGMethod m1, ITestNGMethod m2) | |
| findMethodListSuperClass | back to summary |
|---|---|
| private static List Look in map for a class that is a superclass of methodClass | |
| findSubClass | back to summary |
|---|---|
| private static Class Look in map for a class that is a subclass of methodClass | |
| fixMethodInheritance | back to summary |
|---|---|
| public static void fixMethodInheritance(ITestNGMethod[] methods, boolean before) Fix the methodsDependedUpon to make sure that @Configuration methods respect inheritance (before methods are invoked in the order Base first and after methods are invoked in the order Child first)
| |
| hasUpstreamHierarchy | back to summary |
|---|---|
| private static boolean hasUpstreamHierarchy(ITestNGMethod m1, ITestNGMethod m2) | |
| internalDependencyExists | back to summary |
|---|---|
| private static boolean internalDependencyExists(ITestNGMethod m1, ITestNGMethod m2, ITestNGMethod[] methods) | |
| sortMethodsByInheritance | back to summary |
|---|---|
| private static void sortMethodsByInheritance(List<ITestNGMethod> methods, boolean baseClassToChild) Given a list of methods belonging to the same class hierarchy, orders them from the base class to the child (if true) or from child to base class (if false) | |