-
1. Re: Arquillian and Unitils
pnizio Sep 27, 2010 9:43 AM (in response to blabno)I'm successfully using DbUnit in my Arquillian tests It doesn't require any boilerplate code, as DbUnit provides convenient superclasses for your test. They take care of any database setup and all you have to do is provide dataset and connection URL.
-
2. Re: Arquillian and Unitils
blabno Sep 28, 2010 4:01 AM (in response to pnizio)Well, and if I cannot use super class from DbUnit?
-
3. Re: Arquillian and Unitils
pnizio Sep 30, 2010 4:38 AM (in response to blabno)Then you'll have to figure out some other solution to avoid repeating the code...
If your tests need to inherit from your own superclass try adding the DbUnit code to it.
-
4. Re: Arquillian and Unitils
nickarls Feb 9, 2011 4:07 AM (in response to pnizio)Mind sharing some example code? I'm interested in prior work regarding ARQ-DBUnit integration
-
5. Re: Arquillian and Unitils
blabno Feb 9, 2011 4:19 AM (in response to nickarls)Nicklas, did you mean Piotr or me to share examples?
I haven't integrated Arquillian with Unitils yet, but here is tutorials for Unitils:http://unitils.org/tutorial.html.
What is best about Arquillian is it doesn't force us to use JUnit3 as Cactus did (used by JSFUnit <=1.3.0).
However some testing utilities, Unitils is good example, require running tests with their own test runner and this clashes with Arquillian. Do you think this can be somehow overcome?
-
6. Re: Arquillian and Unitils
nickarls Feb 9, 2011 4:42 AM (in response to blabno)Actually Piotr since he appeared to have a smoother ride ;-)
It would be nice to have a small demo for ARQ that would show testing of both the business layer (component injection), database (seeding + testing) and view (JSFUnit).
-
7. Re: Arquillian and Unitils
pnizio Feb 10, 2011 4:46 AM (in response to nickarls)Sure, I can prepare some example project It should be ready after the weekend.
-
8. Re: Arquillian and Unitils
nickarls Feb 10, 2011 4:48 AM (in response to pnizio)Thanks. I'm currently picking apart http://ctpjava.blogspot.com/2010/07/test-drive-with-arquillian-and-cdi-part.html to see what could be further integrated from that point.
-
9. Re: Arquillian and Unitils
pnizio Feb 19, 2011 11:49 AM (in response to nickarls)Here is the promised example. Prerequisities: running JBoss 5.1 and MySQL. All tests are run inside container. It must have a datasource properly configured (for details see persistence.xml).
There is a 'hack' with an utility class for getting EJB references, because I couldn't make the @EJB injections working.
The jar file that is deployed to the server has to contain all required classes (including DBunit files), so I am using a solution for resolving maven artifacts found on this forum.
I added as many comments as I thought would be helpful, but in case of any questions please just ask
-
arq-dbunit.zip 12.5 KB
-
-
10. Re: Arquillian and Unitils
bmajsak Oct 31, 2011 6:01 AM (in response to blabno)Quick update - now it's an offical extension! https://github.com/arquillian/arquillian-extension-persistence