Search in sources :

Example 1 with AgentProcessStatusChangeRequest

use of alluxio.hub.proto.AgentProcessStatusChangeRequest in project alluxio by Alluxio.

the class AgentManagerServiceTest method testAgentRestartAction.

@Test
public void testAgentRestartAction() throws Exception {
    AgentProcessStatusChangeRequest r = AgentProcessStatusChangeRequest.newBuilder().setNodeType(AlluxioNodeType.MASTER).setAction(ProcessStateChange.RESTART).build();
    mClient.processStatusChange(r);
    verify(mLauncher).stop(AlluxioNodeType.MASTER);
    verify(mLauncher).start(AlluxioNodeType.MASTER);
}
Also used : AgentProcessStatusChangeRequest(alluxio.hub.proto.AgentProcessStatusChangeRequest) Test(org.junit.Test) BaseHubTest(alluxio.hub.test.BaseHubTest)

Example 2 with AgentProcessStatusChangeRequest

use of alluxio.hub.proto.AgentProcessStatusChangeRequest in project alluxio by Alluxio.

the class AgentManagerServiceTest method testStateChangeThrowException.

@Test
public void testStateChangeThrowException() throws Exception {
    doThrow(new IOException("spied")).when(mContext).changeState(ArgumentMatchers.any(), ArgumentMatchers.any());
    AgentProcessStatusChangeRequest r = AgentProcessStatusChangeRequest.newBuilder().setNodeType(AlluxioNodeType.MASTER).setAction(ProcessStateChange.RESTART).build();
    assertThrows(StatusRuntimeException.class, () -> {
        mClient.processStatusChange(r);
    });
}
Also used : AgentProcessStatusChangeRequest(alluxio.hub.proto.AgentProcessStatusChangeRequest) IOException(java.io.IOException) Test(org.junit.Test) BaseHubTest(alluxio.hub.test.BaseHubTest)

Example 3 with AgentProcessStatusChangeRequest

use of alluxio.hub.proto.AgentProcessStatusChangeRequest in project alluxio by Alluxio.

the class AgentManagerServiceTest method testAgentStartAction.

@Test
public void testAgentStartAction() throws Exception {
    AgentProcessStatusChangeRequest r = AgentProcessStatusChangeRequest.newBuilder().setNodeType(AlluxioNodeType.MASTER).setAction(ProcessStateChange.START).build();
    mClient.processStatusChange(r);
    verify(mLauncher).start(AlluxioNodeType.MASTER);
}
Also used : AgentProcessStatusChangeRequest(alluxio.hub.proto.AgentProcessStatusChangeRequest) Test(org.junit.Test) BaseHubTest(alluxio.hub.test.BaseHubTest)

Example 4 with AgentProcessStatusChangeRequest

use of alluxio.hub.proto.AgentProcessStatusChangeRequest in project alluxio by Alluxio.

the class AgentManagerServiceTest method testAgentStopAction.

@Test
public void testAgentStopAction() throws Exception {
    AgentProcessStatusChangeRequest r = AgentProcessStatusChangeRequest.newBuilder().setNodeType(AlluxioNodeType.MASTER).setAction(ProcessStateChange.STOP).build();
    mClient.processStatusChange(r);
    verify(mLauncher).stop(AlluxioNodeType.MASTER);
}
Also used : AgentProcessStatusChangeRequest(alluxio.hub.proto.AgentProcessStatusChangeRequest) Test(org.junit.Test) BaseHubTest(alluxio.hub.test.BaseHubTest)

Aggregations

AgentProcessStatusChangeRequest (alluxio.hub.proto.AgentProcessStatusChangeRequest)4 BaseHubTest (alluxio.hub.test.BaseHubTest)4 Test (org.junit.Test)4 IOException (java.io.IOException)1