org.apache.jdo.tck
Class JDO_Test

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byorg.apache.jdo.tck.JDO_Test
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
AbstractFetchPlanTest, org.apache.jdo.tck.api.persistencemanagerfactory.AbstractGetPMF, AbstractInstanceLifecycleListener, org.apache.jdo.tck.api.persistencecapable.AbstractPersistenceCapableTest, AfterCloseGetPMThrowsException, AfterCloseSetMethodsThrowException, AfterCompletionMethodCalledWhenCommitted, AfterCompletionMethodCalledWhenRolledback, AfterGetPersistenceManagerNoSetMethodsSucceed, AfterSetRollbackOnlyCommitFails, BeforeCompletionMethodCalled, BeforeCompletionMethodNotCalledBeforeRollback, CallingJdoPostload, CallingJdoPredelete, CallingJdoPrestore, Close, CloseFailsIfTransactionActive, CloseWithoutPermissionThrowsSecurityException, Commit, ComparisonTests, CompletenessTest, ConcurrentPersistenceManagers, DetachTest, EnhancerTest, org.apache.jdo.tck.extents.ExtentTest, FetchPlanInterface, GetObjectId, GetObjectIdForNull, GetObjectIdForTransient, GetObjectIdNotPersistenceCapable, GetObjectIds, GetObjectsById, GetPersistenceManager, GetPersistenceManager, GetPersistenceManager, GetPersistenceManagerFactoryByPropertiesInstance, GetPersistenceManagerForNull, GetPersistenceManagerForTransient, GetPersistenceManagerForUser, GetPersistenceManagerNotPersistenceCapable, GetProperties, GetPutRemoveUserObject, GetRetainValues, GetRollbackOnlyReturnsFalseUntilSet, GetSynchronization, GetTransactionalObjectId, GetTransactionalObjectIdForNull, GetTransactionalObjectIdForTransient, GetTransactionalObjectIdNotPersistenceCapable, HollowInstanceMaintainsPK, IsActive, IsActiveUntilAfterCompletionMethodCalled, IsDeleted, IsDeletedFalse, IsDeletedForNull, IsDeletedForTransient, IsDeletedNotPersistenceCapable, IsDirty, IsDirtyFalse, IsDirtyForNull, IsDirtyForTransient, IsDirtyNotPersistenceCapable, IsNew, IsNewFalse, IsNewForNull, IsNewForTransient, IsNewNotPersistenceCapable, IsPersistent, IsPersistentFalse, IsPersistentForNull, IsPersistentForTransient, IsPersistentNotPersistenceCapable, IsTransactional, IsTransactionalFalse, IsTransactionalForNull, IsTransactionalForTransient, IsTransactionalNotPersistenceCapable, MakeDirty, MakeDirtyForNull, MakeDirtyForTransient, MakeDirtyNotPersistenceCapable, ModificationOfNontransactionalNonpersistentFields, MultiplePMsReturnInstancesRepresentingSamePC, NoAccessToFieldsAfterPredelete, NontransactionalWriteTest, NoPersistenceManagerIfTransient, ObjectIdNotModifiedWhenObjectIdInstanceModified, OnePersistenceManagerIfPersistentOrTransactional, PersistenceManagerTest, PMReturnsIdenticalInstancesForEqualObjIds, PMsCanSharePCClassesButNotPCInstances, QueryTest, Rollback, SameTransactionInstanceForAllCallsToCurrentTransaction, SecondClassObjectsTrackTheirChanges, SetConnectionPassword, SetConnectionURL, SetConnectionUserName, SetIgnoreCache, SetMultithreaded, SetNontransactionalRead, SetNonTransactionalRead, SetNontransactionalReadCalledDuringTxCompletion, SetNontransactionalReadTrueWhenNotSupported, SetNonTransactionalWrite, SetNontransactionalWriteCalledDuringTxCompletion, SetOptimistic, SetOptimistic, SetOptimisticCalledDuringTxCompletion, SetOptimisticDuringTransaction, SetOptimisticTrueWhenNotSupported, SetRetainValues, SetRetainValues, SetRetainValuesCalledDuringTxCompletion, SetRetainValuesTrueWhenNotSupported, SetSynchronization, SetSynchronizationToNull, SignatureTest, StateTransitions, StateTransitionsReturnedObjects, SupportedOptions, TestArrayCollections, TestArrayListCollections, TestCollectionCollections, TestFieldsOfBigDecimal, TestFieldsOfBigInteger, TestFieldsOfBoolean, TestFieldsOfByte, TestFieldsOfCharacter, TestFieldsOfDate, TestFieldsOfDouble, TestFieldsOfFloat, TestFieldsOfInteger, TestFieldsOfLocale, TestFieldsOfLong, TestFieldsOfObject, TestFieldsOfPrimitiveboolean, TestFieldsOfPrimitivebyte, TestFieldsOfPrimitivechar, TestFieldsOfPrimitivedouble, TestFieldsOfPrimitivefloat, TestFieldsOfPrimitiveint, TestFieldsOfPrimitivelong, TestFieldsOfPrimitiveshort, TestFieldsOfShort, TestFieldsOfSimpleClass, TestFieldsOfSimpleInterface, TestFieldsOfString, TestHashMapStringKeyCollections, TestHashMapStringValueCollections, TestHashSetCollections, TestHashtableStringKeyCollections, TestHashtableStringValueCollections, TestLinkedListCollections, TestListCollections, TestMapStringKeyCollections, TestMapStringValueCollections, TestParts, TestParts, TestSetCollections, TestTreeMapStringKeyCollections, TestTreeMapStringValueCollections, TestTreeSetCollections, TestVectorCollections, TransientTransactionalStateCommit, TransientTransactionalStateRollback, WhenNontransactionalReadIsFalse

