@Test
public void testXmlWriter() {

    DataPipe dataFormatter = new DataPipe();
    dataFormatter.getDataMap().put("var1", "var1val");
    dataFormatter.getDataMap().put("var2", "var2val");
    dataFormatter.getDataMap().put("var3", "var3val");
    dataFormatter.getDataMap().put("var4", "var4val");
    dataFormatter.getDataMap().put("var5", "var5val");
    String[] outTemplate = new String[]{
            "var1", "var2", "var3", "var4", "var5"
    };
    XmlWriter xmlWriter = new XmlWriter(System.out, outTemplate, "root", "record");
    String expected = "<var1>var1val</var1><var2>var2val</var2><var3>var3val</var3>"
            + "<var4>var4val</var4><var5>var5val</var5>";
    Assert.assertEquals(5, dataFormatter.getDataMap().size());
    Assert.assertEquals(expected, xmlWriter.getXmlFormatted(dataFormatter.getDataMap()));
}