db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Watzek (JIRA)" <j...@apache.org>
Subject [jira] Created: (JDO-164) Implement new JDO 2 query tests cases concerning result handling.
Date Tue, 04 Oct 2005 12:40:48 GMT
Implement new JDO 2 query tests cases concerning result handling.

         Key: JDO-164
         URL: http://issues.apache.org/jira/browse/JDO-164
     Project: JDO
        Type: New Feature
  Components: tck20  
    Reporter: Michael Watzek
 Assigned to: Michael Watzek 

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.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message