public abstract class JDO_Test
extends junit.framework.TestCase


Field Summary
static java.lang.String APPLICATION_IDENTITY
          identitytype value for applicationidentity.
protected static boolean cleanupData
          Flag indicating whether to clean up data after tests or not.
protected static boolean closePMFAfterEachTest
          Flag indicating whether to close the PMF after each test or not.
static java.lang.String DATASTORE_IDENTITY
          identitytype value for datastoreidentity.
protected  boolean debug
          true if debug logging in enabled.
static int DETACHED_CLEAN
           
static int DETACHED_DIRTY
           
static int HOLLOW
           
protected  java.lang.String identitytype
          String indicating the type of identity used for the current test case.
static int ILLEGAL_STATE
           
protected  org.apache.commons.logging.Log logger
          Logger
protected static java.lang.StringBuffer messages
          A buffer of of error messages.
static java.lang.String NL
          New line.
static int NUM_STATES
           
static int PERSISTENT_CLEAN
           
static int PERSISTENT_DELETED
           
static int PERSISTENT_DIRTY
           
static int PERSISTENT_NEW
           
static int PERSISTENT_NEW_DELETED
           
static int PERSISTENT_NONTRANSACTIONAL
           
static int PERSISTENT_NONTRANSACTIONAL_DIRTY
           
protected  javax.jdo.PersistenceManager pm
          The PersistenceManager.
protected static javax.jdo.PersistenceManagerFactory pmf
          The PersistenceManagerFactory.
protected static java.lang.String PMFProperties
          Name of the file containing the properties for the PMF.
protected static java.util.Properties PMFPropertiesObject
          The Properties object for the PersistenceManagerFactory.
static java.lang.String[] states
           
protected  boolean testSucceeded
           
static int TRANSIENT
           
static int TRANSIENT_CLEAN
           
static int TRANSIENT_DIRTY
           
 
Constructor Summary
JDO_Test()
           
 
Method Summary
protected  void addTearDownClass(java.lang.Class pcClass)
           
protected  void addTearDownClass(java.lang.Class[] pcClasses)
           
protected  void addTearDownInstance(java.lang.Object pc)
           
protected  void addTearDownObjectId(java.lang.Object oid)
           
protected static void appendMessage(java.lang.String message)
          Appends to error messages.
protected  void cleanupPM()
          This method cleans up the environment: closes the PersistenceManager.
protected static void cleanupPM(javax.jdo.PersistenceManager pm)
          This method cleans up the specified PersistenceManager.
static void closePMF()
          Closes the pmf stored in this instance.
static boolean compareStates(int found_state, int expected_state)
          Tests if a found state matches an expected state.
static int currentState(java.lang.Object o)
          This method will return the current lifecycle state of an instance.
protected  void deleteTearDownClasses()
          Deletes and removes tear down classes.
protected  void deleteTearDownInstances()
          Deletes and removes tear down instances.
