use of org.apache.hadoop.yarn.server.api.protocolrecords.NodeHeartbeatRequest in project hadoop by apache.
the class TestResourceTrackerPBClientImpl method testNodeHeartbeat.
/**
* Test the method nodeHeartbeat. Method should return a not null result.
*
*/
@Test
public void testNodeHeartbeat() throws Exception {
NodeHeartbeatRequest request = recordFactory.newRecordInstance(NodeHeartbeatRequest.class);
assertNotNull(client.nodeHeartbeat(request));
ResourceTrackerTestImpl.exception = true;
try {
client.nodeHeartbeat(request);
fail("there should be YarnException");
} catch (YarnException e) {
assertTrue(e.getMessage().startsWith("testMessage"));
} finally {
ResourceTrackerTestImpl.exception = false;
}
}
use of org.apache.hadoop.yarn.server.api.protocolrecords.NodeHeartbeatRequest in project hadoop by apache.
the class TestYSCRecordFactory method testPbRecordFactory.
@Test
public void testPbRecordFactory() {
RecordFactory pbRecordFactory = RecordFactoryPBImpl.get();
try {
NodeHeartbeatRequest request = pbRecordFactory.newRecordInstance(NodeHeartbeatRequest.class);
Assert.assertEquals(NodeHeartbeatRequestPBImpl.class, request.getClass());
} catch (YarnRuntimeException e) {
e.printStackTrace();
Assert.fail("Failed to crete record");
}
}
Aggregations