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: Patch for JDO-48
Date Thu, 26 May 2005 13:56:42 GMT
Hi Michelle,

what do I have to do to edit that page. I can see the subsection 
"Cleanup" but it seems I do not have permission to change it.

Below you find a proposal for "Cleanup" description:

The TCK uses the JUnit testing framework. JUnit encourages test classes 
to separate the real task to be tested from testing environment setup, 
relatively testing environment cleanup. TCK classes follow this 
implementation strategy.

For this reason, all TCK test classes extend abstract class 
"org.apache.jdo.tck.JDO_Test". This class provides two hooks that 
subclasses may override for test environment setup and test environment 

     protected void localSetUp()
     protected void localTearDown()

TCK classes usually set up persistent data in method "localSetUp" and 
they cleanup that that data in method "localTearDown". The real testing 
tasks are implemented in methods having the prefix "test".

Class JDO_Test implements a default strategy for "localTearDown": All 
persistent data that has been added for tear down is cleaned up 
automatically. Thus, TCK classes usually do not override "localTearDown".

JDO_Test defines three methods adding persistent data for tear down:

     protected void addTearDownObjectId(Object oid)
     protected void addTearDownInstance(Object pc)
     protected void addTearDownClass(Class pcClass)

The first two methods may be used to add single persistent instances for 
tear down. Method "addTearDownInstance" is convenience delegating to 
addTearDownObjectId. The last method may be used to add persistent 
classes for tear down. In the latter case, the extents of all added 
classes are deleted.

*Note*: The order of adding tear down instances and classes is 
significant. The default implementation of "localTearDown" first deletes 
  all added instances in exactly that order they have been added. 
Afterwards it deletes the extents of all classes in exactly that order 
they have been added.


> Hi, Michael,
> When you get a chance, could you please add information on how to code 
> cleanup in a test to the TechnologyCompatibilityKit Wiki page 
> http://wiki.apache.org/jdo/TechnologyCompatibilityKit?  I added a 
> section called "Test Development Guidlines" and a subsection called 
> "Cleanup".
> Thanks,
> Michelle
> Michael Watzek wrote:
>> Hi,
>> attached you find the patch for JDO-48.
> ...

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/

View raw message