static void dumpSupportedOptions(java.lang.String directory)
          Dump the supportedOptions to the a file in the specified directory.
 void fail(java.lang.String assertionFailure, java.lang.String msg)
          Prints the specified msg (if debug is true), before it aborts the test case.
protected  void failOnError()
          Fail the test if there are any error messages.
protected  java.util.Collection getAllObjects(javax.jdo.PersistenceManager pm, java.lang.Class pcClass)
           
protected static javax.jdo.PersistenceManager[] getFailedPersistenceManagers(java.lang.String assertionFailure, javax.jdo.JDOException ex)
           
protected  java.lang.reflect.Field[] getModifiableFields(java.lang.Object obj)
          Returns modifiable Fields of the class of the parameter.
protected  javax.jdo.PersistenceManager getPM()
          Get the PersistenceManager instance for the implementation under test.
protected  javax.jdo.PersistenceManagerFactory getPMF()
          Get the PersistenceManagerFactory instance for the implementation under test.
protected  java.lang.String getPMFProperty(java.lang.String key)
          Returns the value of the PMF property given by argument key.
static java.lang.String getStateOfInstance(java.lang.Object o)
          This utility method returns a String that indicates the current state of an instance.
 boolean isApplicationIdentitySupported()
          Reports whether Application Identity is supported.
 boolean isArrayListSupported()
          Reports whether an ArrayList collection is supported.
 boolean isArraySupported()
          Reports whether arrays are supported.
 boolean isBinaryCompatibilitySupported()
          Reports whether Binary Compatibility is supported.
 boolean isChangeApplicationIdentitySupported()
          Reports whether Changing Application Identity is supported.
static boolean isClassLoadable(java.lang.String className)
          Determine if a class is loadable in the current environment.
 boolean isDataStoreConnectionSupported()
          Reports whether getting the DataStoreConnection is supported.
 boolean isDatastoreIdentitySupported()
          Reports whether Datastore Identity is supported.
 boolean isHashMapSupported()
          Reports whether a HashMap collection is supported.
 boolean isHashtableSupported()
          Reports whether a Hashtable collection is supported.
static boolean isJRE14orBetter()
          Determine if the environment is 1.4 version of JRE or better.
 boolean isLinkedListSupported()
          Reports whether a LinkedList collection is supported.
 boolean isListSupported()
          Reports whether a List collection is supported.
 boolean isMapSupported()
          Reports whether a Map collection is supported.
 boolean isNonDurableIdentitySupported()
          Reports whether Non-Durable Identity is supported.
 boolean isNontransactionalReadSupported()
          Reports whether NontransactionalRead is supported.
 boolean isNontransactionalWriteSupported()
          Reports whether NontransactionalWrite is supported.
 boolean isNullCollectionSupported()
          Reports whether a null collection is supported.
 boolean isOptimisticSupported()
          Reports whether Optimistic is supported.
 boolean isRetainValuesSupported()
          Reports whether RetainValues is supported.
 boolean isSQLSupported()
          Reports whether SQL queries are supported.
protected  boolean isTestToBePerformed()
          Returns true if the implementation under test supports all JDO options contained in system property jdo.tck.requiredOptions.
 boolean isTransientTransactionalSupported()
          Reports whether TransientTransactional is supported.
 boolean isTreeMapSupported()
          Reports whether a TreeMap collection is supported.
 boolean isTreeSetSupported()
          Reports whether a TreeSet collection is supported.
 boolean isUnconstrainedVariablesSupported()
          Reports whether UnconstrainedVariables is supported.
 boolean isVectorSupported()
          Reports whether a Vector collection is supported.
protected  java.util.Properties loadProperties(java.lang.String fileName)
          This method load Properties from a given file.
protected  void localSetUp()
          Subclasses may override this method to allocate any data and resources that they need in order to successfully execute this testcase.
protected  void localTearDown()
          Deletes all registered pc instances and extents of all registered pc classes.
protected  boolean mangleObject(java.lang.Object oid)
          This method mangles an object by changing all its non-static, non-final fields.
protected  void printNonApplicableIdentityType(java.lang.String testName, java.lang.String requiredIdentityType)
          Prints a message (if debug is true) saying the test with the specified name is not executed, because the JDO implementation under test is run for an inapplicable identity type.
protected  void printUnsupportedOptionalFeatureNotTested(java.lang.String testName, java.lang.String optionalFeature)
          Prints a message (if debug is true) saying the test with the specified name is not executed, because the JDO implementation under test does not support the specified optional feature.
