Kengo Seki created CAMEL-18827:
----------------------------------

             Summary: camel-kudu - Fix unit test failure with JDK 17
                 Key: CAMEL-18827
                 URL: https://issues.apache.org/jira/browse/CAMEL-18827
             Project: Camel
          Issue Type: Improvement
          Components: camel-kudu
            Reporter: Kengo Seki


Some Kudu's unit tests are skipped for JDK 17, as follows:

{code}
$ java -version
openjdk version "17.0.5" 2022-10-18 LTS
OpenJDK Runtime Environment Corretto-17.0.5.8.1 (build 17.0.5+8-LTS)
OpenJDK 64-Bit Server VM Corretto-17.0.5.8.1 (build 17.0.5+8-LTS, mixed mode, 
sharing)
$ cd components/camel-kudu
$ ../../mvnw clean test

...

[INFO] --- maven-surefire-plugin:3.0.0-M5:test (default-test) @ camel-kudu ---
[INFO]
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running org.apache.camel.component.kudu.KuduComponentConfigurationTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.521 s 
- in org.apache.camel.component.kudu.KuduComponentConfigurationTest
[INFO] Running org.apache.camel.component.kudu.KuduProducerTest
[WARNING] Tests run: 3, Failures: 0, Errors: 0, Skipped: 3, Time elapsed: 0.045 
s - in org.apache.camel.component.kudu.KuduProducerTest
[INFO] Running org.apache.camel.component.kudu.KuduScanTest
[WARNING] Tests run: 2, Failures: 0, Errors: 0, Skipped: 2, Time elapsed: 0.011 
s - in org.apache.camel.component.kudu.KuduScanTest
[INFO]
[INFO] Results:
[INFO]
[WARNING] Tests run: 7, Failures: 0, Errors: 0, Skipped: 5
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  6.550 s
[INFO] Finished at: 2022-12-18T09:39:28+09:00
[INFO] ------------------------------------------------------------------------
{code}

Its cause is reported in camel-kudu-test.log as follows. We have to add the 
"--add-opens" option for JDK 17+, just like CAMEL-16962.

{code}
$ cat target/camel-kudu-test.log

...

2022-12-18 09:39:28,041 [main           ] DEBUG IntegrationKuduConfiguration   
- Kudu harness is not runnable because: Unable to make private static 
java.net.InetAddress$NameService java.net.InetAddress.createNameService() 
accessible: module java.base does not "opens java.net" to unnamed module 
@1572270e
java.lang.reflect.InaccessibleObjectException: Unable to make private static 
java.net.InetAddress$NameService java.net.InetAddress.createNameService() 
accessible: module java.base does not "opens java.net" to unnamed module 
@1572270e
{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to