StatelessXmlReporter reporter = new StatelessXmlReporter( new File( "." ), null, false );
reporter.testSetCompleted( testSetReportEntry, stats );
FileInputStream fileInputStream = new FileInputStream( expectedReportFile );
Xpp3Dom testSuite = Xpp3DomBuilder.build( new InputStreamReader( fileInputStream, "UTF-8") );
assertEquals( "testsuite", testSuite.getName() );
Xpp3Dom properties = testSuite.getChild( "properties" );
assertEquals( System.getProperties().size(), properties.getChildCount() );
Xpp3Dom child = properties.getChild( 1 );
assertFalse( StringUtils.isEmpty( child.getAttribute( "value" ) ) );
assertFalse( StringUtils.isEmpty( child.getAttribute( "name" ) ) );
Xpp3Dom[] testcase = testSuite.getChildren( "testcase" );
Xpp3Dom tca = testcase[0];
assertEquals( testName, tca.getAttribute( "name" ) ); // Hopefully same order on jdk5
assertEquals( "0.012", tca.getAttribute( "time" ) );
assertEquals( this.getClass().getName(), tca.getAttribute( "classname" ) );
Xpp3Dom tcb = testcase[1];
assertEquals( testName2, tcb.getAttribute( "name" ) );
assertEquals( "0.013", tcb.getAttribute( "time" ) );
assertEquals( Inner.class.getName(), tcb.getAttribute( "classname" ) );
Xpp3Dom errorNode = tcb.getChild( "error" );
assertNotNull( errorNode );
assertEquals( "A fud msg", errorNode.getAttribute( "message" ) );
assertEquals( "fail at foo", errorNode.getAttribute( "type" ) );
assertEquals( "std-o\u00DCt<null>!", tcb.getChild( "system-out" ).getValue() );
assertEquals( "std-\u0115rr?&-&£", tcb.getChild( "system-err" ).getValue() );
expectedReportFile.delete();
}