MCPcopy Create free account
hub / github.com/OpenTSDB/asynchbase / nullChannel

Method nullChannel

test/TestRegionClientDecode.java:999–1020  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

997 }
998
999 @Test
1000 public void nullChannel() throws Exception {
1001 // just shows we don't care about the channel either
1002 final int id = 42;
1003 final ChannelBuffer buffer = buildGoodResponse(true, id);
1004 final GetRequest get = new GetRequest(TABLE, ROW);
1005 final Deferred<Object> deferred = get.getDeferred();
1006 inflightTheRpc(id, get);
1007
1008 region_client.decode(ctx, null, buffer, VOID);
1009 @SuppressWarnings("unchecked")
1010 final List<KeyValue> kvs = (List<KeyValue>)deferred.joinUninterruptibly();
1011 assertEquals(1, kvs.size());
1012 assertArrayEquals(ROW, kvs.get(0).key());
1013 assertArrayEquals(FAMILY, kvs.get(0).family());
1014 assertArrayEquals(QUALIFIER, kvs.get(0).qualifier());
1015 assertArrayEquals(VALUE, kvs.get(0).value());
1016 assertEquals(TIMESTAMP, kvs.get(0).timestamp());
1017 assertEquals(1, timer.tasks.size());
1018 assertEquals(60000, (long)timer.tasks.get(0).getValue());
1019 verify(timer.timeouts.get(0), times(1)).cancel();
1020 }
1021
1022 @Test (expected = IndexOutOfBoundsException.class)
1023 public void emptyBuffer() throws Exception {

Callers

nothing calls this directly

Calls 11

buildGoodResponseMethod · 0.95
inflightTheRpcMethod · 0.95
decodeMethod · 0.80
keyMethod · 0.65
familyMethod · 0.65
qualifierMethod · 0.65
valueMethod · 0.65
timestampMethod · 0.65
getDeferredMethod · 0.45
sizeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected