Permalink
Browse files

More test coverage for TimeUUIDUtils

  • Loading branch information...
1 parent 960d835 commit ffef3dbd893460a2b4f4fb9d1443925ea8488c19 @patricioe patricioe committed Feb 28, 2012
Showing with 10 additions and 0 deletions.
  1. +10 −0 core/src/test/java/me/prettyprint/cassandra/utils/TimeUUIDUtilsTest.java
@@ -69,6 +69,16 @@ public void testTimeUUIDAsByteBuffer() {
}
@Test
+ public void testDateUUIDConversion() {
+ long originalTime = System.currentTimeMillis();
+ Date originalDate = new Date(originalTime);
+ UUID originalUUID = TimeUUIDUtils.getTimeUUID(originalTime);
+ long currentTime = TimeUUIDUtils.getTimeFromUUID(originalUUID);
+ assertEquals(originalTime, currentTime);
+ assertEquals(originalDate, new Date(currentTime));
+ }
+
+ @Test
public void testTimestampConsistency() {
final long originalTime = System.currentTimeMillis();

0 comments on commit ffef3db

Please sign in to comment.