[
https://issues.apache.org/jira/browse/JDO-390?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12485706
]
Andy Jefferson commented on JDO-390:
------------------------------------
Don't totally understand what this test is checking for :-
The comments say "This tests that when a Date field is selected and modified,
there is no change in the owned instance.". I interpret this as saying that if
I do a query and get a Date field back then if I change that Date, the object
in the datastore that it relates to doesnt pick up that change. i.e the Date
returned by the Query is not attached to anything.
OK, but the test actually gets a Date in that way and then sets the Date field
of a Company object to be this returned Date and checks if the Company object
is now dirty. JPOX has actually marked the Company as dirty (even though the
date has the same value - which is a minor bug since we should avoid any
unnessary datastore update, and I'll fix that), but it is not consistent with
the comments of the test.
Should the test not be getting the Date back from the Query, then change the
Date "time" value, and then retrieve the Company to see if it was updated ?
(this would then be consistent with the other test in that file which does that
with an embedded field).
> JPOX fails new test: change to projected Date field is reflected in the
> database
> --------------------------------------------------------------------------------
>
> Key: JDO-390
> URL: https://issues.apache.org/jira/browse/JDO-390
> Project: JDO
> Issue Type: Bug
> Components: tck2
> Affects Versions: JDO 2 maintenance release 1
> Reporter: Michelle Caisse
> Assigned To: Andy Jefferson
> Fix For: JDO 2 maintenance release 1
>
>
> Changes to a projected SCO should not be persisted to the data store. JPOX
> persists changes to a projected Date field in the new
> query.result.ProjectedSCODoesNotTrackChanges test.
>
> [java] 1)
> testDateField(org.apache.jdo.tck.query.result.ProjectedSCODoesNotTrackChanges)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 23 21:53:29 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.query.result.ProjectedSCODoesNotTrackChanges.testDateField(ProjectedSCODoesNotTrackChanges.java:150)
> [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> [java] at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> [java] at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
> hodAccessorImpl.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)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.