protected static java.lang.String retrieveMessages()
          Returns collected error messages, or null if there are none, and clears the buffer.
 void runBare()
          Runs the bare test sequence.
 boolean runsWithApplicationIdentity()
          Returns true if the current test runs with application identity.
protected  void setUp()
           
protected  void tearDown()
          This method clears data and resources allocated by testcases.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TRANSIENT

public static final int TRANSIENT
See Also:
Constant Field Values

PERSISTENT_NEW

public static final int PERSISTENT_NEW
See Also:
Constant Field Values

PERSISTENT_CLEAN

public static final int PERSISTENT_CLEAN
See Also:
Constant Field Values

PERSISTENT_DIRTY

public static final int PERSISTENT_DIRTY
See Also:
Constant Field Values

HOLLOW

public static final int HOLLOW
See Also:
Constant Field Values

TRANSIENT_CLEAN

public static final int TRANSIENT_CLEAN
See Also:
Constant Field Values

TRANSIENT_DIRTY

public static final int TRANSIENT_DIRTY
See Also:
Constant Field Values

PERSISTENT_NEW_DELETED

public static final int PERSISTENT_NEW_DELETED
See Also:
Constant Field Values

PERSISTENT_DELETED

public static final int PERSISTENT_DELETED
See Also:
Constant Field Values

PERSISTENT_NONTRANSACTIONAL

public static final int PERSISTENT_NONTRANSACTIONAL
See Also:
Constant Field Values

PERSISTENT_NONTRANSACTIONAL_DIRTY

public static final int PERSISTENT_NONTRANSACTIONAL_DIRTY
See Also:
Constant Field Values

DETACHED_CLEAN

public static final int DETACHED_CLEAN
See Also:
Constant Field Values

DETACHED_DIRTY

public static final int DETACHED_DIRTY
See Also:
Constant Field Values

NUM_STATES

public static final int NUM_STATES
See Also:
Constant Field Values

ILLEGAL_STATE

public static final int ILLEGAL_STATE
See Also:
Constant Field Values

states

public static final java.lang.String[] states

APPLICATION_IDENTITY

public static final java.lang.String APPLICATION_IDENTITY
identitytype value for applicationidentity.

See Also:
Constant Field Values

DATASTORE_IDENTITY

public static final java.lang.String DATASTORE_IDENTITY
identitytype value for datastoreidentity.

See Also:
Constant Field Values

identitytype

protected final java.lang.String identitytype
String indicating the type of identity used for the current test case. The value is either "applicationidentity" or "datastoreidentity".


PMFProperties

protected static java.lang.String PMFProperties
Name of the file containing the properties for the PMF.


cleanupData

protected static boolean cleanupData
Flag indicating whether to clean up data after tests or not. If false then test will not clean up data from database. The default value is true.


closePMFAfterEachTest

protected static final boolean closePMFAfterEachTest
Flag indicating whether to close the PMF after each test or not. It defaults to false.


PMFPropertiesObject

protected static java.util.Properties PMFPropertiesObject
The Properties object for the PersistenceManagerFactory.


pmf

protected static javax.jdo.PersistenceManagerFactory pmf
The PersistenceManagerFactory.


pm

protected javax.jdo.PersistenceManager pm
The PersistenceManager.


testSucceeded

protected boolean testSucceeded

logger

protected org.apache.commons.logging.Log logger
Logger


debug

protected boolean debug
true if debug logging in enabled.


NL

public static final java.lang.String NL
New line.


messages

protected static java.lang.StringBuffer messages
A buffer of of error messages.

Constructor Detail

JDO_Test

public JDO_Test()
Method Detail

setUp

protected void setUp()
              throws java.lang.Exception
Throws:
java.lang.Exception

localSetUp

protected void localSetUp()
Subclasses may override this method to allocate any data and resources that they need in order to successfully execute this testcase.


runBare

public void runBare()
             throws java.lang.Throwable
Runs the bare test sequence.

Throws:
java.lang.Throwable - if any exception is thrown

tearDown

protected final void tearDown()
This method clears data and resources allocated by testcases. It first closes the persistence manager of this testcase. Then it calls method localTearDown. Subclasses may override that method to clear any data and resources that they have allocated in method localSetUp. Finally, this method closes the persistence manager factory.

