Issue Details (XML | Word | Printable)

Key: JDO-159
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Michael Watzek
Reporter: Michael Watzek
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
JDO

Implement new JDO 2 query tests cases concerning new supported methods.

Created: 04/Oct/05 08:08 PM   Updated: 19/Oct/05 07:30 PM
Return to search
Component/s: tck2
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works JDO-159.patch 2005-10-06 11:59 PM Michael Watzek 24 kB
File Licensed for inclusion in ASF works JDO-159.patch2 2005-10-15 12:53 AM Michael Watzek 50 kB
File Licensed for inclusion in ASF works JDO-159.patch3 2005-10-18 06:31 PM Michael Watzek 50 kB

Resolution Date: 19/Oct/05 07:30 PM


 Description  « Hide
 We need 4 new test classes, one for each of the following assertions:

- A14.6.2-46: Supported Map methods.
- A14.6.2-47: New supported String methods.
- A14.6.2-48: Supported Math methods.
- A14.6.2-49: Supported JDOHelper methods.

Details can be found on Wiki page http://wiki.apache.org/jdo/QueryTests#NewSupportedMethods.


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Michael Watzek added a comment - 06/Oct/05 11:59 PM
This patch implements the assertions above. It depends on patches of JDO-156 and JDO-168. For this reason, these patches must be checked in first.

Michael Bouschen added a comment - 13/Oct/05 06:33 PM
A few comments.

Class SupportedStringMethods:
- Typo (Map instead of String) in the title: "Supported Map methods"
- How about using a different expression for the indexOf tests? We could run a Department query checking its name. There is a Department called 'Development'. This name includes two 'e' which allows us to test whether indexOf with a fromIndex skips the first letters:
  name.indexOf('e') == 1
  name.indexOf('e', 2) == 3
- The array expectedResult is a list of names of result instances and not the result itself, correct? You might want to add this to the javadoc of the field.

Class SupportedMathMethods:
- Would it make sense to use the pc class PrimitiveTypes for testing the Math methods abs and sqrt? This would allow calling abs for int and double fields and AFAIK there are instances with negative field values.

Class SupportedJDOHelperMethods:
- How about adding another test query that calls JDOHelper.getObjectId in the filter:
  SELECT FROM Person WHERE JDOHelper.getObjectId(this) == oid PARAMETERS Object oid

No comments for class SupportedMapMethods.

Michael Watzek added a comment - 15/Oct/05 12:53 AM
The second patch contains the comments above.

Michael Bouschen added a comment - 17/Oct/05 05:54 PM
I looked at the second patch, just two comments about class SupportedStringMethods:
- I think the filter of the matches test query should be firstname.matches('.*First').
- How about adding two other test queries for matches: one using a dot that shouldmatch any character and another query using (?i) for case insensitive matching?

Michael Watzek added a comment - 18/Oct/05 06:31 PM
The third patch contains the comments above.

Michael Bouschen added a comment - 19/Oct/05 03:29 AM
One comment about the query testing method matches: I'm afraid the argument 'emp1(?i)FIRST' is not portable. The spec talks about "global (?i) for case-insensitive matches. I think global in this context means it is used for the entire matches argument.

I propose to change the query to use '(?i)EMP1FIRST' instead. Other than that the patch looks good and is ready for checkin.

Michael Watzek added a comment - 19/Oct/05 07:30 PM
I incorporated the proposed change above into the "matches" test and checked in all files (Revision 326519).