On Mon, Oct 27, 2008 at 10:57 AM, Gili <[EMAIL PROTECTED]> wrote: > > Robbie, > > Is it considered "good practice" to stub out database classes when > you're unit testing network code? Or am I better off using something > like DbUnit to test against a real database? I have been reluctant to > use DbUnit because of my XML-phobia :) I don't like the headache of > having to set up the test data in some XML format. I much prefer > stubbing out the database using normal Java code (it's easy enough to > do) but then I'm afraid I'm not testing something vital. Is there an > easier way to do all of this?
I certainly would prefer Java code, but whatever works. The greater point is that you need to decide on your test's granularity: Unit test: mock everything Integration test: try and use the real services you're trying to integrate, mock other things, or use an in memory store. Acceptance test: (e.g. selenium or webdriver) everything should be real. Dhanji. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "google-guice" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-guice?hl=en -~----------~----~----~----~------~----~------~--~---
