Bug 416354

Summary: [JUnit] Support label decorators in TestRunnerViewPart
Product: [Eclipse Project] JDT Reporter: Eike Stepper <stepper>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: ASSIGNED --- QA Contact:
Severity: enhancement    
Priority: P3 CC: daniel_megert, markus.kell.r
Version: 4.3   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 420702    
Bug Blocks: 419906    

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
.