db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcai...@apache.org
Subject svn commit: r202226 - in /incubator/jdo/trunk/tck20: ./ test/java/org/apache/jdo/tck/ test/java/org/apache/jdo/tck/api/persistencemanager/cache/ test/java/org/apache/jdo/tck/extents/ test/java/org/apache/jdo/tck/lifecycle/
Date Tue, 28 Jun 2005 15:30:36 GMT
Author: mcaisse
Date: Tue Jun 28 08:30:34 2005
New Revision: 202226

URL: http://svn.apache.org/viewcvs?rev=202226&view=rev
Log:
patch for the 4 nontransactional read errors, plus fix to maven.xml. Submitted by Michael
Watzek

Modified:
    incubator/jdo/trunk/tck20/maven.xml
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/JDO_Test.java
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/cache/Retrieve.java
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/extents/IteratorHasNextFalseAfterExtentClose.java
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/extents/Iterators.java
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/lifecycle/HollowInstanceMaintainsPK.java

Modified: incubator/jdo/trunk/tck20/maven.xml
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/maven.xml?rev=202226&r1=202225&r2=202226&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/maven.xml (original)
+++ incubator/jdo/trunk/tck20/maven.xml Tue Jun 28 08:30:34 2005
@@ -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 -->

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/JDO_Test.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/JDO_Test.java?rev=202226&r1=202225&r2=202226&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/JDO_Test.java (original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/JDO_Test.java Tue Jun 28 08:30:34
2005
@@ -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);
+        }
+    }
+
 }

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/cache/Retrieve.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/cache/Retrieve.java?rev=202226&r1=202225&r2=202226&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/cache/Retrieve.java
(original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/cache/Retrieve.java
Tue Jun 28 08:30:34 2005
@@ -98,6 +98,7 @@
             pm.retrieve(p3);
             pm.retrieve(rect);
             pm.makeTransient(p1);
+            pm.makeTransient(p3);
             pm.makeTransient(rect);
             tx.commit();
             tx = null;

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/extents/IteratorHasNextFalseAfterExtentClose.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/extents/IteratorHasNextFalseAfterExtentClose.java?rev=202226&r1=202225&r2=202226&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/extents/IteratorHasNextFalseAfterExtentClose.java
(original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/extents/IteratorHasNextFalseAfterExtentClose.java
Tue Jun 28 08:30:34 2005
@@ -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()) {

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/extents/Iterators.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/extents/Iterators.java?rev=202226&r1=202225&r2=202226&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/extents/Iterators.java (original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/extents/Iterators.java Tue Jun
28 08:30:34 2005
@@ -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,

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/lifecycle/HollowInstanceMaintainsPK.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/lifecycle/HollowInstanceMaintainsPK.java?rev=202226&r1=202225&r2=202226&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/lifecycle/HollowInstanceMaintainsPK.java
(original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/lifecycle/HollowInstanceMaintainsPK.java
Tue Jun 28 08:30:34 2005
@@ -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,



Mime
View raw message