Permalink
Browse files

Add test for #329

  • Loading branch information...
1 parent 39432e6 commit 960d835f3c26c55c3af00ecd88baf941f1070497 @patricioe patricioe committed Feb 18, 2012
Showing with 14 additions and 1 deletion.
  1. +14 −1 core/src/test/java/me/prettyprint/hector/api/HFactoryTest.java
@@ -12,15 +12,18 @@
package me.prettyprint.hector.api;
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.*;
import static org.junit.Assert.fail;
import org.junit.Test;
+import me.prettyprint.cassandra.serializers.LongSerializer;
+import me.prettyprint.cassandra.serializers.StringSerializer;
import me.prettyprint.cassandra.service.clock.MicrosecondsClockResolution;
import me.prettyprint.cassandra.service.clock.MicrosecondsSyncClockResolution;
import me.prettyprint.cassandra.service.clock.MillisecondsClockResolution;
import me.prettyprint.cassandra.service.clock.SecondsClockResolution;
+import me.prettyprint.hector.api.beans.HColumn;
import me.prettyprint.hector.api.factory.HFactory;
/**
@@ -44,4 +47,14 @@ public void testCreateClockResolution() throws Exception {
assertTrue(HFactory.createClockResolution(ClockResolution.MICROSECONDS_SYNC)
instanceof MicrosecondsSyncClockResolution);
}
+
+ @Test
+ public void testCreateColumn() {
+ long clock = HFactory.createClock();
+ HColumn<String, Long> col = HFactory.createColumn("nameString", new Long("345"), clock);
+ HColumn<String, Long> col2 = HFactory.createColumn("nameString", new Long("345"), clock, StringSerializer.get(), LongSerializer.get());
+ assertEquals(col.getName(), col2.getName());
+ assertEquals(col.getValue(), col2.getValue());
+ assertEquals(col.getClock(), col2.getClock());
+ }
}

0 comments on commit 960d835

Please sign in to comment.