Derby
  1. Derby
  2. DERBY-1638

JUnit TestConfiguration class uses engine code to determine JDBC level.

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 10.2.1.6
    • Component/s: Test
    • Labels:
      None

      Description

      TestConfiguration uses the org.apache.derby.iapi.services.info.JVMInfo to determine if JDBC 4 is supported. Ideally test code should not be calling engine private api code.

      Suggest two changes:

      1) Determine JDBC level support from ability to load classes:
      E.g. JDBC2 - java.sql.Driver
      JDBC3 - java.sql.Driver AND java.sql.ParameterMetaData
      JDBC4 - java.sql.Driver AND java.sql.SQLXML
      JSR169 - java.sql.ParameterMetaData AND NOT java.sql.Driver

      2) Move the supportsJDBC4() method from TestConfiguraiton to JDBC, since if the VM supports JDBC4 or not is
      not an attribute of a test configuration (and add other supportsJDBCX methods).

      1. derby1638_diff.txt
        5 kB
        Daniel John Debrunner

        Activity

        Hide
        Daniel John Debrunner added a comment -

        Patch that makes described changes, adding these methods

        supportsJDBC2()
        supportsJDBC3()
        supportsJSR169()

        Might consider changing the methods to be is instead of supports (e.g isJDBC4()) since they are describing
        that the environment is JDBC 4, not what any client may support.

        Then new (yet to be added) methods called supportsJDBC4() might make sense in TestConfiguraiton or maybe JDBCClient to indicate that the client under test is running at a different level, e.g. for the ability to support testing the old 10.1 driver in jdk16 against the new 10.2 server.

        Show
        Daniel John Debrunner added a comment - Patch that makes described changes, adding these methods supportsJDBC2() supportsJDBC3() supportsJSR169() Might consider changing the methods to be is instead of supports (e.g isJDBC4()) since they are describing that the environment is JDBC 4, not what any client may support. Then new (yet to be added) methods called supportsJDBC4() might make sense in TestConfiguraiton or maybe JDBCClient to indicate that the client under test is running at a different level, e.g. for the ability to support testing the old 10.1 driver in jdk16 against the new 10.2 server.
        Hide
        Daniel John Debrunner added a comment -

        Made similar changes to patch. Change from patch is to name the methods vmSupportsJDBC4 etc. to clearly define it's the level of support provided by the virtual machine (and not the client for example).
        Committed revision 429154.

        Show
        Daniel John Debrunner added a comment - Made similar changes to patch. Change from patch is to name the methods vmSupportsJDBC4 etc. to clearly define it's the level of support provided by the virtual machine (and not the client for example). Committed revision 429154.

          People

          • Assignee:
            Daniel John Debrunner
            Reporter:
            Daniel John Debrunner
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development