cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbros...@apache.org
Subject git commit: use junit assertions
Date Wed, 15 Jan 2014 21:54:12 GMT
Updated Branches:
  refs/heads/trunk 602dd62e5 -> 8b0906126


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/8b090612
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/8b090612
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/8b090612

Branch: refs/heads/trunk
Commit: 8b09061268a4ea94dd617ee53927d06560bbce8e
Parents: 602dd62
Author: Dave Brosius <dbrosius@mebigfatguy.com>
Authored: Wed Jan 15 16:53:47 2014 -0500
Committer: Dave Brosius <dbrosius@mebigfatguy.com>
Committed: Wed Jan 15 16:53:47 2014 -0500

----------------------------------------------------------------------
 .../org/apache/cassandra/cache/AutoSavingCacheTest.java     | 9 +++++----
 .../org/apache/cassandra/config/ColumnDefinitionTest.java   | 9 ++++-----
 2 files changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/8b090612/test/unit/org/apache/cassandra/cache/AutoSavingCacheTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/cache/AutoSavingCacheTest.java b/test/unit/org/apache/cassandra/cache/AutoSavingCacheTest.java
index ef04746..28afef1 100644
--- a/test/unit/org/apache/cassandra/cache/AutoSavingCacheTest.java
+++ b/test/unit/org/apache/cassandra/cache/AutoSavingCacheTest.java
@@ -17,6 +17,7 @@
  */
 package org.apache.cassandra.cache;
 
+import org.junit.Assert;
 import org.junit.Test;
 
 import org.apache.cassandra.SchemaLoader;
@@ -43,7 +44,7 @@ public class AutoSavingCacheTest extends SchemaLoader
             cfs.forceBlockingFlush();
         }
 
-        assert cfs.getSSTables().size() == 2;
+        Assert.assertEquals(2, cfs.getSSTables().size());
 
         // preheat key cache
         for (SSTableReader sstable : cfs.getSSTables())
@@ -55,12 +56,12 @@ public class AutoSavingCacheTest extends SchemaLoader
         keyCache.submitWrite(keyCache.size()).get();
         keyCache.clear();
 
-        assert keyCache.size() == 0;
+        Assert.assertEquals(0, keyCache.size());
 
         // then load saved
         keyCache.loadSaved(cfs);
-        assert keyCache.size() == 2;
+        Assert.assertEquals(2, keyCache.size());
         for (SSTableReader sstable : cfs.getSSTables())
-            assert keyCache.get(new KeyCacheKey(cfs.metadata.cfId, sstable.descriptor, ByteBufferUtil.bytes("key1")))
!= null;
+            Assert.assertNotNull(keyCache.get(new KeyCacheKey(cfs.metadata.cfId, sstable.descriptor,
ByteBufferUtil.bytes("key1"))));
     }
 }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8b090612/test/unit/org/apache/cassandra/config/ColumnDefinitionTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/config/ColumnDefinitionTest.java b/test/unit/org/apache/cassandra/config/ColumnDefinitionTest.java
index 8cc543d..8ae2d5f 100644
--- a/test/unit/org/apache/cassandra/config/ColumnDefinitionTest.java
+++ b/test/unit/org/apache/cassandra/config/ColumnDefinitionTest.java
@@ -20,11 +20,10 @@ package org.apache.cassandra.config;
  *
  */
 
-
+import org.junit.Assert;
 import org.junit.Test;
 
 import org.apache.cassandra.config.CFMetaData;
-import org.apache.cassandra.db.ColumnFamilyType;
 import org.apache.cassandra.db.marshal.*;
 import org.apache.cassandra.utils.ByteBufferUtil;
 
@@ -47,8 +46,8 @@ public class ColumnDefinitionTest
     protected void testSerializeDeserialize(CFMetaData cfm, ColumnDefinition cd) throws Exception
     {
         ColumnDefinition newCd = ColumnDefinition.fromThrift(cfm, cd.toThrift());
-        assert cd != newCd;
-        assert cd.hashCode() == newCd.hashCode();
-        assert cd.equals(newCd);
+        Assert.assertNotSame(cd, newCd);
+        Assert.assertEquals(cd.hashCode(), newCd.hashCode());
+        Assert.assertEquals(cd, newCd);
     }
 }


Mime
View raw message