Hi,

please find the patch for the 4 nontransactional read errors.

This patch fixes 3 classes as agreed. The fix for class "HollowInstanceMaintainsPK" differs, because that test case is only applicable for application identity. For this reason, the fix skips the test if it is not run with application identity.

Additionally, the patch adds a method to class "JDO_Test" printing a message, if a test is run for an inapplicable indentity type.

Furthermore, the patch contains a fix in "maven.xml". There, the project class path misses the "target/classes" directory entry. As a consequence, class "JDO_Test" and all classes in package "...tck.util" are packaged with enhanced pc classes. Due to the fact that the jars with enhanced pc classes appear first in the classpath, changes in class "JDO_Test" and classes in package "...tck.util" only have an effect if the jars are deleted.

The statistics for a TCK run with this path:

Application identity:
Tests run: 350,  Failures: 8,  Errors: 65, Time: 215 seconds.

Datastore identity:
Tests run: 350,  Failures: 9,  Errors: 66, Time: 201 seconds.

Regards,
Michael
--
-------------------------------------------------------------------
Michael Watzek                  [EMAIL PROTECTED] Engineering GmbH
mailto:[EMAIL PROTECTED]        Buelowstr. 66
Tel.:  ++49/30/235 520 36       10783 Berlin - Germany
Fax.:  ++49/30/217 520 12       http://www.spree.de/
-------------------------------------------------------------------
Index: test/java/org/apache/jdo/tck/lifecycle/HollowInstanceMaintainsPK.java
===================================================================
--- test/java/org/apache/jdo/tck/lifecycle/HollowInstanceMaintainsPK.java       
(revision 202204)
+++ test/java/org/apache/jdo/tck/lifecycle/HollowInstanceMaintainsPK.java       
(working copy)
@@ -58,7 +58,13 @@
     /** */
     public void test() {
         if (!isApplicationIdentitySupported()) {
-            if (debug) logger.debug("Application Identity is not supported");
+            printUnsupportedOptionalFeatureNotTested(
+                    "HollowInstanceMaintainsPK", 
+                    "javax.jdo.option.ApplicationIdentity");
+        } else if (!runsWithApplicationIdentity()) {
+            printNonApplicableIdentityType(
+                    "HollowInstanceMaintainsPK", 
+                    "javax.jdo.option.ApplicationIdentity");
         }
         else {
             pm = getPM();
@@ -67,6 +73,10 @@
             PCRect obj = getPersistentNewInstance();
             long beforeValue=obj.getId();
             pm.currentTransaction().commit(); // obj should transition to 
HOLLOW
+            //The next call obj.getId() is a primary key access.
+            //The method must not be called inside a transaction,
+            //because a JDO implementation must allow primary key accesses
+            //outside of transactions.
             long afterValue=obj.getId();
             if (beforeValue!=afterValue) {
                 fail(ASSERTION_FAILED,
Index: test/java/org/apache/jdo/tck/api/persistencemanager/cache/Retrieve.java
===================================================================
--- test/java/org/apache/jdo/tck/api/persistencemanager/cache/Retrieve.java     
(revision 202204)
+++ test/java/org/apache/jdo/tck/api/persistencemanager/cache/Retrieve.java     
(working copy)
@@ -98,6 +98,7 @@
             pm.retrieve(p3);
             pm.retrieve(rect);
             pm.makeTransient(p1);
+            pm.makeTransient(p3);
             pm.makeTransient(rect);
             tx.commit();
             tx = null;
Index: 
test/java/org/apache/jdo/tck/extents/IteratorHasNextFalseAfterExtentClose.java
===================================================================
--- 
test/java/org/apache/jdo/tck/extents/IteratorHasNextFalseAfterExtentClose.java  
    (revision 202204)
+++ 
test/java/org/apache/jdo/tck/extents/IteratorHasNextFalseAfterExtentClose.java  
    (working copy)
@@ -69,8 +69,10 @@
             ex.close(it3);
             rollbackTransaction();
     
+            beginTransaction();
             Iterator it4 = ex.iterator();
             int count4 = countIterator(it4);
+            rollbackTransaction();
             if (debug) logger.debug ("Iterator4 after rollback: " + count4);
     
             if (it1.hasNext()) {
Index: test/java/org/apache/jdo/tck/extents/Iterators.java
===================================================================
--- test/java/org/apache/jdo/tck/extents/Iterators.java (revision 202204)
+++ test/java/org/apache/jdo/tck/extents/Iterators.java (working copy)
@@ -57,10 +57,12 @@
         Extent ex = getExtent();
     
         int count = 0;
+        beginTransaction();
         for (Iterator it = ex.iterator(); it.hasNext();++count) {
             Object emp = it.next();
             if (debug) logger.debug(emp.toString());
         }
+        rollbackTransaction();
     
         if (count != 2) {
             fail(ASSERTION_FAILED,
Index: test/java/org/apache/jdo/tck/JDO_Test.java
===================================================================
--- test/java/org/apache/jdo/tck/JDO_Test.java  (revision 202204)
+++ test/java/org/apache/jdo/tck/JDO_Test.java  (working copy)
@@ -809,4 +809,23 @@
         return APPLICATION_IDENTITY.equals(identitytype);
     }
     
+    /** 
+     * Prints a message (if debug is true) saying the test with the
+     * specified name is not executed, because the JDO implementation under
+     * test is run for an inapplicable identity type. 
+     * @param testName the name of the test method that is skipped.
+     * @param requiredIdentityType the name of the required identity type.
+     */
+    protected void printNonApplicableIdentityType(
+        String testName, String requiredIdentityType) {
+        if (debug) {
+            logger.debug(
+                "Test " + testName + 
+                " was not run, because it is only applicable for identity type 
" + 
+                requiredIdentityType + 
+                ". The identity type of the current configuration is " +
+                identitytype);
+        }
+    }
+
 }
Index: maven.xml
===================================================================
--- maven.xml   (revision 202204)
+++ maven.xml   (working copy)
@@ -409,7 +409,7 @@
         <pathelement 
location="${jdo.tck.enhanced.dir}/${jdo.tck.identitytype}/${jdo.tck.identitytype}.jar"/>
         <!-- Directory where JDOTCK class files are located  -->
         <pathelement 
location="${jdo.tck.enhanced.dir}/${jdo.tck.identitytype}"/>
-        <!-- <pathelement location="${jdo.tck.testclasses.dir}"/> -->
+        <pathelement location="${jdo.tck.testclasses.dir}"/>
         <!-- JDO jar file  -->
         <pathelement location="${jdo.jdoapi.jarfile}"/>
         <!-- Jar files for the implementation to be tested -->

Reply via email to