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 made changes - 12/Oct/05 04:11 AM
Field Original Value New Value
Attachment testlistener.patch [ 12314828 ]
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.


Repository Revision Date User Message
ASF #325833 Mon Oct 17 03:29:07 UTC 2005 clr JDO-155 Add lifecycle tests
Files Changed
ADD /incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/instancecallbacks/AbstractInstanceLifecycleListener.java
MODIFY /incubator/jdo/trunk/tck20/test/sql/derby/applicationidentity/schema.sql
ADD /incubator/jdo/trunk/tck20/test/jdo/datastoreidentity/org/apache/jdo/tck/api
ADD /incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/instancecallbacks/InstanceLifecycleListenerStore.java
ADD /incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/instancecallbacks/InstanceLifecycleListenerCreate.java
ADD /incubator/jdo/trunk/tck20/test/orm/datastoreidentity/org/apache/jdo/tck/api/instancecallbacks/package-derby.orm
ADD /incubator/jdo/trunk/tck20/test/jdo/applicationidentity/org/apache/jdo/tck/api
ADD /incubator/jdo/trunk/tck20/test/jdo/datastoreidentity/org/apache/jdo/tck/api/instancecallbacks/package.jdo
ADD /incubator/jdo/trunk/tck20/test/jdo/datastoreidentity/org/apache/jdo/tck/api/instancecallbacks
ADD /incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/instancecallbacks/InstanceLifecycleListenerDetach.java
ADD /incubator/jdo/trunk/tck20/test/orm/applicationidentity/org/apache/jdo/tck/api/instancecallbacks/package-derby.orm
ADD /incubator/jdo/trunk/tck20/test/orm/datastoreidentity/org/apache/jdo/tck/api
MODIFY /incubator/jdo/trunk/tck20/maven.xml
MODIFY /incubator/jdo/trunk/tck20/project.properties
ADD /incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/instancecallbacks/InstanceLifecycleListenerDirty.java
ADD /incubator/jdo/trunk/tck20/test/jdo/applicationidentity/org/apache/jdo/tck/api/instancecallbacks/package.jdo
ADD /incubator/jdo/trunk/tck20/test/jdo/applicationidentity/org/apache/jdo/tck/api/instancecallbacks
ADD /incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/instancecallbacks/InstanceLifecycleListenerDelete.java
ADD /incubator/jdo/trunk/tck20/test/orm/applicationidentity/org/apache/jdo/tck/api
ADD /incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/instancecallbacks/InstanceLifecycleListenerClear.java
ADD /incubator/jdo/trunk/tck20/test/orm/datastoreidentity/org/apache/jdo/tck/api/instancecallbacks
ADD /incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/instancecallbacks/InstanceLifecycleListenerLoad.java
ADD /incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/instancecallbacks/InstanceLifecycleListenerAttach.java
MODIFY /incubator/jdo/trunk/tck20/test/sql/derby/datastoreidentity/schema.sql
ADD /incubator/jdo/trunk/tck20/test/orm/applicationidentity/org/apache/jdo/tck/api/instancecallbacks

Repository Revision Date User Message
ASF #325837 Mon Oct 17 04:14:40 UTC 2005 clr JDO-155 added listener tests
Files Changed
MODIFY /incubator/jdo/trunk/tck20/test/conf/alltests.conf

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

Craig Russell made changes - 17/Oct/05 01:19 PM
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]