### Question:
JmxConfigReader { public Collection<Report> generateReportsByJmxDatacollectionConfig(String jmxDatacollectionConfig) { Collection<Report> reports = new ArrayList<Report>(); JmxDatacollectionConfig inputConfig = JAXB.unmarshal(new File(jmxDatacollectionConfig), JmxDatacollectionConfig.class); for (JmxCollection jmxCollection : inputConfig.getJmxCollection()) { logger.debug("jmxCollection: '{}'", jmxCollection.getName()); Mbeans mbeans = jmxCollection.getMbeans(); for (Mbean mbean : mbeans.getMbean()) { reports.addAll(generateMbeanReportsByMBean(mbean)); reports.addAll(generateAttributeReporsByMBean(mbean)); reports.addAll(generateCompositeReportsByMBean(mbean)); reports.addAll(generateCompositeMemberReportsByMBean(mbean)); } } return reports; }  Collection<Report> generateReportsByJmxDatacollectionConfig(String jmxDatacollectionConfig);  }### Answer:
@Test public void testGenerateReportsByJmxDatacollectionConfig() { Collection<Report> reports = jmxConfigReader.generateReportsByJmxDatacollectionConfig("src/test/resources/test.xml"); Assert.assertEquals("read structure from test.xml", 7, reports.size()); reports = jmxConfigReader.generateReportsByJmxDatacollectionConfig("src/test/resources/JVM-Basics.xml"); Assert.assertEquals("read structure from JVM-Basics.xml", 117, reports.size()); reports = jmxConfigReader.generateReportsByJmxDatacollectionConfig("src/test/resources/jmx-datacollection-config.xml"); Assert.assertEquals("read structure from jmx-datacollection-config.xml", 139, reports.size()); }
@Test public void testVelociteyRun() { Collection<Report> reports = jmxConfigReader.generateReportsByJmxDatacollectionConfig("src/test/resources/JVM-Basics.xml"); String snmpGraphConfig = graphConfigGenerator.generateSnmpGraph(reports, "src/main/resources/graphTemplate.vm"); System.out.println(snmpGraphConfig); }