*
*/
public class TestShellRPCThrift {
@Test
public void testThriftStatusConversion() {
FlumeNodeStatusThrift start = new FlumeNodeStatusThrift();
start.host = "HOST";
long time = System.currentTimeMillis();
start.lastseen = time;
start.lastSeenDeltaMillis = time;
start.physicalNode = "PHYSICAL_NODE";
start.state = FlumeNodeState.ACTIVE;
NodeStatus middle = MasterAdminServerThrift.statusFromThrift(start);
assertEquals("HOST", middle.host);
assertEquals(start.lastseen, middle.lastseen);
assertEquals("PHYSICAL_NODE", middle.physicalNode);
assertEquals(NodeState.ACTIVE, middle.state);
FlumeNodeStatusThrift end = MasterAdminServerThrift.statusToThrift(middle);
assertEquals(end.host, start.host);
assertEquals(end.lastseen, start.lastseen);
assertEquals(end.physicalNode, start.physicalNode);
assertEquals(end.state, start.state);
}