Skip to content

Use TestExecutionListener to log test start and end in org.eclipse.ui.tests #4032

@trancexpress

Description

@trancexpress

Tests in org.eclipse.ui.tests use org.eclipse.ui.tests.harness.util.TestRunLogUtil.LOG_TESTRUN to log/print when a test started and ended. This is a JUnit 4 rule which is present in some but not all tests. E.g. for #4009, QuickAccessDialogTest doesn't have this rule and is a JUnit 5 test.

To add such log information for QuickAccessDialogTest, following the same pattern, we would have to define a JUnit 5 extension and add it to QuickAccessDialogTest.

We can instead do better and use org.junit.platform.launcher.TestExecutionListener to print start and end for all tests, not just JUnit 4 ones using LOG_TESTRUN. We would need to remove LOG_TESTRUN from the tests, to avoid double printing.

For an example of how to use TestExecutionListener, see e.g.: eclipse-jdt/eclipse.jdt.ui@accc76e

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions