"utf-8");
String systemReportIpFilterXml = Files.forIO().readFrom(
getClass().getResourceAsStream("systemReportIpFilter.xml"), "utf-8");
MetricReport metricReport = DefaultSaxParser.parse(metricReportXml);
SystemReportConvertor convert = new SystemReportConvertor("system", null);
convert.visitMetricReport(metricReport);
MetricReport systemReportAllIp = convert.getReport();
Assert.assertEquals("Check all ip convert result!", systemReportAllIpXml.replace("\r", ""), systemReportAllIp
.toString().replace("\r", ""));
Set<String> ipAddrs = new HashSet<String>(Arrays.asList("10.254.251.60"));
SystemReportConvertor convertIpFilter = new SystemReportConvertor("system", ipAddrs);
convertIpFilter.visitMetricReport(metricReport);
MetricReport systemReportIpFilter = convertIpFilter.getReport();
Assert.assertEquals("Check all ip convert result!", systemReportIpFilterXml.replace("\r", ""),
systemReportIpFilter.toString().replace("\r", ""));
}