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
Add repeatable capabilities for @..Source annotations #3787
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks promising! 👍
junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CSVSources.java
Outdated
Show resolved
Hide resolved
...ter-params/src/main/java/org/junit/jupiter/params/support/AnnotationConsumerInitializer.java
Outdated
Show resolved
Hide resolved
...ter-params/src/main/java/org/junit/jupiter/params/support/AnnotationConsumerInitializer.java
Outdated
Show resolved
Hide resolved
...jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestIntegrationTests.java
Outdated
Show resolved
Hide resolved
...s/src/main/java/org/junit/jupiter/params/provider/RepeatableAnnotationArgumentsProvider.java
Outdated
Show resolved
Hide resolved
junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CSVSources.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm really looking forward to getting this merged!
documentation/src/docs/asciidoc/release-notes/release-notes-5.11.0-M1.adoc
Outdated
Show resolved
Hide resolved
junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvFileSources.java
Outdated
Show resolved
Hide resolved
...jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestIntegrationTests.java
Show resolved
Hide resolved
…ntsProvider into one provider
9b40389
to
0acecf1
Compare
08b9a93
to
66454ab
Compare
@Target(ElementType.METHOD) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Documented | ||
@API(status = STABLE, since = "5.11") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be experimental like @FieldSource
@API(status = STABLE, since = "5.11") | |
@API(status = EXPERIMENTAL, since = "5.11") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, true. Changed it to experimental in 7a0f7f1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should change the first sentence of the Javadoc here and for the other source annotation to mention that they're repeatable:
* {@code @CsvFileSource} is a {@linkplain Repeatable repeatable}
* {@link ArgumentsSource} which is used to load comma-separated value (CSV)
* files from one or more classpath {@link #resources} or {@link #files}.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. Repeatable mention added for all 6 changed annotations
Overview
These changes aim to add capabilities of repeatable
@..Source
annotations. Solves #3736.Repeatable capabilities added to every annotation that makes use of
AnnotationBasedArgumentsProvider
by adapting to accept multiple annotations while aggregating the result of each annotation arguments.Helper class
AnnotationConsumerInitializer
needs adaptations as well in order to invoke initialization for each annotation if repeatable.This change does not affect annotations related to null and/or empty sources:
@NullSource
,@EmptySource
and@NullAndEmptySource
. This makes sense since they have predefined/hardcoded arguments relevant to null and empty collections.I hereby agree to the terms of the JUnit Contributor License Agreement.
Definition of Done
@API
annotations