Regression test for issue #41.
()
| 2250 | |
| 2251 | /** Regression test for issue #41. */ |
| 2252 | @Test |
| 2253 | public void regression41() throws Exception { |
| 2254 | client.setFlushInterval(SLOW_FLUSH); |
| 2255 | final byte[] table = TestIntegration.table.getBytes(); |
| 2256 | final byte[] key = "cnt".getBytes(); |
| 2257 | final byte[] family = TestIntegration.family.getBytes(); |
| 2258 | final byte[] qual = { 'q' }; |
| 2259 | final DeleteRequest del = new DeleteRequest(table, key, family, qual); |
| 2260 | del.setBufferable(false); |
| 2261 | client.delete(del).join(); |
| 2262 | final int iterations = 100000; |
| 2263 | for (int i = 0; i < iterations; i++) { |
| 2264 | bufferIncrement(table, key, family, qual, 1); |
| 2265 | } |
| 2266 | client.flush().joinUninterruptibly(); |
| 2267 | final GetRequest get = new GetRequest(table, key) |
| 2268 | .family(family).qualifier(qual); |
| 2269 | final ArrayList<KeyValue> kvs = client.get(get).join(); |
| 2270 | assertSizeIs(1, kvs); |
| 2271 | assertEquals(iterations, Bytes.getLong(kvs.get(0).value())); |
| 2272 | } |
| 2273 | |
| 2274 | private static <T> void assertSizeIs(final int size, |
| 2275 | final Collection<T> list) { |
nothing calls this directly
no test coverage detected