Skip to content

Introduce Extension API for registering dynamic tests #1444

Description

Overview

I currently have a JUnit 4 based custom Suite which automatically registers new tests to the JUnit runner and which allows to write very simple tests:

@RunWith(RenderingTestSuite.class)
public class IntegrationTests {
}

The custom suite reads *.test files found in the CL's classpath and generates dynamic tests from them.

I'd like to move this to JUnit 5, but I'm a bit stuck ATM since it seems the best approach would be to use some test factory or parameterized test, but this would require each of my tests to declare a test method with something like:

class IntegrationTests {

   @TestFactory
   Stream<DynamicTest> renderingTests() {
           return RenderingTestSuite.generateStreamOfDynamicTests();
   }
}

I'd really like my tests to remain as simple as the following (and this without duplication):

@ExtendWith(RenderingExtension.class)
public class IntegrationTests {
}

PS: I've also asked the question on Gitter (which contains additional details).

Related Issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions