Bug 416354 - [JUnit] Support label decorators in TestRunnerViewPart
Summary: [JUnit] Support label decorators in TestRunnerViewPart
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.3   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 420702
Blocks: 419906
  Show dependency tree
 
Reported: 2013-09-02 08:13 EDT by Eike Stepper CLA
Modified: 2013-10-30 04:20 EDT (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 Eike Stepper CLA 2013-09-02 08:13:28 EDT
I would like to contribute my own label decorator to the IDE that decorates ITestElementContainer nodes with the count of the test cases and an average duration per test case.

Unfortunately that doesn't seem to be possible because in org.eclipse.jdt.internal.junit.ui.TestViewer.createTestViewers(Composite) the two ColoringLabelProvider instances are created without label decorators. I could fix that by passing PlatformUI.getWorkbench().getDecoratorManager().getLabelDecorator() in , and null as the decoration context:

		fTreeViewer.setLabelProvider(new ColoringLabelProvider(fTreeLabelProvider, PlatformUI.getWorkbench().getDecoratorManager().getLabelDecorator(), null));

		fTableViewer.setLabelProvider(new ColoringLabelProvider(fTableLabelProvider, PlatformUI.getWorkbench().getDecoratorManager().getLabelDecorator(), null));

I'm not sure if can lead to problems or unacceptable performance degradation but I would appreciate if you could take a look and make the JUnit view a little bit more customizeable.

Please let me know if the above description is not sufficient and you want me to provide a patch.
Comment 1 Markus Keller CLA 2013-09-04 14:33:01 EDT
Makes sense, I've added the decorator manager:
http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=c32cfa861469e127199a95e61f9489af15b27182

A test decorator implementation should get enough information via the ITestElement APIs.
Comment 2 Eike Stepper CLA 2013-09-04 14:48:48 EDT
Wow, that was Quick. Thanks!!
Comment 3 Dani Megert CLA 2013-10-30 04:19:59 EDT
(In reply to Eike Stepper from comment #2)
> Wow, that was Quick. Thanks!!

I had to revert the fix. Due to bug 420702 this fix made the JUnit view unpredictable (see bug 419906).
Comment 4 Dani Megert CLA 2013-10-30 04:20:24 EDT
.