Added multiple URLs support in FinderFactory #7250
Merged
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.
What does this PR change?
This PR fixes how
FinderFactory
associates the packages to their physical locations. In fact, the class is currently based on the wrong assumption that a package maps to only one physical location. In reality, a package can be available on the classpath from multiple directories/jars.This is currently not an issue as the test and production code is compiled and bundled together by the ant build file, but it will be if we want to properly separate them, split the production code into separate modules and/or we move to any other build tool that separates the main and test context (like Maven/Gradle). In this cases the
Finder
, as it is currently implemented, won't be able to resolve the resources (for example, the hibernate mappings) that are in different jar/context but shares the same package.This change evaluates instead all the possible URLs for a package and processes them all with the correct
Finder
, aggregating the results.GUI diff
No difference.
Documentation
No documentation needed: only internal and user invisible changes
DONE
Test coverage
No tests: already covered
DONE
Changelogs
Make sure the changelogs entries you are adding are compliant with https://github.com/uyuni-project/uyuni/wiki/Contributing#changelogs and https://github.com/uyuni-project/uyuni/wiki/Contributing#uyuni-projectuyuni-repository
If you don't need a changelog check, please mark this checkbox:
If you uncheck the checkbox after the PR is created, you will need to re-run
changelog_test
(see below)Re-run a test
If you need to re-run a test, please mark the related checkbox, it will be unchecked automatically once it has re-run: