use of org.apache.geode.internal.cache.partitioned.FetchEntriesMessage.FetchEntriesReplyMessage in project geode by apache.
the class FetchEntriesMessageJUnitTest method testProcessChunk.
@Test
public void testProcessChunk() throws Exception {
cache = Fakes.cache();
PartitionedRegion pr = mock(PartitionedRegion.class);
InternalDistributedSystem system = cache.getInternalDistributedSystem();
FetchEntriesResponse response = new FetchEntriesResponse(system, pr, null, 0);
HeapDataOutputStream chunkStream = createDummyChunk();
FetchEntriesReplyMessage reply = new FetchEntriesReplyMessage(null, 0, 0, chunkStream, 0, 0, 0, false, false);
reply.chunk = chunkStream.toByteArray();
response.processChunk(reply);
assertNull(response.returnRVV);
assertEquals(2, response.returnValue.size());
assertTrue(response.returnValue.get("keyWithOutVersionTag").equals("valueWithOutVersionTag"));
assertTrue(response.returnValue.get("keyWithVersionTag").equals("valueWithVersionTag"));
assertNull(response.returnVersions.get("keyWithOutVersionTag"));
assertNotNull(response.returnVersions.get("keyWithVersionTag"));
}
Aggregations