-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make parameterized ArgumentSource annotations repeatable
This commit makes every `@..Source` annotations that makes use of `AnnotationBasedArgumentsProvider` repeatable by adapting to accept multiple annotations while aggregating the result of each annotation argument. This change does not affect annotations related to null and/or empty sources: `@NullSource`, `@EmptySource` and `@NullAndEmptySource` since they have predefined/hardcoded arguments relevant to null and empty values. Resolves #3736.
- Loading branch information
1 parent
e2a7cc0
commit 2886963
Showing
24 changed files
with
638 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvFileSources.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright 2015-2024 the original author or authors. | ||
* | ||
* All rights reserved. This program and the accompanying materials are | ||
* made available under the terms of the Eclipse Public License v2.0 which | ||
* accompanies this distribution and is available at | ||
* | ||
* https://www.eclipse.org/legal/epl-v20.html | ||
*/ | ||
|
||
package org.junit.jupiter.params.provider; | ||
|
||
import static org.apiguardian.api.API.Status.STABLE; | ||
|
||
import java.lang.annotation.Documented; | ||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
import org.apiguardian.api.API; | ||
|
||
/** | ||
* {@code @CsvFileSources} is a simple container for one or more | ||
* {@link CsvFileSource} annotations. | ||
* | ||
* <p>Note, however, that use of the {@code @CsvFileSources} container is completely | ||
* optional since {@code @CsvFileSource} is a {@linkplain java.lang.annotation.Repeatable | ||
* repeatable} annotation. | ||
* | ||
* @since 5.11 | ||
* @see CsvFileSource | ||
* @see java.lang.annotation.Repeatable | ||
*/ | ||
@Target(ElementType.METHOD) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Documented | ||
@API(status = STABLE, since = "5.11") | ||
public @interface CsvFileSources { | ||
|
||
/** | ||
* An array of one or more {@link CsvFileSource @CsvFileSource} | ||
* annotations. | ||
*/ | ||
CsvFileSource[] value(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvSources.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright 2015-2024 the original author or authors. | ||
* | ||
* All rights reserved. This program and the accompanying materials are | ||
* made available under the terms of the Eclipse Public License v2.0 which | ||
* accompanies this distribution and is available at | ||
* | ||
* https://www.eclipse.org/legal/epl-v20.html | ||
*/ | ||
|
||
package org.junit.jupiter.params.provider; | ||
|
||
import static org.apiguardian.api.API.Status.STABLE; | ||
|
||
import java.lang.annotation.Documented; | ||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
import org.apiguardian.api.API; | ||
|
||
/** | ||
* {@code @CsvSources} is a simple container for one or more | ||
* {@link CsvSource} annotations. | ||
* | ||
* <p>Note, however, that use of the {@code @CsvSources} container is completely | ||
* optional since {@code @CsvSource} is a {@linkplain java.lang.annotation.Repeatable | ||
* repeatable} annotation. | ||
* | ||
* @since 5.11 | ||
* @see CsvSource | ||
* @see java.lang.annotation.Repeatable | ||
*/ | ||
@Target(ElementType.METHOD) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Documented | ||
@API(status = STABLE, since = "5.11") | ||
public @interface CsvSources { | ||
|
||
/** | ||
* An array of one or more {@link CsvSource @CsvSource} | ||
* annotations. | ||
*/ | ||
CsvSource[] value(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/EnumSources.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright 2015-2024 the original author or authors. | ||
* | ||
* All rights reserved. This program and the accompanying materials are | ||
* made available under the terms of the Eclipse Public License v2.0 which | ||
* accompanies this distribution and is available at | ||
* | ||
* https://www.eclipse.org/legal/epl-v20.html | ||
*/ | ||
|
||
package org.junit.jupiter.params.provider; | ||
|
||
import static org.apiguardian.api.API.Status.STABLE; | ||
|
||
import java.lang.annotation.Documented; | ||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
import org.apiguardian.api.API; | ||
|
||
/** | ||
* {@code @EnumSources} is a simple container for one or more | ||
* {@link EnumSource} annotations. | ||
* | ||
* <p>Note, however, that use of the {@code @EnumSources} container is completely | ||
* optional since {@code @EnumSource} is a {@linkplain java.lang.annotation.Repeatable | ||
* repeatable} annotation. | ||
* | ||
* @since 5.11 | ||
* @see EnumSource | ||
* @see java.lang.annotation.Repeatable | ||
*/ | ||
@Target(ElementType.METHOD) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Documented | ||
@API(status = STABLE, since = "5.11") | ||
public @interface EnumSources { | ||
|
||
/** | ||
* An array of one or more {@link EnumSource @EnumSource} | ||
* annotations. | ||
*/ | ||
EnumSource[] value(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.