|
[
Permlink
| « Hide
]
Michelle Caisse added a comment - 09/Jun/06 01:02 AM
This test will be added as a method in org.apache.jdo.tck.models.embedded.SecondClassObjectsTrackTheirChanges.
The proposal is:
Projected SCOs are never owned, projected FCOs are always managed. Modifying unowned SCOs never has an effect on the database. Modifying FCOs no matter how you get them always has an effect if the tx commits. See attached patch for this issue. I have added a method to test changing a projected embedded field and another method that tests changing a projected Date field. Only these methods are new, but the entire file is in the diff because I changed tabs to spaces and broke long lines.
JPOX passes the new test for embedded fields but fails on a Date field: [java] 1) testDateField(org.apache.jdo.tck.models.embedded.SecondClassObjectsTrackTheirChanges)junit.framework.AssertionFailedError: [java] Expected Company instance not to be dirty; actual state is {persistent, transactional, dirty} [java] Expected projected field value is Fri Jun 16 04:29:21 PDT 2006; actual value is Wed Dec 31 16:02:03 PST 1969 [java] [java] at org.apache.jdo.tck.JDO_Test.failOnError(JDO_Test.java:1052) [java] at org.apache.jdo.tck.models.embedded.SecondClassObjectsTrackTheirChanges.testDateField(SecondClassObjectsTrackTheirChanges.java:233) [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [java] at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:237) [java] at org.apache.jdo.tck.util.BatchTestRunner.doRun(BatchTestRunner.java:107) [java] at org.apache.jdo.tck.util.BatchTestRunner.start(BatchTestRunner.java:147) [java] at org.apache.jdo.tck.util.BatchTestRunner.main(BatchTestRunner.java:122) As suggested by Michael Bouschen, I have moved the new test methods to a new file in query.result. The new file is attached.
Looks good. Just one comment.
The javadoc comment on testDateField should not refer to embedded but to mutable SCO or Date field. Looks good. A few comments:
- Please break the long line in the class javadoc comment. - Would it make sense to make method getPersistentNewInstance private? - The following comment might be confusing because the modification is not stored in teh database. // Select address/date, modify, and persist - Both test methods testEmbeddedField and testDateField execute the same query twice. There is no need to call pm.newQuery again and specify exactly the same query. You can just call query.execute after staring the third transaction. I made the suggested changes and checked in the new test file. I added the test to conf/query.conf. Revision: 416861
I will leave the issue open until the correct assertion number is available to be entered in the source file comments. Updated assertion number and text with revision: 465685
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||