Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce new DynamicTests generators in class DynamicTest #3720

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mobounya
Copy link
Contributor

@mobounya mobounya commented Mar 9, 2024

Overview

Introduce new interface NamedExecutable and two additional methods in DynamicTest <T extends NamedExecutable<T>> Stream<DynamicTest> stream(Stream<? extends NamedExecutable<T>> inputStream) and <T extends NamedExecutable<T>> Stream<DynamicTest> stream(Iterator<? extends NamedExecutable<T>> inputGenerator).

This will hopefully resolve Issue #3261: Simplify implementation of self-contained dynamic tests

Supersedes #3651


I hereby agree to the terms of the JUnit Contributor License Agreement.


Definition of Done

Introduce new interface NamedExecutable that associates a name, a
payload and an Executable.

This was introduced to help colocate test's diplayName, payload, and
testExecutor in one place. Concrete usage of this interface is in the
next commit.

Issue: junit-team#3261
Introduce two methods in the class DynamicTest to generate a stream of
DynamicTests from a Stream/Iterator of NamedExecutables.

Instead of passing an inputStream, a displayNameGenerator and a
testExecutor separately, these two additional methods will allow you
to pass one Iterator/Stream of a NamedExecutable.

Unlike the Named interface, the NamedExecutable can colocate assertion
callbacks in one container using the execute method.

Issue: junit-team#3261
Write new changes to the release notes for 5.11M1 and add a simple demo
in DynamicTestsDemo.

Issue: junit-team#3261
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.

Simplify implementation of self-contained dynamic tests
1 participant