use of org.apache.hadoop.yarn.api.records.impl.pb.ContainerStatusPBImpl in project hadoop by apache.
the class TestProtocolRecords method testContainerStatus.
@Test
public void testContainerStatus() {
ContainerStatus status = Records.newRecord(ContainerStatus.class);
List<String> ips = Arrays.asList("127.0.0.1", "139.5.25.2");
status.setIPs(ips);
status.setHost("locahost123");
ContainerStatusPBImpl pb = new ContainerStatusPBImpl(((ContainerStatusPBImpl) status).getProto());
Assert.assertEquals(ips, pb.getIPs());
Assert.assertEquals("locahost123", pb.getHost());
status.setIPs(null);
Assert.assertNull(status.getIPs());
}
Aggregations