org.apache.jdo.tck.query
Class QueryTest
java.lang.Object
junit.framework.Assert
junit.framework.TestCase
org.apache.jdo.tck.JDO_Test
org.apache.jdo.tck.query.QueryTest
- All Implemented Interfaces:
- junit.framework.Test
- Direct Known Subclasses:
- AssignmentPrePostIncrementDecrementNotSupported, BinaryAddition, BinarySubtraction, BitwiseComplement, BooleanLogicalAND, BooleanLogicalOR, BoundParameterCheck, Cast, Close, CloseAll, ComparingCollectionFieldToNull, ComparingPersistentAndNonPersistentInstance, CompileQuery, ConditionalAND, ConditionalOR, DeclareImports, DeclareParameters, DeclareVariables, DenoteUniquenessInFilter, Division, EqualityAndComparisonsBetweenDateFieldsAndParameters, EqualityAndComparisonsBetweenPrimitivesAndWrapperInstances, EqualityAndComparisonsBetweenStringFieldsAndParameters, ExecuteQuery, ExecuteQueryWhenPersistenceManagerIsClosed, ExecuteQueryWithArray, ExecuteQueryWithMap, ExecutingQueryWhenNoTransactionNoNontransactionalRead, GetIgnoreCache, GetPersistenceManager, GetPersistenceManagerFromRestoredSerializedQuery, IgnoreCacheFalse, ImmutableQueryResult, LogicalComplement, MethodsAndObjectConstructionNotSupported, MultipleActiveQueryInstanceInSamePersistenceManager, MultipleIdenticalImports, Multiplication, NamespaceOfIdentifiers, NavigationThroughACollectionField, NavigationThroughANullValuedField, NavigationThroughReferencesUsesDotOperator, NewQueryFromExistingQueryBoundToPMFromSameVendor, NewQueryFromRestoredSerializedQuery, NewQueryWithCandidateClass, NewQueryWithCandidateClassAndCollection, NewQueryWithCandidateClassAndExtent, NewQueryWithCandidateClassAndFilter, NewQueryWithCandidateClassCollectionFilter, NewQueryWithExtent, NewQueryWithExtentAndFilter, NewQueryWithSpecifiedLanguageAndQuery, NullCollectionsAndContainsMethod, NullCollectionsAndIsEmpty, OrderingSpecification, ParameterBoundToDifferentPM, ParameterDeclaredWithSameNameAsFieldOfCandidateClass, ParenthesesMarkOperatorPrecedence, PrimitiveParameterPassedAsNull, PromotionOfNumericOperands, QueryIsSerializable, QueryResultPassedToAnotherQuery, QueryWithNoFilter, RestoredSerializedQueryInstanceLosesAssociationWithPM, SeparateNamespaceForTypeNames, SetCandidateCollection, SetCandidateExtent, SetFilter, SetIgnoreCache, SetOrdering, SetterReplacePreviousValues, SignInversion, StartsWithAndEndsWith, StringConcatenation, SupportedCollectionMethods, ThisIsReservedWordForElementOfCollection, UnaryPlus, UseOfThisToAcessHiddenField, VariableDeclaredWithSameNameAsFieldOfCandidateClass, WhiteSpaceIsACharacterAndIgnored
- public abstract class QueryTest
- extends JDO_Test
Field Summary |
protected java.util.List |
inserted
List of inserted instances (see methods insertPCPoints and
getFromInserted). |
static java.lang.String |
SERIALZED_QUERY
|
Fields inherited from class org.apache.jdo.tck.JDO_Test |
debug, HOLLOW, ILLEGAL_STATE, logger, NUM_STATES, PERSISTENT_CLEAN, PERSISTENT_DELETED, PERSISTENT_DIRTY, PERSISTENT_NEW, PERSISTENT_NEW_DELETED, PERSISTENT_NONTRANSACTIONAL, pm, pmf, PMFProperties, PMFPropertiesObject, states, testSucceeded, TRANSIENT, TRANSIENT_CLEAN, TRANSIENT_DIRTY |
Method Summary |
protected void |
checkQueryResultWithOrder(java.lang.String assertion,
java.lang.Object result,
java.util.Collection expected)
|
protected void |
checkQueryResultWithoutOrder(java.lang.String assertion,
java.lang.Object result,
java.util.Collection expected)
|
void |
cleanupCompanyModel(javax.jdo.PersistenceManager pm)
|
void |
cleanupDatabase(javax.jdo.PersistenceManager pm,
java.lang.Class cls)
|
protected void |
cleanupDatabaseInternal(javax.jdo.PersistenceManager pm,
java.lang.Class cls)
|
protected boolean |
compareOrderedResults(java.util.Collection first,
java.util.Collection second)
This method implements the semantics of AbstractList.equals but
does not require that the parameters actually be Lists. |
java.util.List |
getFromInserted(java.util.List list)
|
void |
initDatabase(javax.jdo.PersistenceManager pm,
java.lang.Class cls)
|
protected void |
insertPCPoints(javax.jdo.PersistenceManager pm,
int numInsert)
|
protected void |
insertPrimitiveTypes(javax.jdo.PersistenceManager pm)
|
CompanyModelReader |
loadCompanyModel(javax.jdo.PersistenceManager pm,
java.lang.String filename)
Reads a graph of company model objects from the specified xml file. |
CompanyModelReader |
loadCompanyModel(javax.jdo.PersistenceManager pm,
java.lang.String filename,
java.lang.Class pcRootClass)
Reads a graph of company model objects from the specified xml file. |
void |
loadPrimitiveTypes(javax.jdo.PersistenceManager pm)
|
protected void |
printOutput(java.lang.Object results,
java.util.Collection expected)
|
protected void |
runParameterPrimitiveTypesQuery(java.lang.String filter,
java.lang.String paramDecl,
java.lang.Object paramValue,
javax.jdo.PersistenceManager pm,
java.util.Collection expected,
java.lang.String assertion)
Creates and executes a PrimitiveTypes query with the specified filter,
parameter declarations and parameter values. |
protected void |
runSimplePrimitiveTypesQuery(java.lang.String filter,
javax.jdo.PersistenceManager pm,
java.util.Collection expected,
java.lang.String assertion)
Creates and executes a PrimitiveTypes query with the specified filter. |
Methods inherited from class org.apache.jdo.tck.JDO_Test |
cleanup, cleanupPM, closePMF, currentState, fail, getFailedPersistenceManagers, getPM, getPMF, getStateOfInstance, isApplicationIdentitySupported, isArrayListSupported, isArraySupported, isChangeApplicationIdentitySupported, isDatastoreIdentitySupported, isHashMapSupported, isHashtableSupported, isLinkedListSupported, isListSupported, isMapSupported, isNonDurableIdentitySupported, isNontransactionalReadSupported, isNontransactionalWriteSupported, isNullCollectionSupported, isOptimisticSupported, isRetainValuesSupported, isTransientTransactionalSupported, isTreeMapSupported, isTreeSetSupported, isVectorSupported, loadProperties, mangleObject, printUnsupportedOptionalFeatureNotTested, runBare, setUp, tearDown |
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 |
SERIALZED_QUERY
public static final java.lang.String SERIALZED_QUERY
- See Also:
- Constant Field Values
inserted
protected java.util.List inserted
- List of inserted instances (see methods insertPCPoints and
getFromInserted).
QueryTest
public QueryTest()
initDatabase
public void initDatabase(javax.jdo.PersistenceManager pm,
java.lang.Class cls)
insertPCPoints
protected void insertPCPoints(javax.jdo.PersistenceManager pm,
int numInsert)
getFromInserted
public java.util.List getFromInserted(java.util.List list)
loadCompanyModel
public CompanyModelReader loadCompanyModel(javax.jdo.PersistenceManager pm,
java.lang.String filename)
- Reads a graph of company model objects from the specified xml file. This
methods explictly calls makePersistent for all named instances using the
specified PersistenceManager. The method returns the CompanyModelReader
instance allowing to access a compay model instance by name.
loadCompanyModel
public CompanyModelReader loadCompanyModel(javax.jdo.PersistenceManager pm,
java.lang.String filename,
java.lang.Class pcRootClass)
- Reads a graph of company model objects from the specified xml file. This
methods calls makePersistent for all instances of the specified
pcRootClass which then runs the reachability algorithm.
The method returns the CompanyModelReader instance allowing to access
a compay model instance by name.
cleanupCompanyModel
public void cleanupCompanyModel(javax.jdo.PersistenceManager pm)
loadPrimitiveTypes
public void loadPrimitiveTypes(javax.jdo.PersistenceManager pm)
insertPrimitiveTypes
protected void insertPrimitiveTypes(javax.jdo.PersistenceManager pm)
runSimplePrimitiveTypesQuery
protected void runSimplePrimitiveTypesQuery(java.lang.String filter,
javax.jdo.PersistenceManager pm,
java.util.Collection expected,
java.lang.String assertion)
- Creates and executes a PrimitiveTypes query with the specified filter.
The method checks whether the query returns the expected result.
runParameterPrimitiveTypesQuery
protected void runParameterPrimitiveTypesQuery(java.lang.String filter,
java.lang.String paramDecl,
java.lang.Object paramValue,
javax.jdo.PersistenceManager pm,
java.util.Collection expected,
java.lang.String assertion)
- Creates and executes a PrimitiveTypes query with the specified filter,
parameter declarations and parameter values. The method checks whether
the query returns the expected result.
cleanupDatabase
public void cleanupDatabase(javax.jdo.PersistenceManager pm,
java.lang.Class cls)
cleanupDatabaseInternal
protected void cleanupDatabaseInternal(javax.jdo.PersistenceManager pm,
java.lang.Class cls)
checkQueryResultWithOrder
protected void checkQueryResultWithOrder(java.lang.String assertion,
java.lang.Object result,
java.util.Collection expected)
compareOrderedResults
protected boolean compareOrderedResults(java.util.Collection first,
java.util.Collection second)
- This method implements the semantics of AbstractList.equals but
does not require that the parameters actually be Lists.
checkQueryResultWithoutOrder
protected void checkQueryResultWithoutOrder(java.lang.String assertion,
java.lang.Object result,
java.util.Collection expected)
printOutput
protected void printOutput(java.lang.Object results,
java.util.Collection expected)
Copyright © 2005-2007 Apache Software Foundation. All Rights Reserved.