Author: jbellis
Date: Tue May 24 16:29:12 2011
New Revision: 1127132
URL: http://svn.apache.org/viewvc?rev=1127132&view=rev
Log:
make DefsTest less fragile
patch by jbellis
Modified:
cassandra/branches/cassandra-0.7/test/unit/org/apache/cassandra/config/DefsTest.java
Modified:
cassandra/branches/cassandra-0.7/test/unit/org/apache/cassandra/config/DefsTest.java
URL:
http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/test/unit/org/apache/cassandra/config/DefsTest.java?rev=1127132&r1=1127131&r2=1127132&view=diff
==============================================================================
---
cassandra/branches/cassandra-0.7/test/unit/org/apache/cassandra/config/DefsTest.java
(original)
+++
cassandra/branches/cassandra-0.7/test/unit/org/apache/cassandra/config/DefsTest.java
Tue May 24 16:29:12 2011
@@ -436,15 +436,15 @@ public class DefsTest extends CleanupHel
assert !success : "This mutation should have failed since the CF no
longer exists.";
// reads should fail too.
+ boolean opened = false;
try
{
Table.open(ks.name);
+ opened = true;
}
- catch (Throwable th)
- {
- // this is what has historically happened when you try to open a
table that doesn't exist.
- assert th instanceof NullPointerException;
- }
+ catch (Throwable th) {}
+ if (opened)
+ throw new AssertionError("Opened dropped keyspace");
}
@Test
@@ -500,14 +500,15 @@ public class DefsTest extends CleanupHel
assert DefsTable.getFiles(newKs.name, cfName).size() > 0;
// read on old should fail.
+ boolean opened = false;
try
{
Table.open(oldKs.name);
+ opened = true;
}
- catch (Throwable th)
- {
- assert th instanceof NullPointerException;
- }
+ catch (Throwable th) {}
+ if (opened)
+ throw new AssertionError("Opened dropped keyspace");
// write on old should fail.
rm = new RowMutation(oldKs.name, ByteBufferUtil.bytes("any key will
do"));