Issue Details (XML | Word | Printable)

Key: JDO-61
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Erik Bengtson
Reporter: Craig Russell
Votes: 0
Watchers: 0
Operations

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

Test InstancesPersistedPriorToIterationReturned fails. The new instance is not part of the iteration.

Created: 09/Jun/05 08:45 AM   Updated: 23/Apr/06 02:38 AM
Component/s: tck2
Affects Version/s: None
Fix Version/s: JDO 2 beta

Time Tracking:
Not Specified

Environment: JPOX

Resolution Date: 23/Apr/06 02:38 AM


 Description  « Hide
The test output indicates that instances persisted before an iterator is obtained are not included in the iteration. This appears to be a JPOX bug.

    public void test() {

        try {
            beginTransaction();
            getPM().setIgnoreCache(false);
            Extent ex = getPM().getExtent (Employee.class, true);
            addEmployee();
            Iterator it = ex.iterator();
            int count = countIterator(it);
            rollbackTransaction();

            beginTransaction();
            Iterator it2 = ex.iterator();
            int count2 = countIterator(it2);
            commitTransaction();
    
            if (count != 3) {
                fail(ASSERTION_FAILED,
                     "Iterator: " + count + " should be 3");
            }
            if (count2 != 2) {
                fail(ASSERTION_FAILED,
                     "Iterator2: " + count2 + "should be 2");
            }
        }
        finally {
        }
    }

    [echo] Run TCK test org.apache.jdo.tck.extents.InstancesPersistedPriorToIterationReturned on the RI with configuration /Users/clr/apachejdo/jdo/trunk/tck20/test/conf/applicationidentity.conf
    [java] [DEBUG] tck - Found company
    [java] [DEBUG] tck - Iterator: 2 should be 3
    [java] [ERROR] tck - Exception during setUp or runtest: <junit.framework.AssertionFailedError: Assertion A15.3-2 (InstancesPersistedPriorToIterationReturned) failed:
    [java] RUN InstancesPersistedPriorToIterationReturned.test FAILURE
    [java] Iterator: 2 should be 3>junit.framework.AssertionFailedError: Assertion A15.3-2 (InstancesPersistedPriorToIterationReturned) failed:
    [java] Iterator: 2 should be 3
    [java] at junit.framework.Assert.fail(Assert.java:47)
    [java] at org.apache.jdo.tck.JDO_Test.fail(JDO_Test.java:510)
    [java] Time: 33.099
    [java] at org.apache.jdo.tck.extents.InstancesPersistedPriorToIterationReturned.test(InstancesPersistedPriorToIterationReturned.java:74)
    [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [java] There was 1 failure:
    [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    [java] 1) test(org.apache.jdo.tck.extents.InstancesPersistedPriorToIterationReturned)junit.framework.AssertionFailedError: Assertion A15.3-2 (InstancesPersistedPriorToIterationReturned) failed:
    [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    [java] at java.lang.reflect.Method.invoke(Method.java:324)
    [java] Iterator: 2 should be 3
    [java] at org.apache.jdo.tck.JDO_Test.fail(JDO_Test.java:510)
    [java] at junit.framework.TestCase.runTest(TestCase.java:154)
    [java] at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:181)
    [java] at junit.framework.TestResult$1.protect(TestResult.java:106)
    [java] at org.apache.jdo.tck.extents.InstancesPersistedPriorToIterationReturned.test(InstancesPersistedPriorToIterationReturned.java:74)
    [java] at junit.framework.TestResult.runProtected(TestResult.java:124)
    [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    [java] at junit.framework.TestResult.run(TestResult.java:109)
    [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    [java] at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:181)
    [java] at junit.framework.TestCase.run(TestCase.java:118)
    [java] at junit.framework.TestSuite.runTest(TestSuite.java:208)
    [java] at org.apache.jdo.tck.util.BatchTestRunner.run(BatchTestRunner.java:75)
    [java] at org.apache.jdo.tck.util.BatchTestRunner.run(BatchTestRunner.java:70)
    [java] at junit.framework.TestSuite.run(TestSuite.java:203)
    [java] at junit.textui.TestRunner.doRun(TestRunner.java:116)
    [java] at org.apache.jdo.tck.extents.InstancesPersistedPriorToIterationReturned.main(InstancesPersistedPriorToIterationReturned.java:53)
    [java] at junit.textui.TestRunner.doRun(TestRunner.java:109)
    [java] at org.apache.jdo.tck.util.BatchTestRunner.run(BatchTestRunner.java:75)
    [java] FAILURES!!!
    [java] Tests run: 1, Failures: 1, Errors: 0
    [java] at org.apache.jdo.tck.util.BatchTestRunner.run(BatchTestRunner.java:70)
    [java] at org.apache.jdo.tck.extents.InstancesPersistedPriorToIterationReturned.main(InstancesPersistedPriorToIterationReturned.java:53)
    [java]
    [java] [DEBUG] tck - Free memory: 9774832


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Craig Russell made changes - 16/Jun/05 12:54 AM
Field Original Value New Value
Assignee Erik Bengtson [ ebengtso ]
Michelle Caisse made changes - 27/Jul/05 07:18 AM
Resolution Fixed [ 1 ]
Status Open [ 1 ] Closed [ 6 ]
Michael Bouschen made changes - 23/Apr/06 02:35 AM
Status Closed [ 6 ] Reopened [ 4 ]
Resolution Fixed [ 1 ]
Michael Bouschen made changes - 23/Apr/06 02:38 AM
Fix Version/s JDO 2 beta [ 12310683 ]
Status Reopened [ 4 ] Closed [ 6 ]
Resolution Fixed [ 1 ]