Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

…eral contract of Comparable
  • Loading branch information...
commit 7e5c60a7d723f88224004c0074c35824c10f9c4a 1 parent 72b7bfa
Lukáš Petrovický triceo authored
7 pom-test.xml
View
@@ -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>
4 src/main/java/org/testng/internal/BaseTestMethod.java
View
@@ -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;
Please sign in to comment.
Something went wrong with that request. Please try again.