db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c..@apache.org
Subject svn commit: r209010 - in /incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanagerfactory: AfterCloseGetPMThrowsException.java Close.java
Date Mon, 04 Jul 2005 03:57:24 GMT
Author: clr
Date: Sun Jul  3 20:57:20 2005
New Revision: 209010

URL: http://svn.apache.org/viewcvs?rev=209010&view=rev
Log:
JDO-77 add more detailed failure message instead of error

Modified:
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanagerfactory/AfterCloseGetPMThrowsException.java
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanagerfactory/Close.java

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanagerfactory/AfterCloseGetPMThrowsException.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanagerfactory/AfterCloseGetPMThrowsException.java?rev=209010&r1=209009&r2=209010&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanagerfactory/AfterCloseGetPMThrowsException.java
(original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanagerfactory/AfterCloseGetPMThrowsException.java
Sun Jul  3 20:57:20 2005
@@ -16,6 +16,7 @@
  
 package org.apache.jdo.tck.api.persistencemanagerfactory;
 
+import javax.jdo.JDOFatalUserException;
 import javax.jdo.JDOUserException;
 
 import org.apache.jdo.tck.JDO_Test;
@@ -63,14 +64,19 @@
             pmf.close();
             pm = pmf.getPersistenceManager();
             fail(ASSERTION_FAILED,
-                 "pmf.getPersistenceManager should throw JDOUserException if pmf is closed.");
+                "pmf.getPersistenceManager should throw JDOUserException if pmf is closed.");
         } catch (JDOUserException ex) {
             // expected exception
             if (debug)
                 logger.debug("caught expected exception " + ex.toString());
-        } finally { 
+        } catch (JDOFatalUserException ex) {
+            // unexpected exception
+            fail(ASSERTION_FAILED, 
+                "Wrong exception thrown from getPersistenceManager after close.\n" +
+                    "Expected JDOUserException, got JDOFatalUserException.");
+        } finally {
             if (pm != null) 
-                pm.close();
+            pm.close();
         }
     }
 }

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanagerfactory/Close.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanagerfactory/Close.java?rev=209010&r1=209009&r2=209010&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanagerfactory/Close.java
(original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanagerfactory/Close.java
Sun Jul  3 20:57:20 2005
@@ -16,6 +16,7 @@
  
 package org.apache.jdo.tck.api.persistencemanagerfactory;
 
+import javax.jdo.JDOFatalUserException;
 import javax.jdo.JDOUserException;
 
 import org.apache.jdo.tck.JDO_Test;
@@ -59,8 +60,14 @@
                 "JDOUserException was not thrown when calling pmf.getPersistenceManager()
after pmf was closed");
         } catch (JDOUserException ex) {
             // expected exception
-            if (debug)
+            if (debug) {
                 logger.debug("caught expected exception " + ex.toString());
+            }
+        } catch (JDOFatalUserException ex) {
+            // unexpected exception
+            fail(ASSERTION_FAILED, 
+                "Wrong exception thrown from getPersistenceManager after close.\n" +
+                    "Expected JDOUserException, got JDOFatalUserException.");
         }
     }
 }



Mime
View raw message