-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Provide mechanism for managing resources across engines and executions #4252
Closed
Closed
Changes from 6 commits
Commits
Show all changes
57 commits
Select commit
Hold shift + click to select a range
5bfe6ad
Generate ResourceContext for store resources
YongGoose 7992634
Add getStore method in LauncherSession
YongGoose f3adab1
Add Namespace by reusing Jupiter's Namespace class
YongGoose e4e60ba
Merge branch 'junit-team:main' into feature/2816
YongGoose 234f7ff
Apply comment
YongGoose ffde19c
Adding a request-level store to Launcher
YongGoose 4fa576f
Remove logging to SYS_ERR in test
sbrannen 57e20cd
Revise Javadoc and release notes regarding void lookups
sbrannen 30cbe62
Move Kotlin contracts release note to correct section
sbrannen 254ca62
Revise recent changes to @ResourceLock and related APIs
sbrannen 2e14b3d
Revise release notes for 5.12 M1
sbrannen d583ab0
Fix Javadoc errors
sbrannen f6eff60
Polish Javadoc in TestTemplateInvocationContextProvider
sbrannen dde72a9
Polishing
sbrannen 5fd9e88
Remove Void wrapper registration in ReflectionUtils
sbrannen 3f40a7e
Update @since/@API versions in Reflection[Support|Utils] plus polis…
sbrannen 9bddac8
Update Javadoc due to changes in 5fd9e88d07
sbrannen 0fe36c7
Increase test coverage for ReflectionUtils.tryToLoadClass()
sbrannen 2bae68b
Delete cases covered by `Class.forName()`
sormuras 5ca0ced
Fix grammar in Javadoc for NestedMethodSelector
sbrannen aec4ad9
Update plugin commonCustomUserData to v2.1
renovate[bot] ba3a4ff
Update actions/stale digest to 5bef64f (#4253)
renovate[bot] 10eeeda
Update github/codeql-action digest to d68b2d4 (#4255)
renovate[bot] ab41b23
Update codecov/codecov-action digest to 5a605bd (#4257)
renovate[bot] 15539b0
Update graalvm/setup-graalvm digest to aafbedb (#4254)
renovate[bot] 5cb4571
Update actions/attest-build-provenance action to v2.2.0 (#4258)
renovate[bot] 21bb094
Update github/codeql-action digest to dd196fa (#4260)
renovate[bot] 544c3b2
Update plugin plantuml to v8.12
renovate[bot] 3583e01
Use separate local Maven repos when file system type is NTFS (#4259)
marcphilipp 292f6a0
Revert "Use Gradle's new daemon JVM criteria feature"
marcphilipp 9d45d42
Update plugin versions to v0.52.0 (#4262)
renovate[bot] e78ca1d
Update plugin develocity to v3.19.1
renovate[bot] 73d7f12
Update github/codeql-action digest to ee117c9
renovate[bot] bf08ea2
Update codecov/codecov-action digest to 0da7aa6
renovate[bot] 6d260da
Remove Twitter/X
marcphilipp a1a5353
Update codecov/codecov-action digest to 13ce06b
renovate[bot] 9149fb8
Update github/codeql-action digest to f6091c0
renovate[bot] 4c382d0
Update dependency gradle to v8.12.1
renovate[bot] 80a22b6
Update dependency org.apache.groovy:groovy to v4.0.25 (#4273)
renovate[bot] 7b4b972
Revert to older Eclipse version to fix Spotless issue on CI
marcphilipp ca7bb80
Revert "Revert to older Eclipse version to fix Spotless issue on CI"
marcphilipp 060f4db
Pass enclosing instance types to `DisplayNameGenerators` (#4266)
marcphilipp 511ab7d
Provide runtime enclosing instance types to `ResourceLocksProviders`
marcphilipp b7349b4
Update dependency com.puppycrawl.tools:checkstyle to v10.21.2 (#4274)
renovate[bot] 7d66196
Re-open completed non-task/-question issues without assigned milestone
marcphilipp e6446ff
Remove milestone assignment from issues closed as "not planned"
marcphilipp f93b1fc
Support `@TempDir` constructor injection for Java record classes (#4279)
marcphilipp 54f1996
Apply comment
YongGoose 3fa27e9
Add "Getting Started" section (#4280)
marcphilipp 516a801
Generate ResourceContext for store resources
YongGoose 339c956
Add getStore method in LauncherSession
YongGoose f92d60f
Add Namespace by reusing Jupiter's Namespace class
YongGoose 96d86c2
Apply comment
YongGoose 82c14be
Adding a request-level store to Launcher
YongGoose 4de6db8
Apply comment
YongGoose 7fdeb72
Merge remote-tracking branch 'origin/feature/2816' into feature/2816
YongGoose 628f8cb
Revert "Apply comment"
YongGoose File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
85 changes: 85 additions & 0 deletions
85
junit-platform-engine/src/main/java/org/junit/platform/engine/Namespace.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,85 @@ | ||
/* | ||
* 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.platform.engine; | ||
|
||
import static org.apiguardian.api.API.Status.STABLE; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Arrays; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
import org.apiguardian.api.API; | ||
import org.junit.platform.commons.util.Preconditions; | ||
|
||
@API(status = STABLE, since = "5.13") | ||
public class Namespace { | ||
|
||
/** | ||
* The default, global namespace which allows access to stored data from | ||
* all extensions. | ||
*/ | ||
public static final Namespace GLOBAL = Namespace.create(new Object()); | ||
|
||
/** | ||
* Create a namespace which restricts access to data to all extensions | ||
* which use the same sequence of {@code parts} for creating a namespace. | ||
* | ||
* <p>The order of the {@code parts} is significant. | ||
* | ||
* <p>Internally the {@code parts} are compared using {@link Object#equals(Object)}. | ||
*/ | ||
public static Namespace create(Object... parts) { | ||
Preconditions.notEmpty(parts, "parts array must not be null or empty"); | ||
Preconditions.containsNoNullElements(parts, "individual parts must not be null"); | ||
return new Namespace(new ArrayList<>(Arrays.asList(parts))); | ||
} | ||
|
||
private final List<Object> parts; | ||
|
||
private Namespace(List<Object> parts) { | ||
this.parts = parts; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
Namespace that = (Namespace) o; | ||
return this.parts.equals(that.parts); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return this.parts.hashCode(); | ||
} | ||
|
||
/** | ||
* Create a new namespace by appending the supplied {@code parts} to the | ||
* existing sequence of parts in this namespace. | ||
* | ||
* @return new namespace; never {@code null} | ||
* @since 5.8 | ||
*/ | ||
@API(status = STABLE, since = "5.13") | ||
public Namespace append(Object... parts) { | ||
Preconditions.notEmpty(parts, "parts array must not be null or empty"); | ||
Preconditions.containsNoNullElements(parts, "individual parts must not be null"); | ||
ArrayList<Object> newParts = new ArrayList<>(this.parts.size() + parts.length); | ||
newParts.addAll(this.parts); | ||
Collections.addAll(newParts, parts); | ||
return new Namespace(newParts); | ||
} | ||
} |
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
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
What's the use case for this method? Test engines don't have access to the
Launcher
so we'll need to pass this store as part ofLauncherDiscoveryRequest
andExecutionRequest
, don't we?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 I need to study a bit more.
I’ll make revisions and add comments by the end of the weekend!