Closed NingZhuRedsilence closed 3 years ago
- Do existing unit tests cover the correctness of the classpath-scanning code?
- Is it possible to add a unit test to duplicate the
java.lang.OutOfMemoryError: GC Overhead Limit Exceeded
exception against the originalfast-classpath-scanner
-based codebase, such that the test does not trigger the exception against theclassgraph
codebase?
However, since the newly "added" code is just calling a third-party library, I think we / I don't need to write unit test for this third-party code.
What in jenkins-spock
are missing unit tests are method getClassesOfTypeInPackage
and getClassesWithAnnotationOfTypeInPackage
. I want to assert that adding unit tests to these 2 methods are a different and separate issue from this PR.
According to ScanResult lifecycle, ScanResult
should be assigned in a try-with-resources
block. YMMV.
Summary
fast-classpath-scanner
has been deprecated;classpath
is its successor. Replacingfast-classpath-scanner
withclassgraph
caused a few code changes because theclassgraph
API has changed.Additional Details
Before changing to
classpath
, withfast-classpath-scanner
up to version3.1.13
, unit tests written usingJenkinsPipelineSpecification
was throwingat this line.
Checklist
Testing
(Remove this checklist and replace it with "N/A - no code changes" if this PR does not modify source code)
Documentation
(Remove this checklist and replace it with "N/A - no code changes" if this PR does not modify source code)
CHANGELOG.md
with a brief description of my changes.CONTRIBUTING.md
and have followed its guidance.