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
Return to search
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
Michelle Caisse added a comment - 10/Jun/05 03:31 AM
This test passes if you run maven -o clean database -Dtest=extents.InstancesPersistedPriorToIterationReturned runtck.single,
but if you run the test a second time without cleaning the database, it fails.

Andy Jefferson added a comment - 13/Jun/05 04:59 PM
Should be fixed with JPOX nightly builds from 20050611 onwards

Craig Russell added a comment - 16/Jun/05 12:53 AM
This is a bug in the JPOX initialization of the superclass metadata. The Extent is constructed on Employee, which has two subclasses described in the metadata. JPOX only queries the database for classes that have been registered in the runtime environment instead of classes that are described in the metadata.

Andy Jefferson added a comment - 18/Jun/05 03:36 PM
Despite it being in the latest TCK meeting minutes that this fails, it STILL passes for me with latest JPOX builds.

Michelle Caisse added a comment - 27/Jul/05 07:18 AM
verified fixed

Michael Bouschen added a comment - 23/Apr/06 02:35 AM
Reopened to set the Fix Version/s field to JDO 2 beta.