|
[
Permlink
| « Hide
]
Michael Watzek added a comment - 26/Oct/05 10:21 PM
The attached patch implements the assertions above.
A lot of new test cases. They look good, just a few comments:
QueryTest: The new method takes an expected result and assumes an negative test if the expected result is null. This is ok, but it needs to be documented that we always pass an object array as expected result even in case of unique queries. GetFetchPlan Please adapt the javadoc of method checkFetchGroup2. You could that the method installs a new fetch group which loads a different field as the DFG. So jdoPostLoad will store different values into the transient fields which is then checked by the test case. SingleStringQuery I'm wondering about the values in the expectedResult array. The first entry represents the result of the first query being executes. The second entry represents the names of the Employee instances and not the employee instances itself. Do you need to convert the expected result (by calling method getCompanyModelInstances) before passing it to the second execute call? NewNamedQuery: Methods testPositive and testNegative seem to check the modifiable flag of the created query instances. Should this really be part of test NewNamedQuery, since class UnmodifiableQuery already covers this. The second patch implements the comments above.
The second patch looks good.
The second patch has been checked in (Revision 331850).
The third patch fixes 2 issues reported by Andy on jdo-dev:
1. MetadataSearchOrder.testPackageJDOQuery - this complains about not finding the "jdoquery" file. By my understanding the jdoquery file is not being placed in the "enhanced" directory, and hence JPOX would be working miracles to find it. Can you check ? 2. SingleStringQuery.testPositive - this uses IMPORT in capitals. Should be lowercase Additionally, the third patch fixes failing comparisons on object arrays. Moreover, it fixes toString() issues concerning object arrays. A few comments about thr third patch (
Class QueryTest: - Method equals(Object, Object) could check for identical instances first: if (o1 == o2) { result = true; } else ... - In the last else if block we know o1 is null, so there is no need to call equals. I propose to replace the last else if block with } else { result = (o1 == o2); } - How about adding javadoc for the new equalsXXX methods? I think it is important to note that the arguments passed to methods equalsObjectArray, equalsCollectione, qualsMap and contains must not be null. Class SingleStringQuery: - The patch removes the variable singleStringQuery, but the execute call a couple of lines later takes the variable as argument. The query as stored in singleStringQuery does not reflect the executed query, because the string defines a result. ConversionHelper - Method toUtilDate takes a Local instance which is not used, instead it uses Locale.US. - I propose to rename convertsElementsOfTypeObjectArray to convertObjectArrayElements. - I propose to replace method toCollection with Object[] convertObjectArrayElements(Object[]) and let the caller covert the returned Object[] into a collection. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||