use of org.apache.geode.GemFireIOException in project geode by apache.
the class JGroupsMessengerJUnitTest method testWaitForMessageStateThrowsExceptionIfMessagesMissing.
@Test
public void testWaitForMessageStateThrowsExceptionIfMessagesMissing() throws Exception {
initMocks(true);
NAKACK2 nakack = mock(NAKACK2.class);
Digest digest = mock(Digest.class);
when(nakack.getDigest(any(Address.class))).thenReturn(digest);
when(digest.get(any(Address.class))).thenReturn(new long[] { 0, 0 }, new long[] { 2, 50 }, new long[] { 49, 50 });
try {
// message 50 will never arrive
Map state = new HashMap();
state.put("JGroups.mcastState", Long.valueOf(50));
InternalDistributedMember mbr = createAddress(1234);
messenger.scheduledMcastSeqnos.put(mbr, new JGroupsMessenger.MessageTracker(30));
messenger.waitForMessageState(mbr, state);
fail("expected a GemFireIOException to be thrown");
} catch (GemFireIOException e) {
// pass
}
}
Aggregations