### Question:
ThriftReportServer extends ThriftServer implements
    ThriftFlumeReportServer.Iface { @Override public Map<String, ThriftFlumeReport> getAllReports() throws TException { Map<String, ThriftFlumeReport> retMap = new HashMap<String, ThriftFlumeReport>(); ReportManager reportManager = ReportManager.get(); Map<String, Reportable> reports = reportManager.getReportables(); for (Entry<String, Reportable> e : reports.entrySet()) { ThriftFlumeReport report = reportToThrift(e.getValue().getReport()); retMap.put(e.getKey(), report); } return retMap; } 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 testGetAllReports() throws TException { TTransport transport = new TSocket("localhost", PORT); TProtocol protocol = new TBinaryProtocol(transport); transport.open(); ThriftFlumeReportServer.Client client = new ThriftFlumeReportServer.Client( protocol); Map<String, ThriftFlumeReport> ret = client.getAllReports(); assertTrue(ret.size() == 1); ThriftFlumeReport rep = ret.get("reportable1"); assertNotNull("Report 'reportable1' 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); }