You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jdo-commits@db.apache.org by jd...@db.apache.org on 2005/02/11 14:58:43 UTC

[Apache JDO Wiki] New: QueryTests

   Date: 2005-02-11T05:58:43
   Editor: MichaelBouschen
   Wiki: Apache JDO Wiki
   Page: QueryTests
   URL: http://wiki.apache.org/jdo/QueryTests

   First version QueryTests page (describing JDO TCK query test changes)

New Page:

= JDO TCK 1.1 Test Cases =

The current JDO TCK (as implemented in the tck11 sub-project) does not implement all the JDO TCK assertions. For some of these assertions the unimpl_tests directory of the Sun cvs repository includes test classes where the test method need to be implemented. The spreadsheet assetions/Jdo``Tck``Assertions``Table.sxc lists all the assertions.

Here are the unimpl tests for package org.apache.jdo.tck.query:

||Assertion No.||Class||Comment||
||A5.4.3-9  ||Queries``Of``Instances``With``Nondatstore``Identity||Not testable with JDO RI||
||A14.6.2-2 ||Element``Returned``In``Query``Result||prio 2, Rename class to Denote``Uniqueness``In``Filter||
||A14.6.2-4 ||Equality``And``Comparisons``Between``Date``Fields``And``Parameters||prio 2||
||A14.6.2-5 ||Equality``And``Comparisons``Between``String``Fields``And``Parameters||prio 2, String ordering is not portable||
||A14.6.2-9 ||Navigation``ThroughANull``Valued``Field||prio 2||
||A14.6.2-10||Navigation``ThroughACollection``Field||prio 3||
||A14.6.2-11||Namespace``Of``Identifiers||prio 3||
||A14.6.2-12||This``Is``Reserved``Word``For``Element``Of``Collection||Tested elsewhere => skip test case||
||A14.6.2-13||Navigation``Through``References``Uses``Dot``Operator||prio 2||
||A14.6.2-36||Comparing``Collection``Field``To``Null||prio 3||
||A14.6.2-38||Cast||prio 3||
||A14.6.2-39||Promotion``Of``Numeric``Operands``For``Comparisons||prio 3||
||A14.6.5-1 ||Scope``Of``Variable``Not``Named``In``Contains``Clause||JDO 2.0 test case||
||A14.6.5-2 ||Scope``Of``Variable``Not``Named``In``Contains``Clause``And``No``Extent||JDO 2.0 test case||

Here are the unimpl tests for package org.apache.jdo.tck.query.operators:

||Assertion No.||Class||Comment||
||A14.6.2-20||Boolean``Logical``AND||prio 2||
||A14.6.2-21||Conditional``AND||prio 1||
||A14.6.2-22||Boolean``Logical``OR||prio 2||
||A14.6.2-23||Conditional``OR||prio 1||
||A14.6.2-24||Bitwise``Complement||prio 3||
||A14.6.2-25||Unary``Addition||prio 3, rename class to Unary``Plus||
||A14.6.2-27||String``Concatentation||prio 3||
||A14.6.2-28||Binary``Subtraction||prio 3||
||A14.6.2-29||Sign``Inversion||prio 3||
||A14.6.2-30||Multiplication||prio 3||
||A14.6.2-31||Division||prio 3||
||A14.6.2-32||Logical``Complement|||prio 2||
||A14.6.2-33||Starts``With``And``Ends``With||prio 3||
||A14.6.2-34||Null``Collections``And``Is``Empty||prio 3||
||A14.6.2-35||Null``Collections``And``Contains``Method||prio 3||

These are JDO 1.0 assertions w/o test class in the unimpl_tests directory.

||Assertion No.||Comment||
||N14.4-5||Multiple identical imports||
||N14.6-15||Query.setXXX method repalce previous values||
||N14.6.1-7||Changing query resukt collection fails||
||N14.6.1-8 ||pc parameter bound to different pm fails||
||N14.6.1-10||Query with ignoreCache=false||
||A14.6.2-11||Identifier name space||

= JDO TCK 2.0 Test Cases =

JDO 2.0 extends the Query API and the Query language JDOQL. 

== Query API ==

The spreadsheet lists the following assertions for JDK TCK 2.0 that make sure a JDO 2.0 implementation supports the new Query API methods:

||Assertion No.||Comment||
||N2-14.6-16||Query.setResult||
||N2-14.6-17||Query.setGrouping||
||N2-14.6-18||Query.setUnique||
||N2-14.6-19||Query.setResultClass||
||N2-14.6-20||Query.setRange||
||N2-14.6-18||Query.setUnique||

JDO adds the following methods to the Query API, but there are no assertions for these methods yet:
 * void setUnmodifiable()
 * boolean isUnmodifiable()
 * void setExtensions(Map extensions)
 * void addExtension(String key, Object value)

== JDOQL 2.0 ==

JDO 2.0 extensions of the JDO query language JDOQL:

 * Single string JDOQL
 * Result specification
   * Projections of fields and relationships
   * One or more result expressions
   * Distinct results
   * Unique query result
   * Default result class for one or more result expressions
   * User defined result class
   * Naming of result expressions
 * Aggregate functions MIN, MAX, SUM, AVG, and COUNT
 * Grouping of query result
   * One or more grouing expressions
   * Having clause
 * New methods in Query filters:
   * Map support: get(Object), containsKey(Object), containsValue(Object), isEmpty()
   * Additional string methods: toLowerCase(), toUpperCase(), indexOf(String), indexOf(String, int), matches(String), substring(int), substring(int, int)
   * Support for other methods: Math.abs(numeric), Math.sqrt(numeric), JDOHelper.getObjectId(Object)
 * New operators %(modulo) and instanceof
 * Support for implicit parameters
 * Support for implicit variables
 * Deletion by query