Bug 449783 - Allow JUnit test results to be sorted
Summary: Allow JUnit test results to be sorted
Status: CLOSED DUPLICATE of bug 219466
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.5   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-03 09:37 EST by Alex Blewitt CLA
Modified: 2014-11-06 05:23 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Blewitt CLA 2014-11-03 09:37:29 EST
When running a large test suite, being able to find a specific test by name is a challenge because the results are not sorted.

If a viewercomparator was added to testviewer then the results could be shown in a sorted order:

in org.eclipse.jdt.internal.junit.ui.TestViewer:

 fTreeContentProvider= new TestSessionTreeContentProvider();
 fTreeViewer.setContentProvider(fTreeContentProvider);
 fTreeLabelProvider= new TestSessionLabelProvider(fTestRunnerPart, TestRunnerViewPart.LAYOUT_HIERARCHICAL);
 fTreeViewer.setLabelProvider(new ColoringLabelProvider(fTreeLabelProvider));
+fTreeViewer.setComparator(new ViewerComparator());

This might need to be an option to allow users to turn it on/off. If the desire to make results sorted all the time is needed then it would probably make sense to modify the org.eclipse.jdt.internal.junit.model.TestSuiteElement to store the elements as a TreeSet sorted by the test name instead:

-private List/*<TestElement>*/ fChildren;
+private SortedSet<TestElement> fChildren;

-fChildren= new ArrayList(childrenCount);
+fChildren= new TreeSet<TestElement>();

(The TestElement would need to implement Comaparable to make that happen, as well as other iteration paths in that class).
Comment 1 Lars Vogel CLA 2014-11-03 10:05:28 EST
I can't speak for JDT UI committers, but I would like such a feature, maybe you can provide a Gerrit review for that? This usually helps to get get it integrated (or rejected based on technical concerns).
Comment 2 Lars Vogel CLA 2014-11-03 10:10:44 EST
IMHO results should always to sorted, option would not be necessary IMHO.
Comment 3 Noopur Gupta CLA 2014-11-06 05:23:13 EST

*** This bug has been marked as a duplicate of bug 219466 ***