db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig Russell (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JDO-378) SQL query : executeWithMap test
Date Fri, 02 Feb 2007 23:23:05 GMT

    [ https://issues.apache.org/jira/browse/JDO-378?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12469906
] 

Craig Russell commented on JDO-378:
-----------------------------------

Looks very good.

Just one nit to pick. I think that using a variable for the value of the "positive" and "unique"
parameters hurts readability, because you have to go from the method up to where the values
of unique and positive are defined. I'd rather see inline what these parameter values are.
Instead of:
+        boolean unique = false;
+        boolean positive = true;
...
+            executeSQLQuery(ASSERTION_FAILED, VALID_SQL_QUERIES[index],
+                    PrimitiveTypes.class, null, positive,
+                    parameterMap[index], expectedResult[index], unique);

it would be more obvious as:

...
+            executeSQLQuery(ASSERTION_FAILED, VALID_SQL_QUERIES[index],
+                    PrimitiveTypes.class, null, true,
+                    parameterMap[index], expectedResult[index], false);

But if you want to combine both the "self-describing parameter" and the "self-describing value"
concepts you could do this:
+        boolean uniqueFalse = false;
+        boolean positiveTrue = true;
...
+            executeSQLQuery(ASSERTION_FAILED, VALID_SQL_QUERIES[index],
+                    PrimitiveTypes.class, null, positiveTrue,
+                    parameterMap[index], expectedResult[index], uniqueFalse);

Just an idea.

> SQL query : executeWithMap test
> -------------------------------
>
>                 Key: JDO-378
>                 URL: https://issues.apache.org/jira/browse/JDO-378
>             Project: JDO
>          Issue Type: Test
>          Components: tck2
>    Affects Versions: JDO 2 final
>            Reporter: Andy Jefferson
>         Assigned To: Michelle Caisse
>            Priority: Minor
>             Fix For: JDO 2 maintenance release 1
>
>         Attachments: jdo-378-2.patch, jdo-378.patch
>
>
> SQL queries when executed using executeWithMap() should check that the Map contains keys
of type Integer and with values starting at 1. There don't seem to be any tests for SQL Query.executeWithMap
in the TCK (as I just found out performing such a query with JPOX and getting an incorrect
result) and so would be a good addition for any maintenance release. JPOX CVS now supports
this behaviour btw.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message