You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jdo-dev@db.apache.org by Andy Jefferson <an...@jpox.org> on 2005/11/24 12:20:21 UTC
QueryTest issue
There seems to have been some change in QueryTest that now causes some tests
to fail that previously passed.
InvalidUseOfKeywords.testNegative
KeywordsAsFieldNames.testNegative
UppercaseLowercase.testNegitve
These all expect an exception to be thrown and JPOX kindly obliges with
JDOUserException, but then the test is marked as an error - seemingly because
the exception is thrown when the query is constructed (passing in the single
string query, which has errors), and the test is expecting an error at
compile time.
JPOX policy is to throw the exception at the earliest point possible, which in
this case is at the call of PM.newQuery() (since the user has used invalid
single-string syntax). Why wait til compile time and tell them then? Was this
change to QueryTest intentional ?
--
Andy
Re: QueryTest issue
Posted by Michael Watzek <mw...@spree.de>.
Hi Andy,
your are right: Changes on class QueryTest related to the SQL patch
(JDO-165) make the test cases below fail.
Actually, I did not intend this and the spec does not forbid throwing an
exception in newQuery. So, your question is reasonable and I will fix this.
Regards,
Michael
> There seems to have been some change in QueryTest that now causes some tests
> to fail that previously passed.
> InvalidUseOfKeywords.testNegative
> KeywordsAsFieldNames.testNegative
> UppercaseLowercase.testNegitve
>
> These all expect an exception to be thrown and JPOX kindly obliges with
> JDOUserException, but then the test is marked as an error - seemingly because
> the exception is thrown when the query is constructed (passing in the single
> string query, which has errors), and the test is expecting an error at
> compile time.
>
> JPOX policy is to throw the exception at the earliest point possible, which in
> this case is at the call of PM.newQuery() (since the user has used invalid
> single-string syntax). Why wait til compile time and tell them then? Was this
> change to QueryTest intentional ?
>
--
-------------------------------------------------------------------
Michael Watzek Tech@Spree Engineering GmbH
mailto:mwa.tech@spree.de Buelowstr. 66
Tel.: ++49/30/235 520 36 10783 Berlin - Germany
Fax.: ++49/30/217 520 12 http://www.spree.de/
-------------------------------------------------------------------