You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by jb...@apache.org on 2011/02/17 03:21:37 UTC

svn commit: r1071479 - /cassandra/trunk/test/unit/org/apache/cassandra/db/DefsTest.java

Author: jbellis
Date: Thu Feb 17 02:21:37 2011
New Revision: 1071479

URL: http://svn.apache.org/viewvc?rev=1071479&view=rev
Log:
make DefsTest less fragile
patch by jbellis

Modified:
    cassandra/trunk/test/unit/org/apache/cassandra/db/DefsTest.java

Modified: cassandra/trunk/test/unit/org/apache/cassandra/db/DefsTest.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/test/unit/org/apache/cassandra/db/DefsTest.java?rev=1071479&r1=1071478&r2=1071479&view=diff
==============================================================================
--- cassandra/trunk/test/unit/org/apache/cassandra/db/DefsTest.java (original)
+++ cassandra/trunk/test/unit/org/apache/cassandra/db/DefsTest.java Thu Feb 17 02:21:37 2011
@@ -443,15 +443,16 @@ public class DefsTest extends CleanupHel
         assert !success : "This mutation should have failed since the CF no longer exists.";
 
         // reads should fail too.
+        boolean threw = false;
         try
         {
             Table.open(ks.name);
         }
         catch (Throwable th)
         {
-            // this is what has historically happened when you try to open a table that doesn't exist.
-            assert th instanceof NullPointerException;
+            threw = true;
         }
+        assert threw;
     }
     
     @Test
@@ -486,14 +487,17 @@ public class DefsTest extends CleanupHel
         assert DefsTable.getFiles(newKs.name, cfName).size() > 0;
         
         // read on old should fail.
+        // reads should fail too.
+        boolean threw = false;
         try
         {
             Table.open(oldKs.name);
         }
         catch (Throwable th)
         {
-            assert th instanceof NullPointerException;
+            threw = true;
         }
+        assert threw;
         
         // write on old should fail.
         rm = new RowMutation(oldKs.name, ByteBufferUtil.bytes("any key will do"));