2342N/AIndex: src/main/org/testng/internal/MethodInheritance.java
2342N/A===================================================================
2342N/A--- src/main/org/testng/internal/MethodInheritance.java (revision 502)
2342N/A+++ src/main/org/testng/internal/MethodInheritance.java (working copy)
2342N/A@@ -102,27 +102,19 @@
2342N/A // Sort them
2342N/A sortMethodsByInheritance(l, baseClassToChild);
2342N/A
2342N/A- // Set methodDependedUpon accordingly
2342N/A- if (baseClassToChild) {
2342N/A- for (int i = 1; i < l.size(); i++) {
2342N/A- ITestNGMethod m1 = l.get(i - 1);
2342N/A- ITestNGMethod m2 = l.get(i);
2342N/A+ for (int i = 0; i < l.size(); i++) {
2342N/A+ ITestNGMethod m1 = l.get(i);
2342N/A+ // Look for any method further down that is a subclass of this one.
2342N/A+ // This handles the case when there are multiple BeforeClass/AfterClass
2342N/A+ // methods in the same class.
2342N/A+ for (int j = i + 1; j < l.size(); j++) {
2342N/A+ ITestNGMethod m2 = l.get(j);
2342N/A if (! equalsEffectiveClass(m1, m2)) {
2342N/A Utils.log("MethodInheritance", 4, m2 + " DEPENDS ON " + m1);
2342N/A m2.addMethodDependedUpon(MethodHelper.calculateMethodCanonicalName(m1));
2342N/A }
2342N/A }
2342N/A }
2342N/A- else {
2342N/A- for (int i = 0; i < l.size() - 1; i++) {
2342N/A- ITestNGMethod m1 = l.get(i);
2342N/A- ITestNGMethod m2 = l.get(i + 1);
2342N/A- if (! equalsEffectiveClass(m1, m2)) {
2342N/A- m2.addMethodDependedUpon(MethodHelper.calculateMethodCanonicalName(m1));
2342N/A- Utils.log("MethodInheritance", 4, m2 + " DEPENDS ON " + m1);
2342N/A- }
2342N/A- }
2342N/A- }
2342N/A }
2342N/A }
2342N/A }
2342N/AIndex: src/main/org/testng/TestRunner.java
2342N/A===================================================================
2342N/A--- src/main/org/testng/TestRunner.java (revision 502)
2342N/A+++ src/main/org/testng/TestRunner.java (working copy)
2342N/A@@ -536,9 +536,13 @@
2342N/A List<ITestNGMethod> parallelList= new ArrayList<ITestNGMethod>();
2342N/A
2342N/A computeTestLists(sequentialList, parallelList);
2342N/A+
2342N/A+ int sequentialSize = 0;
2342N/A+ for (List<ITestNGMethod> methodList: sequentialList) {
2342N/A+ sequentialSize += methodList.size();
2342N/A+ }
2342N/A+ log(3, "Found " + (sequentialSize + parallelList.size()) + " applicable methods");
2342N/A
2342N/A- log(3, "Found " + (sequentialList.size() + parallelList.size()) + " applicable methods");
2342N/A-
2342N/A //
2342N/A // Create the workers
2342N/A //
2342N/A@@ -753,7 +757,9 @@
2342N/A findAnnotation(cls, org.testng.internal.annotations.ITest.class);
2342N/A if (test != null) {
2342N/A if (test.getSequential()) {
2342N/A- String className = cls.getName();
2342N/A+ // This must not be cls.getName() because that will sort methods in a super class together
2342N/A+ // instead of with the instance class itself (i.e. the subclass).
2342N/A+ String className = tm.getTestClass().getRealClass().getName();
2342N/A List<ITestNGMethod> list = sequentialAttributeList.get(className);
2342N/A if (list == null) {
2342N/A list = new ArrayList<ITestNGMethod>();