-
Notifications
You must be signed in to change notification settings - Fork 38.4k
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
Introduce a TestExecutionListener for DbUnit [SPR-6593] #11259
Comments
Dave Syer commented WIth modern JUnit (4.7 perhaps but to be safe 4.8.1) it is good style to use
|
!!Use pwebb rather than philw commented I have been working on some code to provide Spring DBUnit integration that could perhaps form the basis of a patch for this feature. The code allows for Annotations can be processed using a Spring TestExecutionListener or a The code is hosted here There is also a sample project here: Any feedback or comments are welcome. |
Sam Brannen commented Have you guys looked at Carbon Five's custom DbUnit TestExecutionListener? Does the |
Dave Syer commented It's not as nice as the patch proposed by Phil - not as flexible and requires a base class from a quick scan. Why not just accept the contribution as it is? |
!!Use pwebb rather than philw commented I did try to google for existing projects before I started coding but this one must have slipped though the net. By the way, they now have a google code project hosted here: http://code.google.com/p/c5-test-support/ I like the way that with C5 the a default dataset xml filename is loaded if there is no value on the annotation. That seems like a sensible choice. The datasource lookup is also nice, mine relies on a specific bean name (if not configured), where as C5 searches for any dataset. I also notice that they use a ReplacementDataSet to support [NULL] in the dataset XML. I am not sure what advantage this gives over simply omitting the attribute from the XML but it is another feature. I think Dave may be mistaken with the assertion that a base class is required to use the code. I think that is is just a convenience class and it does not need to be used. Now, I may be a little biased here, but I think there are some things that my code offers over C5:
I also have quite an extensive set of unit tests that cover a large proportion of the code. Perhaps Spring/DBUnit integration is something that is better served by separate independent projects rather than adding to the core of Spring? I am happy to publish this code separately if does not fit will within Spring; or try to refine it if there are any specifics that you want changed. Cheers, |
Phil Webb commented The source code for this project has now moved to https://github.com/springtestdbunit/spring-test-dbunit |
Phil Webb commented |
Sam Brannen commented Deleted references to Unitils since this issue focuses on DbUnit support. See #9043 for the requested hooks to allow Unitils to integrate directly in the TestContext Framework. |
Juergen Hoeller commented It doesn't seem like there are any remaining intentions to add this to Spring Framework proper. To be reopened if we decide otherwise. Juergen |
Dave Syer opened SPR-6593 and commented
Primary Goal
Add a
TestExecutionListener
for DbUnit.Related Resources
Issue Links:
@Rule
alternative to SpringJUnit4ClassRunner ("Cloned to")5 votes, 7 watchers
The text was updated successfully, but these errors were encountered: