3. Write test cases for assertions here for single field identity. Add a new property so JDO_Test can tell whether the test is being run for application identity and return without running the test if in datastore identity, similar to unsupported option. Like isRunningDatastoreIdentity and isRunningApplicationIdentity.
A7.12-38 [For classes using single field identity, this method must be called on a persistent instance with its primary key field initialized (not null), or a JDOFatalInternalException is thrown.]
api.persistencecapable.NewObjectIdInstance testSingleFieldIdentityNotIntializedInteger
api.persistencecapable.NewObjectIdInstance testSingleFieldIdentityNotIntializedShort
api.persistencecapable.NewObjectIdInstance testSingleFieldIdentityNotIntializedLong
api.persistencecapable.NewObjectIdInstance testSingleFieldIdentityNotIntializedCharacter
api.persistencecapable.NewObjectIdInstance testSingleFieldIdentityNotIntializedByte
api.persistencecapable.NewObjectIdInstance testSingleFieldIdentityNotIntializedString
A7.12-39 [The instance returned is initialized with the value of the primary key field of the instance on which the method is called.]
api.persistencecapable.NewObjectIdInstance testSingleFieldIdentityInitializedint
api.persistencecapable.NewObjectIdInstance testSingleFieldIdentityInitializedInteger
api.persistencecapable.NewObjectIdInstance testSingleFieldIdentityInitializedshort
api.persistencecapable.NewObjectIdInstance testSingleFieldIdentityInitializedShort
api.persistencecapable.NewObjectIdInstance testSingleFieldIdentityInitializedlong
api.persistencecapable.NewObjectIdInstance testSingleFieldIdentityInitializedLong
api.persistencecapable.NewObjectIdInstance testSingleFieldIdentityInitializedchar
api.persistencecapable.NewObjectIdInstance testSingleFieldIdentityInitializedCharacter
api.persistencecapable.NewObjectIdInstance testSingleFieldIdentityInitializedbyte
api.persistencecapable.NewObjectIdInstance testSingleFieldIdentityInitializedByte
api.persistencecapable.NewObjectIdInstance testSingleFieldIdentityInitializedString
A7.12-25 [public void jdoCopyKeyFieldsFromObjectId(ObjectIdFieldConsumer fc, Object oid);
This method copies fields to the field manager instance from the second parameter instance.
api.persistencecapable.CopyKeyFieldsFromObjectId testSingleFieldIdentity times 11!
You will need new classes and .jdo files for single field identity. Copy pc.mylib.PCPoint from application identity but redefine it to use SFI and call them pc.singlefieldidentity.PCPointSingleFieldint
pc.singlefieldidentity.PCPointSingleFieldInteger
pc.singlefieldidentity.PCPointSingleFieldshort
pc.singlefieldidentity.PCPointSingleFieldShort
pc.singlefieldidentity.PCPointSingleFieldlong
pc.singlefieldidentity.PCPointSingleFieldLong
pc.singlefieldidentity.PCPointSingleFieldchar
pc.singlefieldidentity.PCPointSingleFieldCharacter
pc.singlefieldidentity.PCPointSingleFieldbyte
pc.singlefieldidentity.PCPointSingleFieldByte
pc.singlefieldidentity.PCPointSingleFieldString
4. Update existing tests or write new tests for JDO 2 JDOHelper 8.6:
A8.6-13 [public static
PersistenceManagerFactory getPersistenceManagerFactory
(File file);]
A8.6-14 [public static
PersistenceManagerFactory getPersistenceManagerFactory
(File file, ClassLoader loader);]
A8.6-15 [public static
PersistenceManagerFactory getPersistenceManagerFactory
(String resourceName);]
A8.6-16 [public static
PersistenceManagerFactory getPersistenceManagerFactory
(String resourceName, ClassLoader loader);]
A8.6-17 [public static
PersistenceManagerFactory getPersistenceManagerFactory
(InputStream stream);]
A8.6-18 [public static
PersistenceManagerFactory getPersistenceManagerFactory
(InputStream stream, ClassLoader loader);] These methods use the parameter(s) passed as arguments to construct a Properties instance, and then delegate to the static method getPersistenceManagerFactory in the class named in the property javax.jdo.PersistenceManagerFactoryClass. If there are any exceptions while trying to construct the Properties instance or to call the static method, then either A8.6-4 [JDOFatalUserException] or A8.6-5 [JDOFatalInternalException is thrown], depending on whether the exception is due to the user or the implementation. The nested exception indicates the cause of the exception.
api.persistencemanagerfactory.GetPMFByFile
api.persistencemanagerfactory.GetPMFByFileAndClassLoader
api.persistencemanagerfactory.GetPMFByResource
api.persistencemanagerfactory.GetPMFByResourceAndClassLoader
api.persistencemanagerfactory.GetPMFByStream
api.persistencemanagerfactory.GetPMFByStreamAndClassLoader
These test classes might use the properties that are already configured to construct the File, Resource, and Stream objects for the test (to make sure that the properties are valid for the PMF under test).
If you run out of work to do, please ask Michelle for her advice.
Craig Russell
P.S. A good JDO? O, Gasp!