Home » jdo2-tck-2.3-ea-src » org.apache.jdo.tck.query » [javadoc | source]
org.apache.jdo.tck.query
abstract public class: QueryTest [javadoc | source]
java.lang.Object
   org.apache.jdo.tck.AbstractReaderTest
      org.apache.jdo.tck.query.QueryTest
Field Summary
public static final  String SERIALZED_QUERY     
public static final  String COMPANY_TESTDATA     
public static final  String MYLIB_TESTDATA     
protected  List inserted    List of inserted instances (see methods insertPCPoints and getFromInserted). 
Method from org.apache.jdo.tck.query.QueryTest Summary:
checkQueryResultWithOrder,   checkQueryResultWithOrder,   checkQueryResultWithoutOrder,   checkQueryResultWithoutOrder,   closeEnough,   closeEnough,   compile,   compileAPIQuery,   compileSingleStringQuery,   compileSingleStringQuery,   deletePersistentAllByAPIQuery,   deletePersistentAllBySingleStringQuery,   equals,   equalsCollection,   equalsList,   equalsMap,   equalsObjectArray,   executeAPIQuery,   executeAPIQuery,   executeJDOQuery,   executeSQLQuery,   executeSingleStringQuery,   executeSingleStringQuery,   getCompanyTestDataResource,   getFromInserted,   getPersistentCompanyModelInstance,   getPersistentCompanyModelInstances,   getPersistentCompanyModelInstancesAsList,   getPersistentMylibInstance,   getPersistentMylibInstances,   getPersistentMylibInstancesAsList,   getTransientCompanyModelInstance,   getTransientCompanyModelInstances,   getTransientCompanyModelInstancesAsList,   getTransientMylibInstance,   getTransientMylibInstances,   getTransientMylibInstancesAsList,   insertPCPoints,   insertPrimitiveTypes,   loadAndPersistCompanyModel,   loadAndPersistMylib,   loadAndPersistPCPoints,   loadAndPersistPrimitiveTypes,   printOutput,   runParameterPrimitiveTypesQuery,   runSimplePrimitiveTypesQuery,   size
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.jdo.tck.query.QueryTest Detail:
 protected  void checkQueryResultWithOrder(String assertion,
    Object result,
    Object expected) 
    Verify that expected equals result, including the order of the elements. If not equal, fail the test. If there is a filter != null, do not use this method. Use the method of the same name that takes a String as the second argument.
 protected  void checkQueryResultWithOrder(String assertion,
    String query,
    Object result,
    Object expected) 
 protected  void checkQueryResultWithoutOrder(String assertion,
    Object result,
    Object expected) 
    Verify that expected equals result, ignoring the order of the elements. If not equal, fail the test. If there is a filter != null, do not use this method. Use the method of the same name that takes a String as the second argument.
 protected  void checkQueryResultWithoutOrder(String assertion,
    String query,
    Object result,
    Object expected) 
 public boolean closeEnough(double d1,
    double d2) 
    Returns true if the specified float values are close enough to be considered to be equal for a deep equals comparison. Floating point values are not exact, so comparing them using == might not return useful results. This method checks that both double values are within some percent of each other.
 public boolean closeEnough(float f1,
    float f2) 
    Returns true if the specified float values are close enough to be considered to be equal for a deep equals comparison. Floating point values are not exact, so comparing them using == might not return useful results. This method checks that both float values are within some percent of each other.
 protected  void compile(String assertion,
    Query query,
    String queryText,
    boolean positive) 
    Compiles the given query instance. Argument positive determines if the compilation is supposed to succeed or to fail. If true and the compilation fails, then the test case fails prompting arguments assertion and queryText. If false and the compilation succeeds, then the test case fails prompting argument assertion and queryText. Otherwise the test case succeeds.
 protected  void compileAPIQuery(String assertion,
    QueryElementHolder queryElementHolder,
    boolean positive) 
    Compiles the given query element holder instance as a JDO API query. Argument positive determines if the compilation is supposed to succeed or to fail. If true and the compilation fails, then the test case fails prompting argument assertion. If false and the compilation succeeds, then the test case fails prompting argument assertion. Otherwise the test case succeeds.
 protected  void compileSingleStringQuery(String assertion,
    QueryElementHolder queryElementHolder,
    boolean positive) 
    Compiles the given query element holder instance as a JDO single string query. Argument positive determines if the compilation is supposed to succeed or to fail. If true and the compilation fails, then the test case fails prompting argument assertion. If false and the compilation succeeds, then the test case fails prompting argument assertion. Otherwise the test case succeeds.
 protected  void compileSingleStringQuery(String assertion,
    String singleStringQuery,
    boolean positive) 
    Compiles the given single string query. Argument positive determines if the compilation is supposed to succeed or to fail. If true and the compilation fails, then the test case fails prompting argument assertion. If false and the compilation succeeds, then the test case fails prompting argument assertion. Otherwise the test case succeeds.
 protected  void deletePersistentAllByAPIQuery(String assertion,
    QueryElementHolder queryElementHolder,
    Object parameters,
    long expectedNrOfDeletedObjects) 
 protected  void deletePersistentAllBySingleStringQuery(String assertion,
    QueryElementHolder queryElementHolder,
    Object parameters,
    long expectedNrOfDeletedObjects) 
 protected boolean equals(Object o1,
    Object o2) 
    Returns true if o1 and o2 equal. This method is capable to compare object arrays, collections of object arrays, maps of object arrays. This method implements a narrowing in case of floating point values. In case of big decimals it calls BigDecimal#compareTo(java.lang.Object) . It allows o1 and/or o2 to be null.
 protected boolean equalsCollection(Collection o1,
    Collection o2) 
    Returns true if o1 and o2 equal. This method iterates over the first collection and checks if each instance is contained in the second collection by calling remove(Collection, Object). This guarantees that the cardinality of each instance in the first collection matches the cardinality of each instance in the second collection. This method does not allow o1 and o2 to be null both.
 protected boolean equalsList(List o1,
    List o2) 
 protected boolean equalsMap(Map o1,
    Map o2) 
    Returns true if o1 and o2 equal. This method checks if the key sets and the value sets of both maps equal calling equalsCollection(Collection, Collection). This method does not allow o1 and o2 to be null both.
 protected boolean equalsObjectArray(Object[] o1,
    Object[] o2) 
 protected  void executeAPIQuery(String assertion,
    QueryElementHolder queryElementHolder,
    Object expectedResult) 
    Executes the given query element holder instance as a JDO API query. The result of that query is compared against the given argument expectedResult. If the expected result does not match the returned query result, then the test case fails prompting argument assertion.
 protected  void executeAPIQuery(String assertion,
    QueryElementHolder queryElementHolder,
    Object[] parameters,
    Object expectedResult) 
    Executes the given query element holder instance as a JDO API query. The result of that query is compared against the given argument expectedResult. If the expected result does not match the returned query result, then the test case fails prompting argument assertion.
 protected Object executeJDOQuery(String assertion,
    Query query,
    String singleStringQuery,
    boolean hasOrdering,
    Object[] parameters,
    Object expectedResult,
    boolean positive) 
    Executes the given query instance delegating to execute(String, Query, String, boolean, Object, Object, boolean). Logs argument singleStringQuery if debug logging is enabled.
 protected  void executeSQLQuery(String assertion,
    String sql,
    Class candidateClass,
    Class resultClass,
    boolean positive,
    Object parameters,
    Object expectedResult,
    boolean unique) 
    Executes the given SQL string as a JDO SQL query. The result of that query is compared against the given argument expectedResult. If the expected result does not match the returned query result, then the test case fails prompting argument assertion. Argument unique indicates, if the query is supposed to return a single result. Argument sql may contain the substring "{0}". All occurences of this substring are replaced by the value of PMF property "javax.jdo.mapping.Schema".
 protected  void executeSingleStringQuery(String assertion,
    QueryElementHolder queryElementHolder,
    Object expectedResult) 
    Executes the given query element holder instance as a JDO single string query. The result of that query is compared against the given argument expectedResult. If the expected result does not match the returned query result, then the test case fails prompting argument assertion.
 protected  void executeSingleStringQuery(String assertion,
    QueryElementHolder queryElementHolder,
    Object[] parameters,
    Object expectedResult) 
    Executes the given query element holder instance as a JDO single string query. The result of that query is compared against the given argument expectedResult. If the expected result does not match the returned query result, then the test case fails prompting argument assertion.
 protected String getCompanyTestDataResource() 
    Returns the name of the company test data resource.
 public List getFromInserted(List list) 
 protected Object getPersistentCompanyModelInstance(String beanName) 
    Returns a persistent company model instance for the given bean name.
 protected Object[] getPersistentCompanyModelInstances(String[] beanNames) 
    Returns an array of persistent company model instances for bean names in the given argument.
 protected List getPersistentCompanyModelInstancesAsList(String[] beanNames) 
    Returns a list of persistent company model instances instances for beans names in the given argument.
 protected Object getPersistentMylibInstance(String beanName) 
    Returns a persistent mylib instance for the given bean name.
 protected Object[] getPersistentMylibInstances(String[] beanNames) 
    Returns an array of persistent mylib instances for beans names in the given argument.
 protected List getPersistentMylibInstancesAsList(String[] beanNames) 
    Returns a list of persistent mylib instances for beans names in the given argument.
 protected Object getTransientCompanyModelInstance(String beanName) 
    Returns a transient company model instance for the given bean name.
 protected Object[] getTransientCompanyModelInstances(String[] beanNames) 
    Returns an array of transient company model instances for bean names in the given argument.
 protected List getTransientCompanyModelInstancesAsList(String[] beanNames) 
    Returns a list of transient company model instances instances for beans names in the given argument.
 protected Object getTransientMylibInstance(String beanName) 
    Returns a transient mylib instance for the given bean name.
 protected Object[] getTransientMylibInstances(String[] beanNames) 
    Returns an array of transient mylib instances for beans names in the given argument.
 protected List getTransientMylibInstancesAsList(String[] beanNames) 
    Returns a list of transient mylib instances for beans names in the given argument.
 protected  void insertPCPoints(PersistenceManager pm,
    int numInsert) 
 protected  void insertPrimitiveTypes(PersistenceManager pm) 
 public CompanyModelReader loadAndPersistCompanyModel(PersistenceManager pm) 
    Reads a graph of company model objects from the internal reader. 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.
 public MylibReader loadAndPersistMylib(PersistenceManager pm) 
    Reads a graph of mylib objects from the internal reader. 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.
 public  void loadAndPersistPCPoints(PersistenceManager pm) 
 public  void loadAndPersistPrimitiveTypes(PersistenceManager pm) 
 protected  void printOutput(Object results,
    Collection expected) 
 protected  void runParameterPrimitiveTypesQuery(String filter,
    String paramDecl,
    Object paramValue,
    PersistenceManager pm,
    Collection expected,
    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.
 protected  void runSimplePrimitiveTypesQuery(String filter,
    PersistenceManager pm,
    Collection expected,
    String assertion) 
    Creates and executes a PrimitiveTypes query with the specified filter. The method checks whether the query returns the expected result.
 protected int size(Object o) 
    Returns the size of the object. If it is a multivalued object (Collection, Map, or array) return the number of elements. If not, return 1.