@Test
public void failedFile() throws ParserConfigurationException, SAXException, IOException {
TestNG tng = new TestNG();
tng.setVerbose(0);
Collection<XmlSuite> suites =
new Parser(new ByteArrayInputStream(XML.getBytes())).parse();
tng.setXmlSuites(Lists.newArrayList(suites));
TestListenerAdapter tla = new TestListenerAdapter();
File f = new File("/tmp");
tng.setOutputDirectory(f.getAbsolutePath());
tng.addListener(tla);
tng.run();
Collection<XmlSuite> failedSuites =
new Parser(new File(f, FailedReporter.TESTNG_FAILED_XML).getAbsolutePath()).parse();
XmlSuite failedSuite = failedSuites.iterator().next();
Assert.assertEquals("42", failedSuite.getParameter("n"));
XmlTest test = failedSuite.getTests().get(0);
Assert.assertEquals("43", test.getParameter("o"));