-
-
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.
Introduce
ParameterInfo
support for extensions
`Extensions` can get it from `ExtensionContext.Store` and access all indexed parameter declarations as well as the arguments for the current invocation. Resolves #1139.
- Loading branch information
1 parent
1e1f8d5
commit 1cc2b09
Showing
18 changed files
with
333 additions
and
112 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
44 changes: 44 additions & 0 deletions
44
junit-jupiter-params/src/main/java/org/junit/jupiter/params/DefaultParameterInfo.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,44 @@ | ||
/* | ||
* Copyright 2015-2025 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; | ||
|
||
import org.junit.jupiter.api.extension.ExtensionContext; | ||
import org.junit.jupiter.params.aggregator.ArgumentsAccessor; | ||
import org.junit.jupiter.params.support.ParameterDeclarations; | ||
import org.junit.jupiter.params.support.ParameterInfo; | ||
|
||
/** | ||
* @since 5.13 | ||
*/ | ||
class DefaultParameterInfo implements ParameterInfo { | ||
|
||
private final ParameterDeclarations declarations; | ||
private final ArgumentsAccessor arguments; | ||
|
||
DefaultParameterInfo(ParameterDeclarations declarations, ArgumentsAccessor arguments) { | ||
this.declarations = declarations; | ||
this.arguments = arguments; | ||
} | ||
|
||
@Override | ||
public ParameterDeclarations getDeclarations() { | ||
return this.declarations; | ||
} | ||
|
||
@Override | ||
public ArgumentsAccessor getArguments() { | ||
return this.arguments; | ||
} | ||
|
||
void store(ExtensionContext context) { | ||
context.getStore(NAMESPACE).put(KEY, this); | ||
} | ||
} |
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
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
Oops, something went wrong.