Issue Details (XML | Word | Printable)

Key: JDO-164
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Michael Watzek
Reporter: Michael Watzek
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
JDO

Implement new JDO 2 query tests cases concerning result handling.

Created: 04/Oct/05 09:40 PM   Updated: 22/Nov/05 01:06 AM
Return to search
Component/s: tck2
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works JDO-164.patch 2005-11-10 10:32 PM Michael Watzek 133 kB
File Licensed for inclusion in ASF works JDO-164.patch2 2005-11-18 02:09 AM Michael Watzek 119 kB

Resolution Date: 22/Nov/05 01:06 AM


 Description  « Hide
We need 14 new test classes, one for each of the following assertions:

- A14.6.9-1: If distinct is specified, the query result does not include any duplicates. If the result parameter specifies more than one result expression, duplicates are those with matching values for each result expression.
- A14.6.9-2: Queries against an extent always consider only distinct candidate instances, regardless of whether distinct is specified. Queries against a collection might contain duplicate candidate instances; the distinct keyword removes duplicates from the candidate collection in this case.
- A14.6.9-3: If a variable or a field of a variable is included in the result, either directly or via navigation through the variable, then the semantics of the contains clause that include the variable change. In this case, all values of the variable that satisfy the filter are included in the result.
- A14.6.9-4: If any result is a navigational expression, and a non-terminal field or variable has a null value for a particular set of conditions (the result calculation would throw NullPointerException), then the result is null for that result expression.
- A14.6.9-5: The result expressions include: ... The result expression can be explicitly cast using the (cast) operator.
- A14.6.9-6: Count returns Long. Sum returns Long for integral types and the field's type for other Number types (BigDecimal, BigInteger, Float, and Double). Sum is invalid if applied to non-Number types. Avg, min, and max return the type of the expression.
- A14.6.9-7: If the returned value from a query specifying a result is null, this indicates that the expression specified as the result was null.
- A14.6.9-8: If not specified, the result defaults to distinct this as C.
- A14.6.10-1: When grouping is specified, each result expression must be one of: an expression contained in the grouping expression; or, an aggregate expression evaluated once per group. The query groups all elements where all expressions specified in setGrouping have the same values. The query result consists of one element per group.
- A14.6.10-2: When having is specified, the having expression consists of arithmetic and boolean expressions containing aggregate expressions.
- A14.6.11-1: When the value of the Unique flag is true, then the result of a query is a single value, with null used to indicate that none of the instances in the candidates satisfied the filter. If more than one instance satisfies the filter, and the range is not limited to one result, then execute throws a JDOUserException.
- A14.6.11-2: The default Unique setting is true for aggregate results without a grouping expression, and false otherwise.
- A14.6.12-1:The result class may be one of the java.lang classes Character, Boolea, Byte, Short, Integer, Long, Float, Double, String, or Object[]; or one of the java.math classes BigInteger or BigDecimal; or the java.util class Date; or the java.util interface Map; or one of the java.sql classes Date, Time, or Timestamp; or a user-defined class.
- A14.6.12-2: Table 6: Shape of Result (C is the candidate class).

Details can be found on Wiki page http://wiki.apache.org/jdo/QueryTests#ResultHandling.


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Michael Watzek made changes - 10/Nov/05 10:32 PM
Field Original Value New Value
Attachment JDO-164.patch [ 12320595 ]
Michael Watzek made changes - 18/Nov/05 02:09 AM
Attachment JDO-164.patch2 [ 12320759 ]
Michael Watzek made changes - 22/Nov/05 01:06 AM
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]