Derby
  1. Derby
  2. DERBY-2305

Convert tests in derbynet that will run via HarnessJavaTest

    Details

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

      Description

      I was able to convert three tests in derbynet to run via HarnessJavaTest. The problems with the other tests are mentioned in the javadoc for the test. Forking the VM seemed to be a problem in most cases, at least running from within Eclipse, because the forked VM would not have the correct classpath. Attaching patch for review. Note that BadConnectionTest is commented out in _Suite in this patch, as I have a separate patch for converting the very simple bad connection test.

      1. derby-2305-v1.diff
        19 kB
        Andrew McIntyre

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Closed Closed
        8d 2h 41m 1 Andrew McIntyre 15/Feb/07 23:06
        Gavin made changes -
        Workflow jira [ 12396028 ] Default workflow, editable Closed status [ 12797953 ]
        Andrew McIntyre made changes -
        Derby Info [Patch Available]
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Hide
        Andrew McIntyre added a comment -

        Committed patch and removed the tests that run in NetHarnessJavaTest from the old harness. Will investigate converting BadConnectionTest into a more generic driver test later.

        Show
        Andrew McIntyre added a comment - Committed patch and removed the tests that run in NetHarnessJavaTest from the old harness. Will investigate converting BadConnectionTest into a more generic driver test later.
        Hide
        Andrew McIntyre added a comment -

        Thanks for the quick feedback, Dan.

        I guess I was a little surprised when the base test classes didn't load the driver in their setUp, but I suppose that makes sense if you want to test different driver loading behaviors and still use the base classes. I asked about j9 because badConnection was listed in j9derbynetmats.runall, so some client/server tests were at one time run with j9, however inappropriate that may have been.

        Good point about the exception text. I'll remove that, and take a look at checkDriver as well...

        Show
        Andrew McIntyre added a comment - Thanks for the quick feedback, Dan. I guess I was a little surprised when the base test classes didn't load the driver in their setUp, but I suppose that makes sense if you want to test different driver loading behaviors and still use the base classes. I asked about j9 because badConnection was listed in j9derbynetmats.runall, so some client/server tests were at one time run with j9, however inappropriate that may have been. Good point about the exception text. I'll remove that, and take a look at checkDriver as well...
        Hide
        Daniel John Debrunner added a comment -

        A1) Yes.

        A2) Client doesn't implement JSR169 so it cannot be run on J2ME/CDC/Foundation

        A3) Comparing the exception text means that the test will most likely fail if run in a different locale.
        It would be good to have the ability to run the tests in different locales

        Also it seems nothing in BadConnectionAttribute is specific to client/server. Seems like moving the test to jdbcapi and renaming the class ConnectionAttributeTest would be good. Then it could be a single place for checking bad and good attributes, combining with checkDriver.

        Show
        Daniel John Debrunner added a comment - A1) Yes. A2) Client doesn't implement JSR169 so it cannot be run on J2ME/CDC/Foundation A3) Comparing the exception text means that the test will most likely fail if run in a different locale. It would be good to have the ability to run the tests in different locales Also it seems nothing in BadConnectionAttribute is specific to client/server. Seems like moving the test to jdbcapi and renaming the class ConnectionAttributeTest would be good. Then it could be a single place for checking bad and good attributes, combining with checkDriver.
        Hide
        Daniel John Debrunner added a comment -

        Just FYI - I was waiting the customary 72 hours for feedback on taking the HarnessJavaTest approach before enabling it and removing tests from the old harness. I think there's still around 24 to go ....

        Show
        Daniel John Debrunner added a comment - Just FYI - I was waiting the customary 72 hours for feedback on taking the HarnessJavaTest approach before enabling it and removing tests from the old harness. I think there's still around 24 to go ....
        Andrew McIntyre made changes -
        Attachment derby-2305-v1.diff [ 12350592 ]
        Hide
        Andrew McIntyre added a comment -

        Starting over, decided to just go ahead and include the new BadConnectionTest this time instead of trying to untangle the two patches.

        Comments for BadConnectionTest:

        1. I had to get the default connection or else the driver wasn't automatically loaded via any of the other setup processes. Is that expected?

        2. Using clientServerDecorator excludes the test from running on j9, are we not expecting to run client testing with j9 at all?

        3. I probably didn't need to assertEquals the entire exception text in testBadConnectionAttribute. I can remove that if anyone objects.

        Show
        Andrew McIntyre added a comment - Starting over, decided to just go ahead and include the new BadConnectionTest this time instead of trying to untangle the two patches. Comments for BadConnectionTest: 1. I had to get the default connection or else the driver wasn't automatically loaded via any of the other setup processes. Is that expected? 2. Using clientServerDecorator excludes the test from running on j9, are we not expecting to run client testing with j9 at all? 3. I probably didn't need to assertEquals the entire exception text in testBadConnectionAttribute. I can remove that if anyone objects.
        Andrew McIntyre made changes -
        Attachment derby-2305-v1.diff [ 12350589 ]
        Andrew McIntyre made changes -
        Attachment derby-2305-v2.diff [ 12350590 ]
        Andrew McIntyre made changes -
        Attachment derby-2305-v2.diff [ 12350590 ]
        Hide
        Andrew McIntyre added a comment -

        Attaching updated patch which includes the change to TestProto I left out of the other patch.

        Show
        Andrew McIntyre added a comment - Attaching updated patch which includes the change to TestProto I left out of the other patch.
        Andrew McIntyre made changes -
        Field Original Value New Value
        Attachment derby-2305-v1.diff [ 12350589 ]
        Andrew McIntyre created issue -

          People

          • Assignee:
            Andrew McIntyre
            Reporter:
            Andrew McIntyre
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development