### Question:
ThriftReportServer extends ThriftServer implements
    ThriftFlumeReportServer.Iface { @Override public ThriftFlumeReport getReportByName(String reportName) throws TException { ReportManager reportManager = ReportManager.get(); Map<String, Reportable> reports = reportManager.getReportables(); if (reports.containsKey(reportName)) { return reportToThrift(reports.get(reportName).getReport()); } return null; } ThriftReportServer(FlumeConfiguration cfg);  ThriftReportServer(int port); static ThriftFlumeReport reportToThrift(ReportEvent report); @Override ThriftFlumeReport getReportByName(String reportName); @Override Map<String, ThriftFlumeReport> getAllReports(); void serve(); void stop();  }### Answer:
@Test public void testGetReportByName() throws TException { TTransport transport = new TSocket("localhost", PORT); TProtocol protocol = new TBinaryProtocol(transport); transport.open(); ThriftFlumeReportServer.Client client = new ThriftFlumeReportServer.Client( protocol); ThriftFlumeReport rep = client.getReportByName("reportable1"); assertNotNull("Report 'repotable1' not found", rep); assertTrue("Expected exactly one double metric", rep.getDoubleMetricsSize() == 1); assertTrue("Expected double metric to be equal to 0.5", rep .getDoubleMetrics().get("doubleAttr") == 0.5); }