Issue Details (XML | Word | Printable)

Key: JDO-187
Type: Bug Bug
Status: Closed Closed
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

Detach lifecycle listeners are incorrectly implemented

Created: 18/Oct/05 06:04 AM   Updated: 23/Apr/06 03:10 AM
Return to search
Component/s: tck2
Affects Version/s: None
Fix Version/s: JDO 2 beta

Time Tracking:
Not Specified

Environment: JPOX

Resolution Date: 23/Apr/06 03:10 AM


 Description  « Hide
The following errors are reported for test case InstanceLifecycleListenerDetach.

    [java] testDetach(org.apache.jdo.tck.api.instancecallbacks.InstanceLifecycleListenerDetach)junit.framework.AssertionFailedError: Assertion A12.15-11 (TestInstanceLifecycleListener) failed:
    [java] Assertion A12.15-12 (TestInstanceLifecycleListener) failed: in postDetach, target expected <org.apache.jdo.tck.api.instancecallbacks.InstanceLifecycleListenerDetach$PC@2897ac>, actual <null>
    [java] Assertion A12.15-12 (TestInstanceLifecycleListener) failed: in postDetach, target object should be persistent.
    [java] Assertion A12.15-12 (TestInstanceLifecycleListener) failed: in postDetach, source wasPostDetachCalled() was not true.
    [java]
    [java] Sequence verification failed for PRE_DETACH_LISTENER; expected: <1> actual: <2>
    [java]
    [java] Sequence verification failed for PRE_DETACH_CALLBACK; expected: <2> actual: <1>
    [java]
    [java] at org.apache.jdo.tck.api.instancecallbacks.AbstractInstanceLifecycleListener$InstanceLifecycleListenerImpl.verifyCallbacks(AbstractInstanceLifecycleListener.java:464)
    [java] at org.apache.jdo.tck.api.instancecallbacks.InstanceLifecycleListenerDetach.testDetach(InstanceLifecycleListenerDetach.java:108)
    [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    [java] at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:204)
    [java] at org.apache.jdo.tck.util.BatchTestRunner.start(BatchTestRunner.java:120)
    [java] at org.apache.jdo.tck.util.BatchTestRunner.main(BatchTestRunner.java:95)


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Craig Russell added a comment - 19/Oct/05 12:54 AM
This appears to be a JPOX bug.

Craig Russell made changes - 19/Oct/05 12:54 AM
Field Original Value New Value
Assignee Andy Jefferson [ ajsoft ]
Andy Jefferson added a comment - 22/Oct/05 04:52 PM
Actually was an issue in InstanceCallbacks and not InstanceLifecycleListener. JPOX CVS now uses the objects the other way around on the postDetach and that part of the test passes. The issue about

    [java] Sequence verification failed for PRE_DETACH_LISTENER; expected: <1> actual: <2>
    [java]
    [java] Sequence verification failed for PRE_DETACH_CALLBACK; expected: <2> actual: <1>
    [java]

remains. This is down to the TCK test making the assumption that the callback will appear before the lifecycle listener. Where is this specifed in the JDO2 spec ? If there's no reference in the spec then it can't be imposed in the TCK.

Andy Jefferson made changes - 22/Oct/05 04:53 PM
Assignee Andy Jefferson [ ajsoft ] Craig Russell [ clr ]
Andy Jefferson added a comment - 23/Oct/05 05:19 AM
JPOX CVS is now updated to match Craigs' proposed spec change

<proposed>
package javax.jdo.listener;
public interface DetachLifecycleListener
     extends InstanceLifecycleListener {
A12.15-11 [void preDetach(InstanceLifecycleEvent event);
}
This method is called before a persistent instance is copied for
detachment.] It is called before the jdoPreDetach callback.

A12.15-12 [void postDetach(InstanceLifecycleEvent event);
}
This method is called whenever a persistent instance is copied for
detachment. The source instance is the detached copy; the target
instance is the persistent instance. It is called after the
jdoPostDetach callback on the detached copy.]
</proposed>

and the test now passes

Andy Jefferson made changes - 23/Oct/05 05:19 AM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
Craig Russell added a comment - 25/Oct/05 12:11 AM
The latest JPOX snapshot fixes the issue.

Craig Russell made changes - 25/Oct/05 12:11 AM
Status Resolved [ 5 ] Closed [ 6 ]
Michael Bouschen added a comment - 23/Apr/06 03:08 AM
Reopened to set the Fix Version/s field to JDO 2 beta.

Michael Bouschen made changes - 23/Apr/06 03:08 AM
Status Closed [ 6 ] Reopened [ 4 ]
Resolution Fixed [ 1 ]
Michael Bouschen made changes - 23/Apr/06 03:10 AM
Status Reopened [ 4 ] Closed [ 6 ]
Resolution Fixed [ 1 ]
Fix Version/s JDO 2 beta [ 12310683 ]