use of org.apache.cassandra.repair.messages.StatusRequest in project cassandra by apache.
the class LocalSessionTest method sendStatusRequest.
@Test
public void sendStatusRequest() throws Exception {
UUID sessionID = registerSession();
InstrumentedLocalSessions sessions = new InstrumentedLocalSessions();
sessions.start();
LocalSession session = sessions.prepareForTest(sessionID);
sessions.sentMessages.clear();
sessions.sendStatusRequest(session);
assertNoMessagesSent(sessions, PARTICIPANT1);
StatusRequest expected = new StatusRequest(sessionID);
assertMessagesSent(sessions, PARTICIPANT2, expected);
assertMessagesSent(sessions, PARTICIPANT3, expected);
}
use of org.apache.cassandra.repair.messages.StatusRequest in project cassandra by apache.
the class LocalSessionTest method handleStatusRequestNoSession.
@Test
public void handleStatusRequestNoSession() throws Exception {
InstrumentedLocalSessions sessions = new InstrumentedLocalSessions();
sessions.start();
sessions.sentMessages.clear();
UUID sessionID = UUIDGen.getTimeUUID();
sessions.handleStatusRequest(PARTICIPANT2, new StatusRequest(sessionID));
assertNoMessagesSent(sessions, PARTICIPANT1);
assertMessagesSent(sessions, PARTICIPANT2, new StatusResponse(sessionID, FAILED));
assertNoMessagesSent(sessions, PARTICIPANT3);
}
use of org.apache.cassandra.repair.messages.StatusRequest in project cassandra by apache.
the class LocalSessionTest method handleStatusRequest.
@Test
public void handleStatusRequest() throws Exception {
UUID sessionID = registerSession();
InstrumentedLocalSessions sessions = new InstrumentedLocalSessions();
sessions.start();
LocalSession session = sessions.prepareForTest(sessionID);
Assert.assertEquals(PREPARED, session.getState());
sessions.sentMessages.clear();
sessions.handleStatusRequest(PARTICIPANT2, new StatusRequest(sessionID));
assertNoMessagesSent(sessions, PARTICIPANT1);
assertMessagesSent(sessions, PARTICIPANT2, new StatusResponse(sessionID, PREPARED));
assertNoMessagesSent(sessions, PARTICIPANT3);
}
Aggregations