On 5/16/07, chino fish <[EMAIL PROTECTED]> wrote:
>
>
>
>
> 1.       the test is function test, not unit test. Isn't it ? b/c it uses
> real service object, but mock objects.

Yes.

>
> 2.       the method followed is a bit of useless..b/c personManager andd
> person are not used by other test at all.

It's used to add at least one record to the database so testSearch()
doesn't fail.

Matt

Oh, that's what I guessed ;-)
It seems the method should only be called in testSearch method。
But actually, it is called before every test b/c the code was in method
onSetupBeforeTransaction which is called by setup method.

And b/c dbunit plunge some sample data into db, so there is already at least
one record in the table.

>
>     protected void onSetUpBeforeTransaction() throws Exception {
>
>
>
>         super.onSetUpBeforeTransaction();
>
>         GenericManager personManager = (GenericManager)
> applicationContext.getBean("personManager");
>
>
>
>
>
>         // add a test person to the database
>
>
>
>         Person person = new Person();
>
>         person.setFirstName("Jack");
>
>
>
>         person.setLastName("Raible");
>
>
>
>         personManager.save(person);
>
> }
>
>
>
> chinofish


-- 
http://raibledesigns.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to