Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-1272

Tests fail with early access JVM builds

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Trivial
    • Resolution: Fixed
    • None
    • 3.5.6
    • test
    • None

    Description

      A code snippet of a failed test preparation step:

      │  ├─ CredentialPluginTest
      │  │  │     caught: java.lang.NumberFormatException: For input string: "25-ea"
      │  │  │               	at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:67)
      │  │  │               	at java.base/java.lang.Integer.parseInt(Integer.java:565)
      │  │  │               	at java.base/java.lang.Integer.parseInt(Integer.java:662)
      │  │  │               	at org.mariadb.jdbc.integration.CredentialPluginTest.beforeTest(CredentialPluginTest.java:27)
      │  │  │               	at java.base/java.lang.reflect.Method.invoke(Method.java:565)
      │  │  │               	at java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
      │  └─ CredentialPluginTest finished after 4 ms.
      

      In current Fedora Rawhide the system property java.version is "25-ea".
      I applied this downstream fix:

      --- a/src/test/java/org/mariadb/jdbc/integration/CredentialPluginTest.java
      +++ b/src/test/java/org/mariadb/jdbc/integration/CredentialPluginTest.java
      @@ -20,7 +20,7 @@ public class CredentialPluginTest extends Common {
          */
         @BeforeAll
         public static void beforeTest() throws SQLException {
      -    String version = System.getProperty("java.version");
      +    String version = System.getProperty("java.version").replaceAll("[^.\\d]", "");
           int majorVersion =
               (version.indexOf(".") >= 0)
                   ? Integer.parseInt(version.substring(0, version.indexOf(".")))
      

      Attachments

        Activity

          People

            diego dupin Diego Dupin
            mkoncek Marián Konček
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.