4.0.0 org.codehaus.mojo dbunit-maven-plugin-example Maven DbUnit Plugin - Example 1.0-beta-1-SNAPSHOT This runnable example execises operation, export, and compare goals. It uses sql-maven-plugin to create database, then have dbunit-maven-plugin to initialize database with some data, export initial data to an external file, import the exported dataset file back to database, finally compare database with orignal dataset file. svn co http://svn.codehaus.org/mojo/trunk/mojo/dbunit-maven-plugin/src/example and run "mvn" test org.codehaus.mojo sql-maven-plugin 1.3 hsqldb hsqldb 1.8.0.7 ${driver} ${url} ${username} ${password} ${maven.test.skip} src/test/data/create-table.sql create-table test-compile execute org.codehaus.mojo dbunit-maven-plugin @project.version@ hsqldb hsqldb 1.8.0.7 ${driver} ${url} ${username} ${password} ${maven.test.skip} insert test operation INSERT ${originalDataSetFile} export test export ${exportedDataSetFile} clean-insert-the-exported-dataset test operation CLEAN_INSERT ${exportedDataSetFile} compare-database-with-original-dataset test compare ${originalDataSetFile} compare-table-with-original-dataset test compare ${originalDataSetFile} person
compare-queries-with-original-dataset test compare ${originalDataSetFile} person select * from person
org.hsqldb.jdbcDriver jdbc:hsqldb:file:target/testdb sa ../../src/test/data/sample-data.xml ${project.build.directory}/dbunit/exported-dataset.xml