Skip to content

Conversation

@jtnord
Copy link

@jtnord jtnord commented Aug 28, 2025

Fixes a broken unit test on windows and re-enables it.
The naming of the test did not match what was actually tested, so updated that to reflect reality.

see #2312 (comment)

Following this checklist to help us incorporate your
contribution quickly and easily:

  • Your pull request should address just one issue, without pulling in other changes.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Each commit in the pull request should have a meaningful subject line and body.
    Note that commits might be squashed by a maintainer on merge.
  • Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied.
    This may not always be possible but is a best-practice.
  • Run mvn verify to make sure basic checks pass.
    A more thorough check will be performed on your pull request automatically.
  • You have run the Core IT successfully.

If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.

To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.

@DisabledOnOs(
value = WINDOWS,
disabledReason = "windows related issue https://github.com/apache/maven/pull/2312#issuecomment-2876291814")
void readFromUrlParsesPluginDescriptorCorrectly() throws Exception {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the builder took (and still takes) an input stream not a URL. So this is renamed accordingly.
If it is expected that the test was using a Url then the test was already incorrectly implemented.

Comment on lines +257 to +259
try (InputStream is = xmlFile.toUri().toURL().openStream()) {
PluginDescriptor descriptor = defaultPluginXmlFactory.read(
XmlReaderRequest.builder().inputStream(is).build());
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the fix (everything else is whitespace)

@olamy
Copy link
Member

olamy commented Aug 28, 2025

duplicate of #11069 ?

@jtnord
Copy link
Author

jtnord commented Aug 28, 2025

duplicate of #11069 ?

that and this is messed up as there is already a test that tests inputStreams.

@jtnord jtnord closed this Aug 28, 2025
@jtnord jtnord deleted the re-enable-test-on-windows branch August 28, 2025 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants