WrenSecurity / wrensec-commons

Community fork of ForgeRock Commons, which contains common utility code used by multiple products originally developed by ForgeRock.
http://wrensecurity.org
0 stars 10 forks source link

RFC 850 Date-related Tests Fail under JDK9+ #15

Open Kortanul opened 5 years ago

Kortanul commented 5 years ago

Affected Versions

Build Environment

Steps to Reproduce

  1. Switch to Java 9 or 10.
  2. Check out wrensec-commons on the feature/fixes-for-22.x-jdk-8-builds branch (currently at b27bc0d).:
  3. Attempt to build the project tests with mvn clean test -DignoreArtifactSigs.

Expected Results

Actual Results

The build fails in chf-http-core, with the following error:

[ERROR] Tests run: 1101, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 18.137 s <<< FAILURE! - in TestSuite
[ERROR] testParseRfc850Date(org.forgerock.http.header.HeaderUtilTest)  Time elapsed: 0.029 s  <<< FAILURE!
java.lang.NullPointerException
        at org.forgerock.http.header.HeaderUtilTest.testParseRfc850Date(HeaderUtilTest.java:151)

[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR]   HeaderUtilTest.testParseRfc850Date:151 ▒ NullPointer
[INFO]
[ERROR] Tests run: 1101, Failures: 1, Errors: 0, Skipped: 0

Additional Notes

This appears to be related to changes made for JEP 252 in Java 9 and later. If the failing tests are run through IntelliJ with -Djava.locale.providers=COMPAT,SPI passed to the JRE, the tests pass. Unfortunately, this workaround isn't a good option for us because it would mean requiring all applications that depend on Commons to modify the JVM args in order to run properly.