rmpestano / dbunit-rules

https://github.com/database-rider/database-rider
15 stars 5 forks source link

@DataSet for the whole test class #13

Closed Toilal closed 8 years ago

Toilal commented 8 years ago

Is it possible to set @DataSet on the class level, in order all tests in the class to use the same dataset ?

I was thinking of this kind of solution to manage DbUnit tests more efficiently, and found your project that should really have more stars :)

Thanks for your work.

rmpestano commented 8 years ago

Hi there,

I think its possible,I will have a look at the weekend and try to implement it. Method level will take precedence over class level annotation.

Glad you liked it :+1:

rmpestano commented 8 years ago

Should be fixed, you can test with version 0.6.0-SNAPSHOT by adding central snapshot repository in your pom:

<repositories>
    <repository>
        <snapshots/>
        <id>snapshots</id>
        <name>libs-snapshot</name>
        <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </repository>
</repositories>

there is test verifying this behaviour here: https://github.com/rmpestano/dbunit-rules/blob/master/core/src/test/java/com/github/dbunit/rules/DBUnitClassLevelAnnotationIt.java

Toilal commented 8 years ago

:+1: Thanks for you work ! I'll try this and #14 ASAP (tomorrow I think).