public void writeCost(ViolationCost violation) throws SAXException {
write("L" + violation.getLocation().getLineNumber() + ",");
}
};
MethodCost methodCost = new MethodCost("", "methodName", 123, false, false, false);
methodCost.addCostSource(new GlobalCost(new SourceLocation(null, 123), null, Cost.global(1)));
methodCost.addCostSource(new CyclomaticCost(new SourceLocation(null, 234), Cost.cyclomatic(1)));
methodCost.addCostSource(new CyclomaticCost(new SourceLocation(null, 345), Cost.cyclomatic(1)));
methodCost.addCostSource(new GlobalCost(new SourceLocation(null, 456), null, Cost.global(1)));
methodCost.link();
report.writeCost(methodCost);
assertXMLEquals("<method cyclomatic=\"2\" global=\"2\" line=\"123\" "
+ "lod=\"0\" name=\"methodName\" overall=\"22\">L123,L234,L345,L456,</method>");
}