Issue Details (XML | Word | Printable)

Key: JDO-155
Type: Test Test
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Craig Russell
Reporter: Craig Russell
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
JDO

Add tests for InstanceLifeCycleEvents

Created: 02/Oct/05 10:38 PM   Updated: 17/Oct/05 01:19 PM
Return to search
Component/s: tck2
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works testlistener.patch 2005-10-12 04:11 AM Craig Russell 35 kB

Resolution Date: 17/Oct/05 01:19 PM


 Description  « Hide
A12.15-1 through A12.15-14 can all use the same test class, using different test methods.

A private class that implements the life cycle listener interface is registered with the persistence manager and keeps track of the life cycle event callbacks and the instance parameters of the callbacks.

The test method registers the life cycle event listener, makes persistence manager calls and checks that the life cycle event listener was called. Finally, the listener is unregistered.


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Craig Russell added a comment - 12/Oct/05 04:11 AM
Here are the first few tests plus the test framework. The callbacks for clear, create, and delete are implemented.

Craig Russell added a comment - 14/Oct/05 09:30 AM
As part of this set of test cases, we need to integrate three pieces of test code, all of which are intimately connected and not used elsewhere:

1. The test case known to JUnit
2. The listener that is registered with the persistence manager
3. The persistence capable (and detachable) class

I propose to combine all three parts of code into the test case itself. This means that the listener and persistence capable classes are static inner classes of the test case. This works well for these tests, because there is only one .java file that contains all of the functionality needed by the test case.

Of course, each persistence capable class needs to be mapped to the database, and I propose to create a table, an entry in each of the the two .jdo files, and an entry in each of the two .orm files for each of these. It would be slightly more convenient to have a common abstract base persistence capable class that is extended by each purpose-built persistence capable class, but as we are not testing inheritance here I propose to use a class per usage with no inheritance.


Craig Russell added a comment - 17/Oct/05 01:19 PM
325833 adds test cases, .jdo files, .orm files, and schema files.
325837 adds tests to alltests.conf