public class PatternRuleXmlCreatorTest extends TestCase {
public void testToXML() throws IOException {
PatternRuleId ruleId = new PatternRuleId("DEMO_RULE");
PatternRuleXmlCreator creator = new PatternRuleXmlCreator();
String xml = creator.toXML(ruleId, new Demo());
assertEquals(
"<rule id=\"DEMO_RULE\" name=\"Find 'foo bar'\"><!-- a trivial demo rule that matches \"foo\" followed by \"bar\" -->\n" +
" <pattern case_sensitive=\"no\">\n" +
" <token>foo</token>\n" +
" <token>bar</token>\n" +