mboapache opened a new pull request #20:
URL: https://github.com/apache/db-jdo/pull/20


   This pull request adds a TCK test case for the AttributeConverter interface. 
   
   The persistent capable class PCRect2 has two fields of type Point. A point 
consists of two integer fields (x, y) and is not persistent capable. Each 
PCRect2 point instance is mapped to a string of the form "x:y". So the DB 
schema for PCRect2 has two VARCHAR columns. PCRect2 has a static nested class 
PointToStringConverter that implements the JDO AttributeConverter interface and 
implements the conversion from a point to a string and vice versa.
   
   The TCK Test class AttributeConverterTest has two test methods. 
   1.  The first method creates a PCRect2 instance, stores it and reads it back 
from the datastore. It make sure the point instances in the PCRect2 instance 
retrieved from the datastore are equal to the original point instances.
   2. The second test method creates some PCRect2 instances and runs a query 
with a point instance as query parameter.
   
   The AttributeConverter implementation has static fields to count the number 
of converter calls. This allows the test class to check whether the converter 
methods are called.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to