@Test
public void testMasterAdminServer() throws IOException, TTransportException {
MyThriftServer server = new MyThriftServer();
server.serve();
AdminRPC client = new AdminRPCThrift("localhost", 56789);
LOG.info("Connected to test master");
long submit = client.submit(new Command(""));
Assert.assertEquals("Expected response was 42, got " + submit, submit, 42);
boolean succ = client.isSuccess(42);
Assert.assertEquals("Expected response was false, got " + succ, succ, false);
boolean fail = client.isFailure(42);
Assert.assertEquals("Expected response was true, got " + fail, fail, true);
Map<String, FlumeConfigData> cfgs = client.getConfigs();
Assert.assertEquals("Expected response was 0, got " + cfgs.size(), cfgs.size(), 0);
Map<String, List<String>> mappings = client.getMappings(null);
Assert.assertEquals("Expected response was 0 got " + mappings.size(), mappings
.size(), 0);
CommandStatus cs = client.getCommandStatus(1337);
assertEquals(1337, cs.getCmdID());
assertEquals("message", cs.getMessage());
Command cmd = cs.getCommand();
assertEquals("cmd", cmd.getCommand());
assertEquals("arg1", cmd.getArgs()[0]);