| 398 | } |
| 399 | |
| 400 | @Test |
| 401 | public void importFileMSTimestamp() throws Exception { |
| 402 | String data = |
| 403 | "sys.cpu.user 1356998400500 24 host=web01\n" + |
| 404 | "sys.cpu.user 1356998400500 42 host=web02"; |
| 405 | setData(data); |
| 406 | Integer points = (Integer)importFile.invoke(null, client, tsdb, "file", false); |
| 407 | assertEquals(2, (int)points); |
| 408 | |
| 409 | byte[] row = new byte[] { 0, 0, 1, 0x50, (byte) 0xE2, 0x27, 0, |
| 410 | 0, 0, 1, 0, 0, 1}; |
| 411 | byte[] value = storage.getColumn(row, new byte[] { (byte) 0xF0, 0, 0x7D, 0 }); |
| 412 | assertNotNull(value); |
| 413 | assertEquals(24, value[0]); |
| 414 | row = new byte[] { 0, 0, 1, 0x50, (byte) 0xE2, 0x27, 0, |
| 415 | 0, 0, 1, 0, 0, 2}; |
| 416 | value = storage.getColumn(row, new byte[] { (byte) 0xF0, 0, 0x7D, 0 }); |
| 417 | assertNotNull(value); |
| 418 | assertEquals(42, value[0]); |
| 419 | } |
| 420 | |
| 421 | @Test (expected = IllegalArgumentException.class) |
| 422 | public void importFileMSTimestampTooBig() throws Exception { |