This plugin runs twice - I'd suggest looking at its <execution> blocks
in your pom.xml to see when it runs.

Matt

On Wed, Mar 11, 2009 at 2:34 PM, emmettwalsh <emmettwa...@gmail.com> wrote:
>
> Hi,
>
> I have used dbunit before and think i have fairly good knowledge of it but
> the maven2 plugin is confusing me somewhat...
>
> In one of my appfuse tests (that extend BaseDaoTestCase which in turn
> extends AbstractTransactionalDataSourceSpringContextTests) i get the test to
> commit rather than rollback the test by using setDefaultRollback(false);
>
> when I run the test with the maven 2 plugin configured as follows with
> CLEAN_INSERT, the row that I committed in the test seems to be cleaned up
> afterwards, but the row from the dbunit input fie remains.
>
> <plugin>
>                <groupId>org.codehaus.mojo</groupId>
>                <artifactId>dbunit-maven-plugin</artifactId>
>                <version>1.0-beta-1</version>
>                <configuration>
>
> <dataTypeFactoryName>${dbunit.dataTypeFactoryName}</dataTypeFactoryName>
>                    <driver>${jdbc.driverClassName}</driver>
>                    <username>${jdbc.username}</username>
>                    <password>${jdbc.password}</password>
>                    <url>${jdbc.url}</url>
>                    <src>src/test/resources/sample-data.xml</src>
>                    <type>CLEAN_INSERT</type>
>                    <schema>${dbunit.schema}</schema>
>                    <skip>${maven.test.skip}</skip>
>                </configuration>
>                <executions>
>                    <execution>
>                        <id>test-compile</id>
>                        <phase>test-compile</phase>
>                        <goals>
>                            <goal>operation</goal>
>                        </goals>
>                    </execution>
>                    <execution>
>                        <id>test</id>
>                        <phase>test</phase>
>                        <goals>
>                            <goal>operation</goal>
>                        </goals>
>                    </execution>
>                </executions>
>                <dependencies>
>                    <dependency>
>                        <groupId>${jdbc.groupId}</groupId>
>                        <artifactId>${jdbc.artifactId}</artifactId>
>                        <version>${jdbc.version}</version>
>                    </dependency>
>                </dependencies>
>            </plugin>
>
> however if I change the opreation type to REFRESH, the row that I commit in
> the test is left in the database afterwards.
>
> I guess my question is - is the maven dbunit plugin doing something weird
> after my tests have run? like a DELETE when i set the operation type to
> CLEAN_INSERT, and a NONE when I use REFRESH ?
>
> I find the documentation for some of these maven plugins very cryptic at
> times....
>
> thanks
> E
> --
> View this message in context: 
> http://www.nabble.com/maven-2-dbunit-plugin-strange-behaviour-tp22465075s2369p22465075.html
> Sent from the AppFuse - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@appfuse.dev.java.net
> For additional commands, e-mail: users-h...@appfuse.dev.java.net
>
>

Reply via email to