Search in sources :

Example 1 with StatusRequest

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);
}
Also used : StatusRequest(org.apache.cassandra.repair.messages.StatusRequest) UUID(java.util.UUID) AbstractRepairTest(org.apache.cassandra.repair.AbstractRepairTest) Test(org.junit.Test)

Example 2 with StatusRequest

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);
}
Also used : StatusRequest(org.apache.cassandra.repair.messages.StatusRequest) StatusResponse(org.apache.cassandra.repair.messages.StatusResponse) UUID(java.util.UUID) AbstractRepairTest(org.apache.cassandra.repair.AbstractRepairTest) Test(org.junit.Test)

Example 3 with StatusRequest

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);
}
Also used : StatusRequest(org.apache.cassandra.repair.messages.StatusRequest) StatusResponse(org.apache.cassandra.repair.messages.StatusResponse) UUID(java.util.UUID) AbstractRepairTest(org.apache.cassandra.repair.AbstractRepairTest) Test(org.junit.Test)

Aggregations

UUID (java.util.UUID)3 AbstractRepairTest (org.apache.cassandra.repair.AbstractRepairTest)3 StatusRequest (org.apache.cassandra.repair.messages.StatusRequest)3 Test (org.junit.Test)3 StatusResponse (org.apache.cassandra.repair.messages.StatusResponse)2