Note:These methods are called always, regardless of any exceptions. The first caught exception is kept in field tearDownThrowable. That exception is thrown as a nested exception of JDOFatalException if and only if the testcase executed successful. Otherwise that exception is logged using fatal log level. All other exceptions are logged using fatal log level, always.

Note:By default, the method tearDown does not close the pmf. This is done at the end of each configuration, unless the property jdo.tck.closePMFAfterEachTest is set to true.


localTearDown

protected void localTearDown()
Deletes all registered pc instances and extents of all registered pc classes. Subclasses may override this method to clear any data and resources that they have allocated in method localSetUp.


addTearDownObjectId

protected void addTearDownObjectId(java.lang.Object oid)

addTearDownInstance

protected void addTearDownInstance(java.lang.Object pc)

addTearDownClass

protected void addTearDownClass(java.lang.Class pcClass)

addTearDownClass

protected void addTearDownClass(java.lang.Class[] pcClasses)

deleteTearDownInstances

protected void deleteTearDownInstances()
Deletes and removes tear down instances. If there are no tear down instances, the this method is a noop. Otherwise, tear down instances are deleted exactly in the order they have been added. Tear down instances are deleted in a separate transaction.


deleteTearDownClasses

protected void deleteTearDownClasses()
Deletes and removes tear down classes. If there are no tear down classes, the this method is a noop. Otherwise, tear down classes are deleted exactly in the order they have been added. Tear down classes are deleted in a separate transaction. Deleting a tear down class means to delete the extent.


getAllObjects

protected java.util.Collection getAllObjects(javax.jdo.PersistenceManager pm,
                                             java.lang.Class pcClass)

getPMF

protected javax.jdo.PersistenceManagerFactory getPMF()
Get the PersistenceManagerFactory instance for the implementation under test.

Returns:
field pmf if it is not null, else sets field pmf to a new instance and returns that instance.

getPM

protected javax.jdo.PersistenceManager getPM()
Get the PersistenceManager instance for the implementation under test.


cleanupPM

protected void cleanupPM()
This method cleans up the environment: closes the PersistenceManager. This should avoid leaving multiple PersistenceManager instances around, in case the PersistenceManagerFactory performs PersistenceManager pooling.


cleanupPM

protected static void cleanupPM(javax.jdo.PersistenceManager pm)
This method cleans up the specified PersistenceManager. If the pm still has an open transaction, it will be rolled back, before closing the pm.


closePMF

public static void closePMF()
Closes the pmf stored in this instance.


getFailedPersistenceManagers

protected static javax.jdo.PersistenceManager[] getFailedPersistenceManagers(java.lang.String assertionFailure,
                                                                             javax.jdo.JDOException ex)

loadProperties

protected java.util.Properties loadProperties(java.lang.String fileName)
This method load Properties from a given file.


fail

public void fail(java.lang.String assertionFailure,
                 java.lang.String msg)
Prints the specified msg (if debug is true), before it aborts the test case.


dumpSupportedOptions

public static void dumpSupportedOptions(java.lang.String directory)
Dump the supportedOptions to the a file in the specified directory.


printUnsupportedOptionalFeatureNotTested

protected void printUnsupportedOptionalFeatureNotTested(java.lang.String testName,
                                                        java.lang.String optionalFeature)
Prints a message (if debug is true) saying the test with the specified name is not executed, because the JDO implementation under test does not support the specified optional feature.

Parameters:
testName - the name of the test method that is skipped.
optionalFeature - the name of the option not supported by the JDO implementation under tets.

isTransientTransactionalSupported

public boolean isTransientTransactionalSupported()
Reports whether TransientTransactional is supported.


isNontransactionalReadSupported

public boolean isNontransactionalReadSupported()
Reports whether NontransactionalRead is supported.


isNontransactionalWriteSupported

public boolean isNontransactionalWriteSupported()
Reports whether NontransactionalWrite is supported.


isRetainValuesSupported

public boolean isRetainValuesSupported()
Reports whether RetainValues is supported.


isOptimisticSupported

public boolean isOptimisticSupported()
Reports whether Optimistic is supported.


isApplicationIdentitySupported

public boolean isApplicationIdentitySupported()
Reports whether Application Identity is supported.


isDatastoreIdentitySupported

public boolean isDatastoreIdentitySupported()
Reports whether Datastore Identity is supported.


isNonDurableIdentitySupported

public boolean isNonDurableIdentitySupported()
Reports whether Non-Durable Identity is supported.


