11-10-05 12:45 PM
[ http://issues.apache.org/jira/browse/JDO-164?page=all ]
Michael Watzek updated JDO-164:
-------------------------------
Attachment: JDO-164.patch
The attached patch implements the assertions above.
> 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
> Assignee: Michael Watzek
> Attachments: JDO-164.patch
>
> 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 a
ny duplicates. If the result parameter specifies more than one result expres
sion, duplicates are those with matching values for each result expression.
> - A14.6.9-2: Queries against an extent always consider only distinct candidate ins
tances, regardless of whether distinct is specified. Queries against a collection mi
ght contain duplicate candidate instances; the distinct keyword removes duplicates f
rom
the candidate collection in this case.
> - A14.6.9-3: If a variable or a field of a variable is included in the result, eit
her directly or via navigation through the variable, then the semantics of the conta
ins clause that include the variable change. In this case, all values of the variabl
e t
hat 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 calculat
ion would throw NullPointerException), then the result is null for that result expre
ssi
on.
> - 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 i
nvalid if applied to non-Number types. Avg, min, and max return the type of the expr
ess
ion.
> - A14.6.9-7: If the returned value from a query specifying a result is nul
l, 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: a
n expression contained in the grouping expression; or, an aggregate expression evalu
ated once per group. The query groups all elements where all expressions specified i
n s
etGrouping 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 quer
y is a single value, with null used to indicate that none of the instances in the ca
ndidates satisfied the filter. If more than one instance satisfies the filter, and t
he
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 wit
hout a grouping expression, and false otherwise.
> - A14.6.12-1:The result class may be one of the java.lang classes Character, Boole
a, 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 jav
a.util
interface Map; or one of the java.sql classes Date, Time, or Timestamp; or a user-defined cl
XXX.
> - 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/QueryTes...nistrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[ Post a follow-up to this message ]
|