db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Jdo Wiki] Update of "TechnologyCompatibilityKit" by MichelleCaisse
Date Thu, 26 May 2005 15:27:47 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Jdo Wiki" for change notification.

The following page has been changed by MichelleCaisse:

The comment on the change is:
Info on coding cleanup in tests

  == Cleanup ==
- Every test must delete all persisted objects from the data store.
- <Instructions for how to do that here.>
+ Each test in the TCK must leave the datastore clean when it exits.
+ 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 cleanup:
+  *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.
  = TCK ToDo =
  This is the list of tasks required to complete the JDO 2.0 TCK.
   ||Activity wiki page||Description||Who||Expected Completion Date||
   ||TestRunner||Modify the JUnit test runner program so that the same TCK tests can be run
in multiple configurations. For example, the same TCK test program needs to be run with and
without security turned on, and with Application Identity and Datastore Identity. When we
add different mappings for Chapter 18 (ORM) tests, the same test will need to be run with
security, identity, and different mappings.||Michael Bouschen||?/05||

View raw message