Why don't you want them to rollback? If you're going to manually check
your database to see if it worked - that's not a very good way to
test.

Yes, you can use setComplete() to force a commit w/o a rollback, but
you should automate the testing and use jdbcTemplate.queryForObject()
- or something like that - to check for existing of the record in your
database before its rolled back.

Matt

On Nov 14, 2007 8:12 AM, Campa <[EMAIL PROTECTED]> wrote:
>
>
> mraible wrote:
> >
> > There's a jdbcTemplate available for you to query the database with.
> > Matt
> >
>
> Thx Matt,
>
> Can I do it without go down on jdbcTemplate using only GenericManagers or
> its extensions ?
> Here a trace of my code:
>
> public class AnamnesiTest extends BaseDaoTestCase{
>    public void testSave() {
>         GenericManager<StrutturaPsichiatricha, Long> 
> strutturaPsichiatrichaManager
> =  (GenericManager<StrutturaPsichiatricha, Long>)
> applicationContext.getBean("strutturaPsichiatrichaManager");
>
> ...
>         StrutturaPsichiatricha sp = new StrutturaPsichiatricha();
>                         sp = strutturaPsichiatrichaManager.save(sp);
> ...
>
> After the test execution the framework rollback all...
> Can I disable the rollback for the unittests ?
>
>
>
> --
> View this message in context: 
> http://www.nabble.com/UnitTests-HowTo-Commit-tf4804294s2369.html#a13748544
>
> Sent from the AppFuse - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



-- 
http://raibledesigns.com

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

Reply via email to