* Complex implementation of a test result compatible with a tree based\r
* structure.\r
*/\r
-public class TreeTestResult implements TestResult, StructureAware<TreeSPath> {\r
+public class TreeTestResult implements TestResult, StructureAware<TreeSPath>,Comparable<TreeTestResult> {\r
private Log log = LogFactory.getLog(TreeTestResult.class);\r
\r
private List<TestResultListener<TreeTestResult>> listeners = new Vector<TestResultListener<TreeTestResult>>();\r
return currentTestRun;\r
}\r
\r
+ public int compareTo(TreeTestResult ttr2) {\r
+ TreeTestResult ttr1 = this;\r
+ if (ttr1.getCloseDate() != null && ttr2.getCloseDate() != null) {\r
+ return -ttr1.getCloseDate().compareTo(ttr2.getCloseDate());\r
+ } else if (ttr1.getCloseDate() != null && ttr2.getCloseDate() == null) {\r
+ return 1;\r
+ } else if (ttr1.getCloseDate() == null && ttr2.getCloseDate() != null) {\r
+ return -1;\r
+ } else {\r
+ return ttr1.getUuid().compareTo(ttr2.getUuid());\r
+ }\r
+ }\r
+\r
}\r