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 DynamicTests generators for Named<Executable> #3720

Merged
merged 7 commits into from
Jul 18, 2024

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

mobounya added 3 commits January 19, 2024 21:10
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
@marcphilipp marcphilipp self-requested a review July 17, 2024 13:05
@marcphilipp marcphilipp changed the title Introduce new DynamicTests generators in class DynamicTest Introduce DynamicTests generators for Named<Executable> Jul 18, 2024
@marcphilipp marcphilipp merged commit 6828a79 into junit-team:main Jul 18, 2024
16 checks passed
@marcphilipp
Copy link
Member

@mobounya Thank you for your contribution! 👍

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
2 participants