Write a single thing to HBase and read it back.
()
| 157 | |
| 158 | /** Write a single thing to HBase and read it back. */ |
| 159 | @Test |
| 160 | public void putRead() throws Exception { |
| 161 | client.setFlushInterval(FAST_FLUSH); |
| 162 | final double write_time = System.currentTimeMillis(); |
| 163 | final PutRequest put = new PutRequest(table, "k", family, "q", "val"); |
| 164 | final GetRequest get = new GetRequest(table, "k", family, "q"); |
| 165 | client.put(put).join(); |
| 166 | final ArrayList<KeyValue> kvs = client.get(get).join(); |
| 167 | assertSizeIs(1, kvs); |
| 168 | final KeyValue kv = kvs.get(0); |
| 169 | assertEq("k", kv.key()); |
| 170 | assertEq(family, kv.family()); |
| 171 | assertEq("q", kv.qualifier()); |
| 172 | assertEq("val", kv.value()); |
| 173 | final double kvts = kv.timestamp(); |
| 174 | assertEquals(write_time, kvts, 5000.0); // Within five seconds. |
| 175 | } |
| 176 | |
| 177 | /** Write a single thing to HBase and read it back, delete it, read it. */ |
| 178 | @Test |
nothing calls this directly
no test coverage detected