|
View:
New views
7 Messages
—
Rating Filter:
Alert me
|
|
|
|
|
|
Re: Begin book addresses mock object testing only (alternatives?)You could look at the Ibatis or Ibator builds - they both unit test with JUnit against a "live" database (hsqldb).
The Ibator build uses generated DAO layer, JUnit, hsqldb - seems like just what you are asking for.
Jeff Butler On Wed, Jul 8, 2009 at 12:52 PM, David Brown <dbrown@...> wrote: Hello Begin, Goodin and Meadors, having read (and reread) the Begin book, and in particular, the ch. 13 Unit testing only seems to cover the use of Mock objects. I don't dispute the need and usefulness of Mock objects but I would like to JUnit test my iBatis/MySql development using a live database. I know this is discussed briefly in the book but I don't see any real-world examples that apply to what I am trying to test. Please reply with links or directives to examples of DAO layer JUnit testing of iBatis against a live database. The most valuable example would test against two tables with references and contraints e.g. primary key auto-generation and a FK reference to the generated key. My current efforts only return test errors (not failures). Regards, David. |
|
|
Re: Begin book addresses mock object testing only (alternatives?)JPetStore also has unit tests that hit the database directly.
Clinton
On Wed, Jul 8, 2009 at 12:03 PM, Jeff Butler <jeffgbutler@...> wrote: You could look at the Ibatis or Ibator builds - they both unit test with JUnit against a "live" database (hsqldb). |
|
|
|
|
|
Re: Begin book addresses mock object testing only (alternatives?)Yes - I mean building from source. The Ibator build includes hundreds of tests that utilize DAO, JUnit, Spring (in some cases), and hsqldb. If you are looking for code examples, then either of the builds offers a wealth of examples. Both run from the command line.
Jeff Butler On Wed, Jul 8, 2009 at 4:28 PM, David Brown <dbrown@...> wrote: Hello Jeff, thanks for the reply. I'm not sure what you mean by the IBatis builds (build IBatis from source?). In any case I accepted the Clinton Begin advice (challange) and I built the JPetstore. I'm not confident in the use of in-memory DBs even if it is hsql. And, my requirements are for: MySQL. This being said I re-configured the JPetstore app to use MySql. I ran all 3 .sql files to setup the MySql instance with a JPetstore database. I deployed the jpetstore.war to TC but invoking the url: http://localhost:8080/jpetstore only evokes the server 500 error (See included stacktrace). I did not have this issue with the hsql version of JPetstore. If the IBator build means something deployable or buildable on the command-line please advise, David. |
|
|
|
|
|
|
| Free embeddable forum powered by Nabble | Forum Help |