Repository navigation
Test the depth semantics of the impl scope and optional selectors - #2288
Open
slachiewicz wants to merge 1 commit into
Open
slachiewicz wants to merge 1 commit into
slachiewicz wants to merge 1 commit into
Conversation
slachiewicz
marked this pull request as ready for review
November 7, 2026 22:14
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #784. The issue asked for tests of
ScopeDependencySelectorandOptionalDependencySelectorinmaven-resolver-util; the test classes that exist there only covertoString(), and both classes are now deprecated in favour of the same-named classes inorg.eclipse.aether.internal.impl.scope, which had no tests at all. The new tests therefore cover the impl classes.What they pin down is the depth model, which is the part the Javadoc states and nothing exercised directly: the session selector sits above the root, each
deriveChildSelectormoves one level down,fromRootfilters from the first level whilefromDirectkeeps direct dependencies of any scope (or optional),fromTostops applying beyond the upper bound, andlegacyshifts a level only when collection starts from an artifact rather than a dependency, which is the Resolver 1.x behaviour. For the optional selector the two session-data hooks are covered:IGNORED_KEYSexempts an artifact,UNSELECTED_KEYScollects the ids that were dropped. The equality tests check the "starting state" note in both classes: two selectors at the same depth with the same configuration are still unequal when they got there from different starting points.No change to 1.9.x: the util classes there are the live ones and their tests are JUnit 4.
Verified:
mvn -pl maven-resolver-impl -am test -Dtest=ScopeDependencySelectorTest,OptionalDependencySelectorTeston JDK 21 → 9 + 6 tests, 0 failures;spotless:applyleft the files unchanged.