Issue Details (XML | Word | Printable)

Key: JDO-141
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 getObjectsById tests

Created: 21/Sep/05 09:29 AM   Updated: 27/Mar/06 02:41 AM
Return to search
Component/s: tck2
Affects Version/s: JDO 2 beta
Fix Version/s: JDO 2 final

Time Tracking:
Not Specified

Environment: TCK

Resolution Date: 21/Mar/06 07:20 AM


 Description  « Hide
12.5.6-17 [Collection getObjectsById (Collection oids); Object[] getObjectsById (Object[] oids); Collection getObjectsById (Collection oids, boolean validate); Object[] getObjectsById (Object[] oids, boolean validate); The getObjectsById method attempts to find instances in the cache with the specified JDO identities. The elements of the oids parameter object might have been returned by earlier calls to getObjectId or getTransactionalObjectId, or might have been constructed by the application. If a method with no validate parameter is used, the method behaves exactly as the correspond ing method with the validate flag set to true. If the Object[] form of the method is used, the returned objects correspond by position with the object ids in the oids parameter. If the Collection form of the method is used, the iterator over the returned Collection returns instances in the same order as the oids returned by an iterator over the parameter Collection. The cardinality of the return value is the same as the cardinality of the oids parameter. ]

The test case api.persistencemanager.GetObjectsById needs a test method per API per validate parameter, or six altogether. testCollection, testArray, testCollectionValidateTrue, testCollectionValidateFalse, testArrayValidateTrue, testArrayValidateFalse.

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 cases getObjectsById and verify that the objects returned match the objects that are in the object list.

There are no negative tests.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Craig Russell added a comment - 21/Mar/06 07:20 AM
svn commit -m "JDO-141 Added getObjectsById tests" src/java/org/apache/jdo/tck/api/persistencemanager/getobject/GetObjectsById.java src/conf/pm.conf
Sending src/conf/pm.conf
Adding src/java/org/apache/jdo/tck/api/persistencemanager/getobject/GetObjectsById.java
Transmitting file data ..
Committed revision 387340.

Michelle Caisse added a comment - 27/Mar/06 02:41 AM
Added assertion to spreadsheet.