Skip to content

Plug-in JUnit Launch does not detec Junit5 tests #390

@Pontesegger

Description

@Pontesegger

Beginning from 2022-09 I am not able to execute JUnit Plug-in Tests. Works fine with 2022-06 IDE.

My Setup:

  • Tests provided within fragment project
  • Target definition based on 2022-06
  • Test fragment dependend on:
    org.junit.jupiter.api
    org.junit.jupiter.params
  • Execution environment: Java17

When installing an IDE 2022-06 I have a context menu Run As -> JUnit Plug-in Test.
Further tests execute fine and results are displayed in the JUnit view.

Now I switched to an IDE 2022-09, keeping the rest of my setup above.

Finding 1) the context menu entry Run As -> JUnit Plug-in Test is gone. To make it reappear I have to add following dependencies to my fragment:
org.junit.platform.commons;bundle-version="1.8.1",
org.junit.platform.engine;bundle-version="1.8.1",
org.junit.jupiter.engine;bundle-version="5.8.1"

Finding 2) With the context menu back I can launch Unit tests, but after execution the JUnit view shows 0 tests. Trying to run with coverage reveals that the test code is actually not executed.

Followed it down to RemoteTestRunner.java#516
The count returned is always 0, so test discovery somehow does not work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions