Repository: cassandra
Updated Branches:
  refs/heads/trunk c946cbf18 -> 630d3b9c7


use junit assertions


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/630d3b9c
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/630d3b9c
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/630d3b9c

Branch: refs/heads/trunk
Commit: 630d3b9c777e4b9e371300f9b3578312412970d0
Parents: c946cbf
Author: Dave Brosius <dbros...@mebigfatguy.com>
Authored: Tue Mar 4 21:44:34 2014 -0500
Committer: Dave Brosius <dbros...@mebigfatguy.com>
Committed: Tue Mar 4 21:44:34 2014 -0500

----------------------------------------------------------------------
 .../db/compaction/CompactionsPurgeTest.java         | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/630d3b9c/test/unit/org/apache/cassandra/db/compaction/CompactionsPurgeTest.java
----------------------------------------------------------------------
diff --git 
a/test/unit/org/apache/cassandra/db/compaction/CompactionsPurgeTest.java 
b/test/unit/org/apache/cassandra/db/compaction/CompactionsPurgeTest.java
index 42445b5..11c4402 100644
--- a/test/unit/org/apache/cassandra/db/compaction/CompactionsPurgeTest.java
+++ b/test/unit/org/apache/cassandra/db/compaction/CompactionsPurgeTest.java
@@ -36,6 +36,8 @@ import static org.junit.Assert.assertEquals;
 import static org.apache.cassandra.db.KeyspaceTest.assertColumns;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
 
 import static org.apache.cassandra.cql3.QueryProcessor.processInternal;
 
@@ -89,7 +91,7 @@ public class CompactionsPurgeTest extends SchemaLoader
         cfs.invalidateCachedRow(key);
         ColumnFamily cf = 
cfs.getColumnFamily(QueryFilter.getIdentityFilter(key, cfName, 
System.currentTimeMillis()));
         assertColumns(cf, "5");
-        assert cf.getColumn(cellname(String.valueOf(5))) != null;
+        assertNotNull(cf.getColumn(cellname(String.valueOf(5))));
     }
 
     @Test
@@ -140,7 +142,7 @@ public class CompactionsPurgeTest extends SchemaLoader
         // verify that minor compaction does GC when key is provably not
         // present in a non-compacted sstable
         ColumnFamily cf = 
cfs.getColumnFamily(QueryFilter.getIdentityFilter(key2, cfName, 
System.currentTimeMillis()));
-        assert cf == null;
+        assertNull(cf);
 
         // verify that minor compaction still GC when key is present
         // in a non-compacted sstable but the timestamp ensures we won't miss 
anything
@@ -219,13 +221,13 @@ public class CompactionsPurgeTest extends SchemaLoader
             rm.apply();
         }
         cfs.forceBlockingFlush();
-        assert cfs.getSSTables().size() == 1 : cfs.getSSTables(); // inserts & 
deletes were in the same memtable -> only deletes in sstable
+        assertEquals(String.valueOf(cfs.getSSTables()), 1, 
cfs.getSSTables().size()); // inserts & deletes were in the same memtable -> 
only deletes in sstable
 
         // compact and test that the row is completely gone
         Util.compactAll(cfs, Integer.MAX_VALUE).get();
-        assert cfs.getSSTables().isEmpty();
+        assertTrue(cfs.getSSTables().isEmpty());
         ColumnFamily cf = 
keyspace.getColumnFamilyStore(cfName).getColumnFamily(QueryFilter.getIdentityFilter(key,
 cfName, System.currentTimeMillis()));
-        assert cf == null : cf;
+        assertNull(String.valueOf(cf), cf);
     }
 
     @Test
@@ -273,7 +275,7 @@ public class CompactionsPurgeTest extends SchemaLoader
         ColumnFamily cf = 
cfs.getColumnFamily(QueryFilter.getIdentityFilter(key, cfName, 
System.currentTimeMillis()));
         assertEquals(10, cf.getColumnCount());
         for (Cell c : cf)
-            assert !c.isMarkedForDelete(System.currentTimeMillis());
+            assertFalse(c.isMarkedForDelete(System.currentTimeMillis()));
     }
 
     @Test
@@ -317,7 +319,7 @@ public class CompactionsPurgeTest extends SchemaLoader
         cf = cfs.getColumnFamily(filter);
         assertEquals(10, cf.getColumnCount());
         for (Cell c : cf)
-            assert !c.isMarkedForDelete(System.currentTimeMillis());
+            assertFalse(c.isMarkedForDelete(System.currentTimeMillis()));
     }
 
     @Test

Reply via email to