Uploaded image for project: 'JSPWiki'
  1. JSPWiki
  2. JSPWIKI-808

Refactor of o.a.w.HsqlDbUtils.stop()

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 2.10
    • Unit Testing
    • None

    Description

      Snipping texts from the dev ML:

      [...]
      It seems that tearing down the HSQL server instance isn’t finished yet when the following test starts, leading to the „port already in use” error message.

      [...]
      Workaround for testing Hsql

      Waits 1000 milliseconds after each test before starting the next. Otherwise
      the tests often fail reporting that the listening port of the database
      server is already in use.

      This approach was included as part of 2.10.0-svn-59. However, the org.hsqldb.Server.stop() javadoc states:

      Stops this server asynchronously.

      This method returns immediately, regardless of current state. In order to discover the success or failure of this operation, server state must be polled or a subclass of Server must be used that overrides the setState method to provide state change notification.

      Returns: the server state noted at entry to this method

      Possible approaches:

      • polling
      • subclassing (as per javadoc)
      • starting / stopping the Server for the whole test
      • use innodb-maven-plugin, which is already used by IT tests (note that this may require to launch maven to run the unit test)

      Attachments

        Activity

          People

            Unassigned Unassigned
            juanpablo Juan Pablo Santos Rodríguez
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: