Bug 578748

Summary: [JUnit] "Add method/class/package to filter" from context menu of failure trace
Product: [Eclipse Project] JDT Reporter: Dirk Steinkamp <Dirk.Steinkamp>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: ASSIGNED --- QA Contact:
Severity: enhancement    
Priority: P3 CC: jjohnstn
Version: 4.22Keywords: usability
Target Milestone: ---   
Hardware: PC   
OS: Windows 10   
Whiteboard:

Description Dirk Steinkamp CLA 2022-02-14 14:54:25 EST
I'm very fond of the filter-feature in the JUnit-UI, as it makes focusing on the origin of the error much easier by filtering out noise. Currently it's necessary to go to the JUnit-settings in the preferences-dialog to add classes/packages to the filter, which makes the usability somewhat cumbersome.

Here's a little suggestion to improve the usability: provide context menu items for each failure trace element that allows to add the selected class or package to the JUnit-filter.

Example:
- given the failure trace has an element "at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:167)"

- right-clicking on that element would open a context menu with menu items (or sub-menu-items) reading
  * add to stack filter
    > method invokeTestMethod
    > class TestMethodTestDescriptor
    > package org.junit.jupiter.engine.descriptor.*
    > package org.junit.jupiter.engine.*
    > package org.junit.jupiter.*
    > package org.junit.*
    > package org.*

Untangling the whole package hierarchy would be nice-to-have, but I would already be happy with the top three menu items :-).

BTW: why do I currently have to do a *double*-click with the right mouse button on a stack trace element to open the current context menu?