Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-21226

Replace driver major/minor-version config testing in DriverCfgMetricUnitTestCase

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • JCA
    • None
    • ---
    • ---

      For context, see https://github.com/wildfly/wildfly/pull/19418#discussion_r2574743446

      DriverCfgMetricUnitTestCase.testDriverAttributes exercises the driver major-version and minor-version attributes but hard coding values in an xml snippet, which then checks those values against what's reported by the H2 Driver class.

      This test will fail / require update every time we upgrade to a new major or minor version of H2, and it can't work at all if the test needs to be run against different server variants that use different H2 versions (e.g. std WF vs WF Preview or future EE 10 vs EE 11 variants of std WildFly.) Because of this in the PR linked above we removed the setting of the minor-version.

      To test that the subsystem validation correctly rejects wrong values, a reasonable hack is to test config snippets with obviously bogus values like 999999. Checking that correct values work would be more complex but could be done by having the test driver instantiate the Driver class and read its versions, and then send ops to add a driver resource with the correct versions.

      Note that the existing test doesn't test the rejection scenario; it essentially just tests that using the correct values doesn't result in anything breaking (except sometimes when we upgrade H2.)

              tadamski@redhat.com Tomasz Adamski
              bstansbe@redhat.com Brian Stansberry
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: