Permalink
Browse files

Fixes issue #116: org.testng.internal.BaseTestMethod does respect gen…

…eral contract of Comparable
  • Loading branch information...
1 parent 72b7bfa commit 7e5c60a7d723f88224004c0074c35824c10f9c4a @triceo triceo committed Feb 15, 2014
Showing with 9 additions and 2 deletions.
  1. +6 −1 pom-test.xml
  2. +3 −1 src/main/java/org/testng/internal/BaseTestMethod.java
View
7 pom-test.xml
@@ -65,9 +65,14 @@
<version>1.27</version>
</dependency>
<dependency>
+ <groupId>org.yaml</groupId>
+ <artifactId>snakeyaml</artifactId>
+ <version>1.12</version>
+ </dependency>
+ <dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
- <version>6.8.6-SNAPSHOT</version>
+ <version>6.8.8-SNAPSHOT</version>
<scope>test</scope>
</dependency>
</dependencies>
View
4 src/main/java/org/testng/internal/BaseTestMethod.java
@@ -153,7 +153,9 @@ public int compareTo(Object o) {
int result = -2;
Class<?> thisClass = getRealClass();
Class<?> otherClass = ((ITestNGMethod) o).getRealClass();
- if (thisClass.isAssignableFrom(otherClass)) {
+ if (this == o) {
+ result = 0;
+ } else if (thisClass.isAssignableFrom(otherClass)) {
result = -1;
} else if (otherClass.isAssignableFrom(thisClass)) {
result = 1;

0 comments on commit 7e5c60a

Please sign in to comment.