You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jspwiki.apache.org by "Juan Pablo Santos Rodríguez (Jira)" <ji...@apache.org> on 2021/11/15 14:05:00 UTC

[jira] [Updated] (JSPWIKI-808) Refactor of o.a.w.HsqlDbUtils.stop()

     [ https://issues.apache.org/jira/browse/JSPWIKI-808?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Juan Pablo Santos Rodríguez updated JSPWIKI-808:
------------------------------------------------
    Fix Version/s: 2.10

> 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
>             Fix For: 2.10
>
>
> 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
(v8.20.1#820001)