db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig Russell (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JDO-155) Add tests for InstanceLifeCycleEvents
Date Fri, 14 Oct 2005 00:32:06 GMT
    [ http://issues.apache.org/jira/browse/JDO-155?page=comments#action_12332051 ] 

Craig Russell commented on JDO-155:

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.

> Add tests for InstanceLifeCycleEvents
> -------------------------------------
>          Key: JDO-155
>          URL: http://issues.apache.org/jira/browse/JDO-155
>      Project: JDO
>         Type: Test
>   Components: tck20
>     Reporter: Craig Russell
>     Assignee: Craig Russell
>  Attachments: testlistener.patch
> 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.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message