Bug 546882

Summary: [JUnit] Provide customization for JUnit View double click on test entry
Product: [Eclipse Project] JDT Reporter: Simeon Andreev <simeon.danailov.andreev>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: akurtakov, christian.dietrich.opensource, loskutov
Version: 4.12   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=391023
https://bugs.eclipse.org/bugs/show_bug.cgi?id=507626
Whiteboard:

Description Simeon Andreev CLA 2019-05-01 02:35:05 EDT
Clients which customize the JUnit view currently cannot change the behaviour of test entry double-click. The usual action to navigate to a passing/failing test is to double click on the respective test entry in the JUnit view; so JUnit view customization is very limited.

E.g. the xpect project contributes to the pop-up menu of the JDT JUnit view as follows:

   <extension point="org.eclipse.ui.popupMenus">
        <viewerContribution
                        id="org.eclipse.xpect.ui.junit.gotoXpectMethod"
                        targetID="org.eclipse.jdt.junit.ResultView">
                <action
                        class="org.eclipse.xpect.ui.junit.GotoXpectMethodAction"
                id="org.eclipse.xpect.ui.junit.gotoXpectMethod"
                label="Go to XPECT method"
                menubarPath="org.eclipse.jdt.junit.ResultView"/>
      </viewerContribution>
   </extension>

The user can then right click on a passing/failing test and use the extra entry to navigate to the test. Instead, a simple double-click should suffice. Ideally the double-click action can be customized with a contribution from a plugin.xml.
Comment 1 Simeon Andreev CLA 2019-05-01 03:00:32 EDT
Note that due to the nature of the xpect contribution, it is seen also in normal JUnit Java tests. This is not great; maybe we should try to improve this as well.

The source code of the xpect project is found here:

https://github.com/eclipse/Xpect

Its purpose is to allow testing xtext based DSL.
Comment 2 Simeon Andreev CLA 2019-05-01 04:11:20 EDT
Seems like a lot of infrastructure is missing in order to do this task. So I think this is either a duplicate of bug 391023 or is blocked by this bug.

Here is the experimental work done for bug 391023 by Moritz Eysholdt:

https://github.com/meysholdt/eclipse_jdt_junit_runners