Share

DbUnit

Tracker: Feature Requests

5 Provide example for use of queries in maven plugin - ID: 2883382
Last Update: Settings changed ( gommma )

I'm trying to figure out how to use the "queries" parameter for the maven2
export goal. Can you please provide an example on your website? I could
not figure out how to search the mail archives to see if this had been
asked/answered before. Multiple searches in the BUG and FEATURE REQUEST
trackers produced no similar requests.


sellerjd ( sellerjd ) - 2009-10-21 16:56

5

Closed

Fixed

Nobody/Anonymous

None

None

Public


Comments ( 3 )

Date: 2009-11-03 22:36
Sender: gommma

I committed the example to the svn trunk rev. 1094 and with the next
release of the dbunit-maven-plugin (newly hosted in dbunit sf SVN) it will
be on the site.
regards,
matthias


Date: 2009-10-21 21:13
Sender: sellerjd

Thanks gommma, I didn't realize I was posting in the wrong place, my bad.

Your example is exactly what I was looking for and works great. I wasn't
sure how to specify the xml element as a "Query" type, I see you do so by
adding "implementation = ...".

Much appreciated!


Date: 2009-10-21 20:54
Sender: gommma

Hi,
I'm not sure whether you are aware of the fact that the dbunit maven
plugin is currently maintained on a different site:
http://mojo.codehaus.org/dbunit-maven-plugin/export-mojo.html
You can find an example for the export goal at
http://mojo.codehaus.org/dbunit-maven-plugin/examples/export-full.html

Here an example that should work (but I did not test this, so feel free to
correct me if I'm wrong):


<executions>
<execution>
<phase>test</phase>
<goals>
<goal>export</goal>
</goals>
<!-- specific configurations -->
<configuration>
<format>xml</format>
<dest>target/dbunit/export.xml</dest>
<queries>
<query implementation="org.dbunit.ant.Query">
<name>myQueryName</name>
<sql>select * from MYTAB</sql>
</query>
</queries>
</configuration>
</execution>
[...]
</executions>

Please let me know if it works.

rgds,
matthias


Attached File

No Files Currently Attached

Changes ( 4 )

Field Old Value Date By
status_id Open 2009-11-03 22:36 gommma
resolution_id None 2009-11-03 22:36 gommma
allow_comments 1 2009-11-03 22:36 gommma
close_date - 2009-11-03 22:36 gommma