starting and stopping hsqldb from unit tests

后端 未结 6 783
清歌不尽
清歌不尽 2021-01-21 04:07

I\'m trying to create integration tests using hsqldb in an in memory mode. At the moment, I have to start the hsqldb server from the command line before running the unit tests.

6条回答
  •  迷失自我
    2021-01-21 04:46

    check my hsqldb maven plugin : https://github.com/avianey/hsqldb-maven-plugin

    You can just start/stop it like jetty-maven-plugin or tomee-maven-plugin for your tests :

    
    
        
        fr.avianey.mojo
        hsqldb-maven-plugin
        1.0.0
    
        
        
            org.hsqldb.jdbcDriver
            mem:test
            
    localhost
    xdb sa SELECT 1 FROM INFORMATION_SCHEMA.SYSTEM_USERS
    start-hsqldb pre-integration-test start stop-hsqldb post-integration-test stop

提交回复
热议问题