Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-18827

camel-kudu - Fix unit test failure with JDK 17

    XMLWordPrintableJSON

Details

    • Test
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 3.21.0, 4.0-M1, 4.0.0
    • camel-kudu
    • None
    • Unknown

    Description

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

      $ 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] ------------------------------------------------------------------------
      

      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.

      $ 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
      

      Attachments

        Issue Links

          Activity

            People

              sekikn Kengo Seki
              sekikn Kengo Seki
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: