Skip to content

Support running tests from abstract classes by selecting concrete subclasses#235

Merged
RoiSoleil merged 1 commit into
masterfrom
issue-207-abstract-test-support-2315245454879716993
Apr 23, 2026
Merged

Support running tests from abstract classes by selecting concrete subclasses#235
RoiSoleil merged 1 commit into
masterfrom
issue-207-abstract-test-support-2315245454879716993

Conversation

@RoiSoleil

Copy link
Copy Markdown
Contributor

This PR adds support for running tests from abstract classes. When a user tries to run tests in an abstract class (or from its corresponding Class Under Test), MoreUnit now:

  1. Detects that the test class is abstract.
  2. Finds all concrete subclasses.
  3. If only one subclass is found, it's used automatically.
  4. If multiple subclasses are found, a popup asks the user to choose one or "All concrete subclasses".
  5. Remembers the last choice for subsequent runs.

This is particularly useful for test patterns where an abstract base class contains shared tests that are executed in different contexts by concrete subclasses (e.g., browser-specific tests or database-specific tests).

Changes:

  • Added SearchTools.findConcreteSubclasses utility.
  • Modified RunTestsActionExecutor to integrate the resolution logic.
  • Improved JUnitTestSelectionLaunchConfigurationDelegate to handle specific IMember instances, enabling method-level execution in subclasses.
  • Added SearchToolsTest and updated test framework dependencies to support the new test scenarios.

PR created automatically by Jules for task 2315245454879716993 started by @RoiSoleil

…tract class

- Implemented `SearchTools.findConcreteSubclasses(IType)` to retrieve non-abstract implementations of a type.
- Enhanced `RunTestsActionExecutor` to automatically resolve or prompt for concrete subclasses when test execution is triggered from an abstract class or its CUT.
- Added "All concrete subclasses" option to the selection dialog.
- Updated `JUnitTestSelectionLaunchConfigurationDelegate` to support granular `IMember` execution (types or methods).
- Added JUnit tests for subclass resolution logic.
- Enhanced test infrastructure to support interface definitions in `@Project` annotations.

Co-authored-by: RoiSoleil <3462260+RoiSoleil@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@RoiSoleil RoiSoleil left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@RoiSoleil RoiSoleil merged commit 538b845 into master Apr 23, 2026
4 checks passed
@RoiSoleil RoiSoleil deleted the issue-207-abstract-test-support-2315245454879716993 branch April 24, 2026 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant