Search in sources :

Example 1 with RunSharedCacheCleanerTaskResponsePBImpl

use of org.apache.hadoop.yarn.server.api.protocolrecords.impl.pb.RunSharedCacheCleanerTaskResponsePBImpl in project hadoop by apache.

the class TestSCMAdminProtocolService method testRunCleanerTaskCLI.

@Test
public void testRunCleanerTaskCLI() throws Exception {
    String[] args = { "-runCleanerTask" };
    RunSharedCacheCleanerTaskResponse rp = new RunSharedCacheCleanerTaskResponsePBImpl();
    rp.setAccepted(true);
    when(mockAdmin.runCleanerTask(isA(RunSharedCacheCleanerTaskRequest.class))).thenReturn(rp);
    assertEquals(0, adminCLI.run(args));
    rp.setAccepted(false);
    when(mockAdmin.runCleanerTask(isA(RunSharedCacheCleanerTaskRequest.class))).thenReturn(rp);
    assertEquals(1, adminCLI.run(args));
    verify(mockAdmin, times(2)).runCleanerTask(any(RunSharedCacheCleanerTaskRequest.class));
}
Also used : RunSharedCacheCleanerTaskResponse(org.apache.hadoop.yarn.server.api.protocolrecords.RunSharedCacheCleanerTaskResponse) RunSharedCacheCleanerTaskResponsePBImpl(org.apache.hadoop.yarn.server.api.protocolrecords.impl.pb.RunSharedCacheCleanerTaskResponsePBImpl) RunSharedCacheCleanerTaskRequest(org.apache.hadoop.yarn.server.api.protocolrecords.RunSharedCacheCleanerTaskRequest) Test(org.junit.Test)

Aggregations

RunSharedCacheCleanerTaskRequest (org.apache.hadoop.yarn.server.api.protocolrecords.RunSharedCacheCleanerTaskRequest)1 RunSharedCacheCleanerTaskResponse (org.apache.hadoop.yarn.server.api.protocolrecords.RunSharedCacheCleanerTaskResponse)1 RunSharedCacheCleanerTaskResponsePBImpl (org.apache.hadoop.yarn.server.api.protocolrecords.impl.pb.RunSharedCacheCleanerTaskResponsePBImpl)1 Test (org.junit.Test)1