Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: annotation @DbUnit per feature #7

Closed
cbrani opened this issue Feb 14, 2017 · 3 comments
Closed

Feature request: annotation @DbUnit per feature #7

cbrani opened this issue Feb 14, 2017 · 3 comments

Comments

@cbrani
Copy link

cbrani commented Feb 14, 2017

It would be nice to have the possibility to annotate a feature with @dbunit.
It would allow e.g. that only one feature uses dbunit or that several feature could have their individual dbunit instruction set.

@janbols
Copy link
Owner

janbols commented Mar 2, 2017

It's doable and somthing I've been thinking about myself.

janbols added a commit that referenced this issue Mar 26, 2017
Make it possible to combine field level dbUnit annotations and feature level dbUnit annotations. They're mutual exclusive so for 1 feature the feature level DbUnit annotation will be used and the field level one will be ignored. If the feature isn't annotated with a DbUnit annoation, the field one will be used.
@janbols
Copy link
Owner

janbols commented Mar 28, 2017

Hi @cbrani , in version 0.3 you can specify a DbUnit annotation on each feature. Please see the readme for more information. Please take a look at it and let me know if that's what you had in mind.

@janbols janbols closed this as completed Mar 28, 2017
@cbrani
Copy link
Author

cbrani commented Mar 29, 2017

Hi @janbols ,
Great, yes that's what I had in mind 👍

I came up with some further notes nevertheless ;-)

If the schema attribute would be a Closure it would be more flexible. In our test environment we have user specific settings and one of them is the used DB schema. With a closure you could reference the config variable and extract the schema.

Not all of the features in our specification classes need a dbunit setup. The current workaround is that I setup the field annotation with an empty content and annotate the features which definitely need a dbunit setup with an extra @dbunit. I don't know yet if that is a performance penalty but it works. Do you think it would be an idea to have a sort of a skip annotation for a feature? Or another option would be to omit the field annotation and only use the feature annotation in that case (which doesn't work right now. I tried ;-) )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants