Details

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

      Description

      I noticed a couple of things that could be cleaned up in CoalesceTest:

      • It keeps statements in instance variables. These are closed in tearDown(), but not nulled out, so they are not gc'ed when the test completes.
      • It has much code that follows the pattern

      try

      { s.execute(...); }

      catch (SQLException sqle)

      { assertSQLState(state, sqle); }

      which means it won't report a failure if the execution of the statement succeeds unexpectedly.

      1. d5704-1a.diff
        21 kB
        Knut Anders Hatlen

        Activity

        Hide
        Knut Anders Hatlen added a comment -

        The attached patch makes the following changes:

        • Remove the instance variables s and ps, and instead create local variables where needed. This allows us to remove setUp() and tearDown(), and not worrying about closing/nulling out the statements.
        • Replace try/catch/assertSQLState with assertCompileError() and assertStatementError() where possible.
        • Add missing fail() call to remaining try/catch/assertSQLState blocks.
        Show
        Knut Anders Hatlen added a comment - The attached patch makes the following changes: Remove the instance variables s and ps, and instead create local variables where needed. This allows us to remove setUp() and tearDown(), and not worrying about closing/nulling out the statements. Replace try/catch/assertSQLState with assertCompileError() and assertStatementError() where possible. Add missing fail() call to remaining try/catch/assertSQLState blocks.
        Hide
        Knut Anders Hatlen added a comment -

        Committed revision 1330195.

        Show
        Knut Anders Hatlen added a comment - Committed revision 1330195.

          People

          • Assignee:
            Knut Anders Hatlen
            Reporter:
            Knut Anders Hatlen
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development