You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Nicolas De Loof <ni...@capgemini.com> on 2005/03/31 16:32:33 UTC

howto start HSQLDB before test ?

Hi,

I've searched the archive for a solution to my problem without result :

I'd like to test my DAO using dbUnit. I've setup an in memory HSQLDB in 
the test setUp() and it works fine, but the DB is started and created 
before every test is run (I'm using fork=true, maybee it can explain ?).

I'd like to setup my build process to startup the HSQLDB as Server in a 
parallel process and apply the schema as a test pregoal, and stop it as 
a postGoal. Having this, setUp() should only connect to running DB.

Does anyone use such a build scenario and can share maven.xml ?

Nico.

This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient,  you are not authorized to read, print, retain, copy, disseminate,  distribute, or use this message or any part thereof. If you receive this  message in error, please notify the sender immediately and delete all  copies of this message.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: howto start HSQLDB before test ?

Posted by Laurent Petit <lp...@sqli.com>.
Nicolas De Loof wrote:

> I'd like to test my DAO using dbUnit. I've setup an in memory HSQLDB 
> in the test setUp() and it works fine, but the DB is started and 
> created before every test is run (I'm using fork=true, maybee it can 
> explain ?).
>
> I'd like to setup my build process to startup the HSQLDB as Server in 
> a parallel process and apply the schema as a test pregoal, and stop it 
> as a postGoal. Having this, setUp() should only connect to running DB.
>
> Does anyone use such a build scenario and can share maven.xml ?
>
> Nico.

Hello,

For now on our project, we start a separate maven shell with the 
following goal :
    <goal name="hsql:start-server" description="Starts Hsqldb standalone 
server">
        <echo>Starting HSQLDB Server</echo>
        <ant:java classname="org.hsqldb.Server"
            classpathref="maven.dependency.classpath"
            fork="true">
            <arg value="-database.0"/>
            <arg value="${maven.hsql.server.database.0}"/>
            <arg value="-dbname.0"/>
            <arg value="${maven.hsql.server.dbname.0}"/>
        </ant:java>
        <echo>HSQLDB Server Started</echo>
    </goal>

If does work, but has the same workaround you're trying to avoid : a 
manual "start" operation.

if you find something, please tell.

-- 
Laurent

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org