Hi all,
I use SQL maven plugin and dbunit maven plugin to initialize a
database before running tests. It works perfect with MySQL. But I need
to run tests on HSQLDB in memory mode, so that you need no database
server to run the tests.
But I can't find how to make it work. The SQL plugin succeeds but the
dbunit plugin fails with this message :
org.apache.maven.lifecycle.LifecycleExecutionException: Error
executing database operation: CLEAN_INSERT
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:559)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:475)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:454)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:306)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:140)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:256)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error
executing database operation: CLEAN_INSERT
at
org.codehaus.mojo.dbunit.OperationMojo.execute(OperationMojo.java:110)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:412)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:534)
... 16 more
Caused by: org.dbunit.dataset.NoSuchTableException: parametre_processus
at
org.dbunit.database.DatabaseDataSet.getTableMetaData(DatabaseDataSet.java:192)
at
org.dbunit.operation.DeleteAllOperation.execute(DeleteAllOperation.java:98)
at
org.dbunit.operation.CompositeOperation.execute(CompositeOperation.java:67)
at org.dbunit.ant.Operation.execute(Operation.java:183)
at
org.codehaus.mojo.dbunit.OperationMojo.execute(OperationMojo.java:101)
... 18 more
So it looks like the database was dropped after sql maven plugin ended.
When I run maven with -X option, I can see the following configuration
which looks OK :
[DEBUG] Configuring mojo
'org.codehaus.mojo:dbunit-maven-plugin:1.0-beta-1:operation' -->
[DEBUG] (f) dataTypeFactoryName =
org.dbunit.dataset.datatype.DefaultDataTypeFactory
[DEBUG] (f) datatypeWarning = false
[DEBUG] (f) driver = org.hsqldb.jdbcDriver
[DEBUG] (f) format = flat
[DEBUG] (f) settings = [EMAIL PROTECTED]
[DEBUG] (f) skip = false
[DEBUG] (f) src = C:\Documents\t4Seam\core\src\test\resources\data\dataset.xml
[DEBUG] (f) supportBatchStatement = false
[DEBUG] (f) transaction = false
[DEBUG] (f) type = CLEAN_INSERT
[DEBUG] (f) url = jdbc:hsqldb:mem:test
[DEBUG] (f) useQualifiedTableNames = false
[DEBUG] (f) username = sa
Anyone has an idea why I have this problem ?
Olivier
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email