|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
org.apache.jdo.tck.JDO_Test
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 |
public static final int TRANSIENT
public static final int PERSISTENT_NEW
public static final int PERSISTENT_CLEAN
public static final int PERSISTENT_DIRTY
public static final int HOLLOW
public static final int TRANSIENT_CLEAN
public static final int TRANSIENT_DIRTY
public static final int PERSISTENT_NEW_DELETED
public static final int PERSISTENT_DELETED
public static final int PERSISTENT_NONTRANSACTIONAL
public static final int PERSISTENT_NONTRANSACTIONAL_DIRTY
public static final int DETACHED_CLEAN
public static final int DETACHED_DIRTY
public static final int NUM_STATES
public static final int ILLEGAL_STATE
public static final java.lang.String[] states
public static final java.lang.String APPLICATION_IDENTITY
public static final java.lang.String DATASTORE_IDENTITY
protected final java.lang.String identitytype
protected static java.lang.String PMFProperties
protected static boolean cleanupData
protected static final boolean closePMFAfterEachTest
protected static java.util.Properties PMFPropertiesObject
protected static javax.jdo.PersistenceManagerFactory pmf
protected javax.jdo.PersistenceManager pm
protected boolean testSucceeded
protected org.apache.commons.logging.Log logger
protected boolean debug
public static final java.lang.String NL
protected static java.lang.StringBuffer messages
Constructor Detail |
public JDO_Test()
Method Detail |
protected void setUp() throws java.lang.Exception
java.lang.Exception
protected void localSetUp()
public void runBare() throws java.lang.Throwable
java.lang.Throwable
- if any exception is thrownprotected final void tearDown()
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.
protected void localTearDown()
localSetUp
.
protected void addTearDownObjectId(java.lang.Object oid)
protected void addTearDownInstance(java.lang.Object pc)
protected void addTearDownClass(java.lang.Class pcClass)
protected void addTearDownClass(java.lang.Class[] pcClasses)
protected void deleteTearDownInstances()
protected void deleteTearDownClasses()
protected java.util.Collection getAllObjects(javax.jdo.PersistenceManager pm, java.lang.Class pcClass)
protected javax.jdo.PersistenceManagerFactory getPMF()
PersistenceManagerFactory
instance
for the implementation under test.
pmf
if it is not null
,
else sets field pmf
to a new instance and returns that instance.protected javax.jdo.PersistenceManager getPM()
PersistenceManager
instance
for the implementation under test.
protected void cleanupPM()
PersistenceManager
. This should avoid leaving
multiple PersistenceManager instances around, in case the
PersistenceManagerFactory performs PersistenceManager pooling.
protected static void cleanupPM(javax.jdo.PersistenceManager pm)
PersistenceManager
. If the pm still has an open
transaction, it will be rolled back, before closing the pm.
public static void closePMF()
protected static javax.jdo.PersistenceManager[] getFailedPersistenceManagers(java.lang.String assertionFailure, javax.jdo.JDOException ex)
protected java.util.Properties loadProperties(java.lang.String fileName)
public void fail(java.lang.String assertionFailure, java.lang.String msg)
public static void dumpSupportedOptions(java.lang.String directory)
protected void printUnsupportedOptionalFeatureNotTested(java.lang.String testName, java.lang.String optionalFeature)
testName
- the name of the test method that is skipped.optionalFeature
- the name of the option not supported by the
JDO implementation under tets.public boolean isTransientTransactionalSupported()
public boolean isNontransactionalReadSupported()
public boolean isNontransactionalWriteSupported()
public boolean isRetainValuesSupported()
public boolean isOptimisticSupported()
public boolean isApplicationIdentitySupported()
public boolean isDatastoreIdentitySupported()
public boolean isNonDurableIdentitySupported()
public boolean isArrayListSupported()
ArrayList
collection is supported.
public boolean isHashMapSupported()
HashMap
collection is supported.
public boolean isHashtableSupported()
Hashtable
collection is supported.
public boolean isLinkedListSupported()
LinkedList
collection is supported.
public boolean isTreeMapSupported()
TreeMap
collection is supported.
public boolean isTreeSetSupported()
TreeSet
collection is supported.
public boolean isVectorSupported()
Vector
collection is supported.
public boolean isMapSupported()
Map
collection is supported.
public boolean isListSupported()
List
collection is supported.
public boolean isArraySupported()
public boolean isNullCollectionSupported()
public boolean isChangeApplicationIdentitySupported()
public boolean isBinaryCompatibilitySupported()
public boolean isUnconstrainedVariablesSupported()
public boolean isSQLSupported()
public boolean isDataStoreConnectionSupported()
public static boolean isClassLoadable(java.lang.String className)
public static boolean isJRE14orBetter()
public static java.lang.String getStateOfInstance(java.lang.Object o)
String
that indicates the
current state of an instance.
o
- The object.
JDOHelper
state interrogation methods.public static int currentState(java.lang.Object o)
public static boolean compareStates(int found_state, int expected_state)
protected boolean mangleObject(java.lang.Object oid) throws java.lang.Exception
java.lang.Exception
protected java.lang.reflect.Field[] getModifiableFields(java.lang.Object obj)
public boolean runsWithApplicationIdentity()
true
if the current test runs with application
identity. This means the system property jdo.tck.identitytype has the
value applicationidentity.
true
if current test runs with application
identity; false
otherwise:protected void printNonApplicableIdentityType(java.lang.String testName, java.lang.String requiredIdentityType)
testName
- the name of the test method that is skipped.requiredIdentityType
- the name of the required identity type.protected java.lang.String getPMFProperty(java.lang.String key)
key
.
key
- the key
protected boolean isTestToBePerformed()
true
if the implementation under test
supports all JDO options contained in system property
jdo.tck.requiredOptions
.
true
if the implementation under test
supports all JDO options contained in system property
jdo.tck.requiredOptions
protected static void appendMessage(java.lang.String message)
protected static java.lang.String retrieveMessages()
null
if there
are none, and clears the buffer.
protected void failOnError()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |