Public Member Functions | |
void | testSetTime () |
Test method for CCNTime.setTime(long). | |
void | testSetNanos () |
Test method for CCNTime.setNanos(int). | |
void | testCCNTimeLong () |
Test method for CCNTime.CCNTime(long). | |
void | testCCNTimeTimestamp () |
Test method for CCNTime.CCNTime(java.sql.Timestamp). | |
void | testCCNTimeDate () |
Test method for CCNTime.CCNTime(java.util.Date). | |
void | testCCNTime () |
Test method for CCNTime.CCNTime(). | |
void | testCompareToDate () |
Test method for CCNTime.compareTo(java.util.Date). | |
void | testCompareToTimestamp () |
Test method for CCNTime.compareTo(java.sql.Timestamp). | |
void | testBeforeAfterTimestamp () |
Test method for CCNTime.before(java.sql.Timestamp) and CCNTime.after(java.sql.Timestamp). | |
void | testBeforeAfterDate () |
Test method for CCNTime.before(java.util.Date) and CCNTime.after(java.util.Date). | |
void | testNow () |
Test method for CCNTime.now(). | |
void | testBinaryArray () throws Exception |
void | testTimestamp (CCNTime ccnTime, Timestamp compareTS) |
Static Public Member Functions | |
static void | setUpBeforeClass () throws Exception |
static byte[] | timestampToBinaryTime12 (Timestamp timestamp) |
Old static quantized time interface. | |
static long | timestampToBinaryTime12AsLong (Timestamp timestamp) |
static Timestamp | binaryTime12ToTimestamp (byte[] binaryTime12) |
static Timestamp | binaryTime12ToTimestamp (long binaryTime12AsLong) |
static boolean | timestampEquals (Timestamp t1, Timestamp t2) |
Compare timestamps taking into account the resolution lost in the conversion above. | |
static Timestamp | roundTimestamp (Timestamp origTimestamp) |
Rounding function for timestamps. | |
Static Package Attributes | |
static int | NUM_RUNS = 10 |
static Random | random = new Random() |
static Timestamp | early |
static Timestamp | middle |
static Timestamp | late |
static Date | dearly |
static Date | dmiddle |
static Date | dlate |
static void org.ccnx.ccn.test.protocol.CCNTimeTest.setUpBeforeClass | ( | ) | throws Exception [static] |
java.lang.Exception |
static byte [] org.ccnx.ccn.test.protocol.CCNTimeTest.timestampToBinaryTime12 | ( | Timestamp | timestamp | ) | [static] |
Old static quantized time interface.
Move here as "ground truth", as we know it is compatible with the C side; use it to test against. Converts a timestamp into a fixed point representation, with 12 bits in the fractional component, and adds this to the ContentName as a version field. The timestamp is rounded to the nearest value in the fixed point representation.
This allows versions to be recorded as a timestamp with a 1/4096 second accuracy.