@Test public void writeXML() throws Exception { SourceMatcher sm = new SourceMatcher(fileName); String xmlOutput = writeXMLAndGetStringOutput(sm, false); assertEquals("<Source name=\"" + fileName + "\"/>", xmlOutput); sm = new SourceMatcher(fileName); xmlOutput = writeXMLAndGetStringOutput(sm, true); assertEquals("<Source name=\"" + fileName + "\" disabled=\"true\"/>", xmlOutput); }
@Override public void writeXML(XMLOutput xmlOutput, boolean disabled) throws IOException { XMLAttributeList attributes = new XMLAttributeList().addAttribute("name", fileName.getSpec()); if (disabled) { attributes.addAttribute("disabled", "true"); } xmlOutput.openCloseTag("Source", attributes); }
SourceMatcher implements Matcher { @Override public void writeXML(XMLOutput xmlOutput, boolean disabled) throws IOException { XMLAttributeList attributes = new XMLAttributeList().addAttribute("name", fileName.getSpec()); if (disabled) { attributes.addAttribute("disabled", "true"); } xmlOutput.openCloseTag("Source", attributes); } }
SourceMatcher implements Matcher { @Override public void writeXML(XMLOutput xmlOutput, boolean disabled) throws IOException { XMLAttributeList attributes = new XMLAttributeList().addAttribute("name", fileName.getSpec()); if (disabled) { attributes.addAttribute("disabled", "true"); } xmlOutput.openCloseTag("Source", attributes); } SourceMatcher(String fileName); }
SourceMatcher implements Matcher { @Override public void writeXML(XMLOutput xmlOutput, boolean disabled) throws IOException { XMLAttributeList attributes = new XMLAttributeList().addAttribute("name", fileName.getSpec()); if (disabled) { attributes.addAttribute("disabled", "true"); } xmlOutput.openCloseTag("Source", attributes); } SourceMatcher(String fileName); @Override String toString(); @Override boolean match(BugInstance bugInstance); @Override void writeXML(XMLOutput xmlOutput, boolean disabled); }
SourceMatcher implements Matcher { @Override public void writeXML(XMLOutput xmlOutput, boolean disabled) throws IOException { XMLAttributeList attributes = new XMLAttributeList().addAttribute("name", fileName.getSpec()); if (disabled) { attributes.addAttribute("disabled", "true"); } xmlOutput.openCloseTag("Source", attributes); } SourceMatcher(String fileName); @Override String toString(); @Override boolean match(BugInstance bugInstance); @Override void writeXML(XMLOutput xmlOutput, boolean disabled);  }