Juan Pablo Santos Rodríguez created JSPWIKI-808:
---------------------------------------------------

             Summary: Refactor of o.a.w.HsqlDbUtils.stop()
                 Key: JSPWIKI-808
                 URL: https://issues.apache.org/jira/browse/JSPWIKI-808
             Project: JSPWiki
          Issue Type: Improvement
          Components: Unit Testing
            Reporter: Juan Pablo Santos Rodríguez
            Priority: Minor


Snipping texts from the dev ML:

{quote}
*\[...]* 
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.
{quote}

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

{quote}
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
{quote}

Possible approaches:
* polling 
* subclassing (as per javadoc)
* starting / stopping the Server for the whole test
* use 
[innodb-maven-plugin|https://github.com/bmatthews68/inmemdb-maven-plugin], 
which is already used by IT tests (note that this may require to launch maven 
to run the unit test)



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to