slachiewicz opened a new pull request, #2288:
URL: https://github.com/apache/maven-resolver/pull/2288

   Fixes #784. The issue asked for tests of `ScopeDependencySelector` and 
`OptionalDependencySelector` in `maven-resolver-util`; the test classes that 
exist there only cover `toString()`, and both classes are now deprecated in 
favour of the same-named classes in `org.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 
`deriveChildSelector` moves one level down, `fromRoot` filters from the first 
level while `fromDirect` keeps direct dependencies of any scope (or optional), 
`fromTo` stops applying beyond the upper bound, and `legacy` shifts 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_KEYS` exempts an artifact, `UNSELECTED_KEYS` 
collects 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,OptionalDependencySelectorTest` on JDK 21 → 
9 + 6 tests, 0 failures; `spotless:apply` left the files unchanged.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to