barrier2.await(10, TimeUnit.SECONDS); barrier2.await(10, TimeUnit.SECONDS); sentGet.expectResponse(address(2), UnsureResponse.INSTANCE).receive(); sentGet.expectResponse(address(1), UnsureResponse.INSTANCE).receive().finish();
sentGet.expectResponse(address(1));
blockedWrite.send().expectResponse(address(1), CacheNotFoundResponse.INSTANCE).receive();
/** * Wait for a {@code CacheNotFoundResponse} from {@code sender}, but keep the request blocked. */ public BlockedResponse expectLeaver(Address a) { return expectResponse(a, CacheNotFoundResponse.INSTANCE); }
/** * Wait for a response from {@code sender}, but keep the request blocked. */ public BlockedResponse expectResponse(Address sender, Response expectedResponse) { return expectResponse(sender, r -> assertEquals(expectedResponse, r)); }
/** * Wait for an {@code ExceptionResponse} from {@code sender}, but keep the request blocked. */ public BlockedResponse expectException(Address a, Class<? extends Exception> expectedException) { return expectResponse(a, r -> { Exception exception = ((ExceptionResponse) r).getException(); Exceptions.assertException(expectedException, exception); }); }