You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by David Brown <db...@sexingtechnologies.com> on 2009/07/08 19:52:39 UTC

Begin book addresses mock object testing only (alternatives?)

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.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


Re: Begin book addresses mock object testing only (alternatives?)

Posted by Clinton Begin <cl...@gmail.com>.
JPetStore also has unit tests that hit the database directly.
Clinton

On Wed, Jul 8, 2009 at 12:03 PM, Jeff Butler <je...@gmail.com> wrote:

> 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@sexingtechnologies.com> 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.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
>> For additional commands, e-mail: user-java-help@ibatis.apache.org
>>
>>
>

Re: Begin book addresses mock object testing only (alternatives?)

Posted by Jeff Butler <je...@gmail.com>.
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
<db...@sexingtechnologies.com>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.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
> For additional commands, e-mail: user-java-help@ibatis.apache.org
>
>