Add capability to build and test with JDK up to version 17 (fixes #127)#128
Add capability to build and test with JDK up to version 17 (fixes #127)#128davoustp wants to merge 1 commit intomjiderhamn:masterfrom
Conversation
| @Override | ||
| protected void triggerLeak() throws Exception { | ||
| // Leak does not occur any more with JDK11+ | ||
| Assume.assumeTrue(JavaVersion.IS_JAVA_10_OR_EARLIER); |
There was a problem hiding this comment.
Why isn't triggerLeakWithoutCleanup() overridden in this case?
There was a problem hiding this comment.
Good question - I may have overlooked this one...
| @Override | ||
| public void triggerLeakWithoutCleanup() throws Exception { | ||
| // Leak does not occur any more with JDK8+ | ||
| Assume.assumeTrue(JavaVersion.IS_JAVA_1_6 || JavaVersion.IS_JAVA_1_7); |
There was a problem hiding this comment.
Would it have made more sense to make the original triggerLeakWithoutCleanup() do something like Assume.assumeTrue(isRelevantForJavaVersion()) with a default implementation of isRelevantForJavaVersion() that returns true, and then override that method in the respective tests? Feels like it would be more readable?
Plus, isRelevantForJavaVersion() could be named the same for both CleanUp tests and PreInitiator tests.
| <configuration> | ||
| <argLine> | ||
| --add-opens java.base/sun.reflect.misc=ALL-UNNAMED | ||
| --add-opens java.base/sun.reflect.misc=ALL-UNNAMED |
|
|
||
| forceGc(3); | ||
|
|
||
| if (assumptionFailed) { |
There was a problem hiding this comment.
Do we want to do this before forcing garbage collection 3 times, for better performance?
| <dependency> | ||
| <groupId>org.geotools</groupId> | ||
| <artifactId>gt-metadata</artifactId> | ||
| <version>2.6.2</version> |
There was a problem hiding this comment.
Yes it is.
But the gt-metadata artifact has moved to another repo, and not available in public Maven: http://maven.geo-solutions.it/
I struggled quite a bit to find this one, to be honest. :-)
This provides the capability to build and test against recent JDK versions (tested up with JDK 17).
--add-openshave been added using a maven profile with activation based on JDK version (9+) so that it still compiles with prior versions (JDK 7 and 8)org.junit.Assumeinclassloader-leak-test-frameworkto allow tests to be conditionally ignored based on JDK versionNote that dependency from
classloader-leak-preventionontoclassloader-leak-test-frameworkis left asSNAPSHOTin this PR since this requires releasing a new version (which is obviously not possible using a PR).