()
| 93 | } |
| 94 | |
| 95 | @Test |
| 96 | public void rowKeyFromTSUID() throws Exception { |
| 97 | final byte[] tsuid = { 0, 0, 1, 0, 0, 1, 0, 0, 2 }; |
| 98 | byte[] key = { 0, 0, 1, 0x50, (byte) 0xE2, 0x27, 0, 0, 0, 1, 0, 0, 2 }; |
| 99 | assertArrayEquals(key, RowKey.rowKeyFromTSUID(tsdb, tsuid, 1356998400)); |
| 100 | |
| 101 | // zero timestamp |
| 102 | key = new byte[] { 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2 }; |
| 103 | assertArrayEquals(key, RowKey.rowKeyFromTSUID(tsdb, tsuid, 0)); |
| 104 | |
| 105 | // negative timestamp; honey badger don't care |
| 106 | key = new byte[] { 0, 0, 1, -1, -21, 88, -128, 0, 0, 1, 0, 0, 2 }; |
| 107 | assertArrayEquals(key, RowKey.rowKeyFromTSUID(tsdb, tsuid, -1356998400)); |
| 108 | } |
| 109 | |
| 110 | @Test (expected = NullPointerException.class) |
| 111 | public void rowKeyFromTSUIDNullTsuid() throws Exception { |
nothing calls this directly
no test coverage detected