-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jdo 709 #20
Conversation
/** | ||
* PCRect2'S ObjectId class. | ||
*/ | ||
public static class Oid implements Serializable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this Oid
class?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need an Oid class for applicationidentity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I replaced the Oid class by using SingleFieldIdentity. Now the RCRectString metadata defines javax.jdo.identity.LongIdentity as ObjectId class.
@@ -38,7 +38,7 @@ | |||
|
|||
<!-- TCK Loggers --> | |||
|
|||
<Logger name="org.apache.jdo.tck" level="info" additivity="false"> | |||
<Logger name="org.apache.jdo.tck" level="debug" additivity="false"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That looks like an unrelated change. Is it intended?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! This change is not intended. I will revert this.
* | ||
* @author Michael Bouschen | ||
*/ | ||
public class PCRect2 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we call it PCRectString
or something instead of PCRect2
? That may be more descriptive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea!
tck/src/main/java/org/apache/jdo/tck/pc/mylib/PCRectString.java
Outdated
Show resolved
Hide resolved
tck/src/main/java/org/apache/jdo/tck/pc/mylib/PCRectString.java
Outdated
Show resolved
Hide resolved
tck/src/main/java/org/apache/jdo/tck/pc/mylib/PCRectString.java
Outdated
Show resolved
Hide resolved
tck/src/main/java/org/apache/jdo/tck/pc/mylib/PCRectString.java
Outdated
Show resolved
Hide resolved
tck/src/main/java/org/apache/jdo/tck/pc/mylib/PCRectString.java
Outdated
Show resolved
Hide resolved
tck/src/main/java/org/apache/jdo/tck/pc/mylib/PCRectString.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Tobias Bouschen <tobias.bouschen@googlemail.com>
… removed code in comment Co-authored-by: Tobias Bouschen <tobias.bouschen@googlemail.com>
… for PCRectString class Co-authored-by: Tilmann <tilmannz@apache.org>
Co-authored-by: Tobias Bouschen <tobias.bouschen@googlemail.com> Co-authored-by: Tobias Bouschen <tobias.bouschen@googlemail.com>
* PersistenceCapable class to test JDO AttributeConverter interface. | ||
* It#s fields of type Point are converted to strins in the datastore. | ||
* | ||
* @author Michael Bouschen |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally, @author tags are not used in Apache code anywhere.
- Added separate test cases for storing and reading a PCRectString instance - Added new test case for modifying a PCRectString instance - AttributeConverter implementation moved from static nested class of PCRectString to util package - Added helper method to create PCRectString instances to TCK test class - Removed author tag
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.
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.