Fixed: Identical configuration methods were not always invoked in the correct order in superclasses (Nalin Makar)
diff --git a/CHANGES.txt b/CHANGES.txt
index 02b9052..833e0f5 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -7,6 +7,7 @@
Added: Passing command line properties via the ant task and doc update (Todd Wells)
Added: Hierarchical XmlSuites (Nalin Makar)
Added: Reporter#clear()
+Fixed: Identical configuration methods were not always invoked in the correct order in superclasses (Nalin Makar)
Fixed: @DataProvider(parallel = true) was passing incorrect parameters with injection
Fixed: Replaced @Test(sequential) with @Test(singleThreaded)
Fixed: If inherited configuration methods had defined deps, they could be invoked in incorrect order (Nalin Makar)
diff --git a/src/org/testng/internal/MethodInheritance.java b/src/org/testng/internal/MethodInheritance.java
index 7a6567e..54eae93 100755
--- a/src/org/testng/internal/MethodInheritance.java
+++ b/src/org/testng/internal/MethodInheritance.java
@@ -50,10 +50,12 @@
* respect inheritance (before methods are invoked in the order Base first
* and after methods are invoked in the order Child first)
*
- * @param methods
- * @param baseClassToChild
+ * @param methods the list of methods
+ * @param before 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).
*/
- public static void fixMethodInheritance(ITestNGMethod[] methods, boolean baseClassToChild) {
+ public static void fixMethodInheritance(ITestNGMethod[] methods, boolean before) {
// Map of classes -> List of methods that belong to this class or same hierarchy
Map<Class, List<ITestNGMethod>> map = Maps.newHashMap();
@@ -88,7 +90,7 @@
for (List<ITestNGMethod> l : map.values()) {
if (l.size() > 1) {
// Sort them
- sortMethodsByInheritance(l, baseClassToChild);
+ sortMethodsByInheritance(l, before);
/*
* Set methodDependedUpon accordingly
@@ -160,7 +162,7 @@
boolean baseClassToChild)
{
Collections.sort(methods);
- if (!baseClassToChild) {
+ if (! baseClassToChild) {
Collections.reverse(methods);
}
}