isArrayListSupported

public boolean isArrayListSupported()
Reports whether an ArrayList collection is supported.


isHashMapSupported

public boolean isHashMapSupported()
Reports whether a HashMap collection is supported.


isHashtableSupported

public boolean isHashtableSupported()
Reports whether a Hashtable collection is supported.


isLinkedListSupported

public boolean isLinkedListSupported()
Reports whether a LinkedList collection is supported.


isTreeMapSupported

public boolean isTreeMapSupported()
Reports whether a TreeMap collection is supported.


isTreeSetSupported

public boolean isTreeSetSupported()
Reports whether a TreeSet collection is supported.


isVectorSupported

public boolean isVectorSupported()
Reports whether a Vector collection is supported.


isMapSupported

public boolean isMapSupported()
Reports whether a Map collection is supported.


isListSupported

public boolean isListSupported()
Reports whether a List collection is supported.


isArraySupported

public boolean isArraySupported()
Reports whether arrays are supported.


isNullCollectionSupported

public boolean isNullCollectionSupported()
Reports whether a null collection is supported.


isChangeApplicationIdentitySupported

public boolean isChangeApplicationIdentitySupported()
Reports whether Changing Application Identity is supported.


isBinaryCompatibilitySupported

public boolean isBinaryCompatibilitySupported()
Reports whether Binary Compatibility is supported.


isUnconstrainedVariablesSupported

public boolean isUnconstrainedVariablesSupported()
Reports whether UnconstrainedVariables is supported.


isSQLSupported

public boolean isSQLSupported()
Reports whether SQL queries are supported.


isDataStoreConnectionSupported

public boolean isDataStoreConnectionSupported()
Reports whether getting the DataStoreConnection is supported.


isClassLoadable

public static boolean isClassLoadable(java.lang.String className)
Determine if a class is loadable in the current environment.


isJRE14orBetter

public static boolean isJRE14orBetter()
Determine if the environment is 1.4 version of JRE or better.


getStateOfInstance

public static java.lang.String getStateOfInstance(java.lang.Object o)
This utility method returns a String that indicates the current state of an instance.

Parameters:
o - The object.
Returns:
The current state of the instance, by using the JDOHelper state interrogation methods.

currentState

public static int currentState(java.lang.Object o)
This method will return the current lifecycle state of an instance.


compareStates

public static boolean compareStates(int found_state,
                                    int expected_state)
Tests if a found state matches an expected state.


mangleObject

protected boolean mangleObject(java.lang.Object oid)
                        throws java.lang.Exception
This method mangles an object by changing all its non-static, non-final fields. It returns true if the object was mangled, and false if there are no fields to mangle.

Throws:
java.lang.Exception

getModifiableFields

protected java.lang.reflect.Field[] getModifiableFields(java.lang.Object obj)
Returns modifiable Fields of the class of the parameter. Fields are considered modifiable if they are not static or final. This method requires several permissions in order to run with a SecurityManager, hence the doPrivileged block:


runsWithApplicationIdentity

public boolean runsWithApplicationIdentity()
Returns true if the current test runs with application identity. This means the system property jdo.tck.identitytype has the value applicationidentity.

Returns:
true if current test runs with application identity; false otherwise:

printNonApplicableIdentityType

protected void printNonApplicableIdentityType(java.lang.String testName,
                                              java.lang.String requiredIdentityType)
Prints a message (if debug is true) saying the test with the specified name is not executed, because the JDO implementation under test is run for an inapplicable identity type.

Parameters:
testName - the name of the test method that is skipped.
requiredIdentityType - the name of the required identity type.

getPMFProperty

protected java.lang.String getPMFProperty(java.lang.String key)
Returns the value of the PMF property given by argument key.

Parameters:
key - the key
Returns:
the value

isTestToBePerformed

protected boolean isTestToBePerformed()
Returns true if the implementation under test supports all JDO options contained in system property jdo.tck.requiredOptions.

Returns:
true if the implementation under test supports all JDO options contained in system property jdo.tck.requiredOptions

appendMessage

protected static void appendMessage(java.lang.String message)
Appends to error messages.


retrieveMessages

protected static java.lang.String retrieveMessages()
Returns collected error messages, or null if there are none, and clears the buffer.


failOnError

protected void failOnError()
Fail the test if there are any error messages.



Copyright © 2005-2007 Apache Software Foundation. All Rights Reserved.