db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Watzek <mwa.t...@spree.de>
Subject Re: Cleanup in models.fieldtypes.Test*.java
Date Thu, 22 Sep 2005 09:58:00 GMT
Hi Michelle,

the query tests implement the same strategy: They call method 
'QueryTest.cleanupDatabaseInternal' which calls 'pm.deletePersistent'. 
Thus, TCK property 'jdo.tck.cleanupaftertest' does not apply for those 
tests. We have to adapt them also.

The finally block below is fine.

Regards,
Michael

> Hi,
> 
> I've noticed that the fieldtypes tests, all created on the same pattern, 
> delete the persistent instance that they create at the end of the test.  
> (For example, 
> http://svn.apache.org/viewcvs.cgi/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/models/fieldtypes/TestFieldsOfPrimitiveboolean.java?view=markup)

> Now that we use the new cleanup mechanism (addTearDownClass(Class)), 
> there doesn't seem to be any point to deleting the instance.  Also, the 
> new maven option jdo.tck.cleanupaftertest cannot override this cleanup, 
> so you can never see the database contents for debugging.  Therefore, I 
> think we should remove the line that deletes the persistent instance.
> 
> What about the finally block in these tests?
> finally {
>            if ((tx != null) && tx.isActive())
>                tx.rollback();
>        }
> We don't do this in our sample test 
> (http://wiki.apache.org/jdo/SampleTest), which is supposed to be a model 
> of excellence.  Is it a good idea or not?
> 
> -- Michelle


-- 
-------------------------------------------------------------------
Michael Watzek                  Tech@Spree Engineering GmbH
mailto:mwa.tech@spree.de        Buelowstr. 66
Tel.:  ++49/30/235 520 36       10783 Berlin - Germany
Fax.:  ++49/30/217 520 12       http://www.spree.de/
-------------------------------------------------------------------

Mime
View raw message