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"));