db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c..@apache.org
Subject svn commit: r686260 - /db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/FlushThrowsIfReadOnly.java
Date Fri, 15 Aug 2008 15:51:52 GMT
Author: clr
Date: Fri Aug 15 08:51:52 2008
New Revision: 686260

URL: http://svn.apache.org/viewvc?rev=686260&view=rev
Log:
JDO-597 fix tests to fail if error; thanks, Andy

Modified:
    db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/FlushThrowsIfReadOnly.java

Modified: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/FlushThrowsIfReadOnly.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/FlushThrowsIfReadOnly.java?rev=686260&r1=686259&r2=686260&view=diff
==============================================================================
--- db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/FlushThrowsIfReadOnly.java
(original)
+++ db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/FlushThrowsIfReadOnly.java
Fri Aug 15 08:51:52 2008
@@ -94,6 +94,9 @@
         try {
             pm.makePersistent(comp);
             pm.flush();
+            fail("When the PersistenceManagerFactory is read only, " +
+                    "flush of a persistent-new instance must throw " +
+                    "JDOReadOnlyException.");
         } catch (JDOReadOnlyException jDOReadOnlyException) {
             // good catch
         }
@@ -106,13 +109,16 @@
     /** */
     public void testUpdate() {
         //Try to update and flush the transaction
-        pm = getPM();
+        pm = pmf2.getPersistenceManager();
         Transaction tx = pm.currentTransaction();
         tx.begin();
         Company comp = (Company)pm.getObjectById(oid);
         try {
             comp.setName("new name");
             pm.flush();
+            fail("When the PersistenceManagerFactory is read only, " +
+                    "flush of an updated instance must throw " +
+                    "JDOReadOnlyException.");
         } catch (JDOReadOnlyException jDOReadOnlyException) {
             // good catch
         }
@@ -125,13 +131,16 @@
     /** */
     public void testDeletePersistent() {
         //Try to deletePersistent and flush the transaction
-        pm = getPM();
+        pm = pmf2.getPersistenceManager();
         Transaction tx = pm.currentTransaction();
         tx.begin();
         Company comp = (Company)pm.getObjectById(oid);
         try {
             pm.deletePersistent(comp);
             pm.flush();
+            fail("When the PersistenceManagerFactory is read only, " +
+                    "flush of a persistent-deleted instance must throw " +
+                    "JDOReadOnlyException.");
         } catch (JDOReadOnlyException jDOReadOnlyException) {
             // good catch
         }



Mime
View raw message