Issue Details (XML | Word | Printable)

Key: JDO-188
Type: Test Test
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

Add tests for static JDOHelper.getObjectIds methods

Created: 19/Oct/05 06:42 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

File Attachments:
  Size
Text File Licensed for inclusion in ASF works jdo-188.patch 2005-10-31 02:08 PM Craig Russell 9 kB
Text File Licensed for inclusion in ASF works jdo-188.patch 2005-10-29 11:55 PM Craig Russell 8 kB
Environment: TCK

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


 Description  « Hide
A8.3-11 [static Object[] getObjectIds (Object[] pcs); static Collection getObjectIds (Collection pcs); These methods return the JDO identities of the parameter instances. For each instance in the parameter, the getObjectId method is called. They return one identity instance for each persistence-capable instance in the parameter. The order of iteration of the returned Collection exactly matches the order of iteration of the parameter Collection].

The test case api.persistencemanager.GetObjectIds needs a test method per API.

The setUp method creates 50 persistent instances of type PCPoint and stores the ids in an ArrayList and the instances in a separate ArrayList. The test case call getObjectIds and verify that the object ids returned match the objects ids that are in the list.

There are no negative tests.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
karan singh malhi added a comment - 23/Oct/05 01:32 AM
The test case api.persistencemanager.GetObjectIds needs a test method per API.

Should'nt the above be api.jdohelper.GetObjectIds

Craig Russell added a comment - 27/Oct/05 05:03 PM
You are right.

The new methods are indeed in JDOHelper not in PersistenceManager. So the test needs to be written for the JDOHelper class.

I'd propose the new test case api.jdohelper.GetObjectIds with test methods testGetObjectIdsCollection and testGetObjectIdsArray. The collection of parameter objects should include null, transient instances, and persistent instances from multiple persistence managers.

The JDOHelper checked into the repository does not include the new methods, so as part of this work the methods need to be added.

Craig Russell added a comment - 29/Oct/05 11:55 PM
Please review this patch for JDOHelper.java and GetObjectIds.java.

The patch has been tested against the latest JPOX build.

Craig Russell made changes - 29/Oct/05 11:55 PM
Field Original Value New Value
Attachment jdo-188.patch [ 12320394 ]
Craig Russell made changes - 29/Oct/05 11:55 PM
Assignee Craig Russell [ clr ]
Michael Bouschen added a comment - 30/Oct/05 01:34 AM
The patch looks good.

Just one remark: the localSetUp method creates a second PM which is not closed in the test case. Should we add a localTearDown method coling this PM?

Craig Russell added a comment - 31/Oct/05 02:08 PM
This patch includes comments from Michael (thanks, I missed the cleanup of the second PM), an update to the alltests.conf, and a slightly different implementation of JDOHelper.getObjectIds(Object[ ]).

I plan to check it in tomorrow.

Craig Russell made changes - 31/Oct/05 02:08 PM
Attachment jdo-188.patch [ 12320401 ]
Repository Revision Date User Message
ASF #329926 Mon Oct 31 23:04:30 UTC 2005 clr JDO-188 Added tests for getObjectIds
Files Changed
MODIFY /incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/instancecallbacks/AbstractInstanceLifecycleListener.java
MODIFY /incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/instancecallbacks/InstanceLifecycleListenerStore.java
MODIFY /incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/instancecallbacks/InstanceLifecycleListenerDelete.java
MODIFY /incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/instancecallbacks/InstanceLifecycleListenerClear.java
MODIFY /incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/instancecallbacks/InstanceLifecycleListenerLoad.java
MODIFY /incubator/jdo/trunk/api20/src/java/javax/jdo/JDOHelper.java
MODIFY /incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/instancecallbacks/InstanceLifecycleListenerAttach.java
MODIFY /incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/instancecallbacks/InstanceLifecycleListenerDetach.java
MODIFY /incubator/jdo/trunk/tck20/test/conf/alltests.conf

Repository Revision Date User Message
ASF #329927 Mon Oct 31 23:06:12 UTC 2005 clr JDO-188 Added test for JDOHelper.getObjectIds
Files Changed
ADD /incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/jdohelper/GetObjectIds.java

Craig Russell added a comment - 01/Nov/05 08:10 AM
Added tests for JDOHelper.getObjectIds

Committed revision 329926, accidentally including patch for instancecallbacks teardown.
 Committed revision 329927.

Craig Russell made changes - 01/Nov/05 08:10 AM
Resolution Fixed [ 1 ]
Status Open [ 1 ] 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
Resolution Fixed [ 1 ]
Status Closed [ 6 ] Reopened [ 4 ]
Michael Bouschen made changes - 23/Apr/06 03:10 AM
Status Reopened [ 4 ] Closed [ 6 ]
Fix Version/s JDO 2 beta [ 12310683 ]
Resolution Fixed [ 1 ]