throws IOException
{
File reportDir = new File( "." );
String testName = "aTestMethod";
String testName2 = "bTestMethod";
reportEntry = new SimpleReportEntry( this.getClass().getName(), testName, 12 );
WrappedReportEntry testSetReportEntry =
new WrappedReportEntry( reportEntry, ReportEntryType.success, 12, null, null );
expectedReportFile = new File( reportDir, "TEST-" + testName + ".xml" );
stats.testSucceeded( testSetReportEntry );
StackTraceWriter stackTraceWriter = new DeserializedStacktraceWriter( "A fud msg", "trimmed", "fail at foo" );
Utf8RecodingDeferredFileOutputStream stdOut = new Utf8RecodingDeferredFileOutputStream( "fds" );
String stdOutPrefix;
String stdErrPrefix;
if ( defaultCharsetSupportsSpecialChar() )
{
stdErrPrefix = "std-\u0115rr";
stdOutPrefix = "st]]>d-o\u00DCt";
}
else
{
stdErrPrefix = "std-err";
stdOutPrefix = "st]]>d-out";
}
byte[] stdOutBytes = (stdOutPrefix + "<null>!\u0020\u0000\u001F").getBytes();
stdOut.write( stdOutBytes, 0, stdOutBytes.length );
Utf8RecodingDeferredFileOutputStream stdErr = new Utf8RecodingDeferredFileOutputStream( "fds" );
byte[] stdErrBytes = (stdErrPrefix + "?&-&£\u0020\u0000\u001F").getBytes();
stdErr.write( stdErrBytes, 0, stdErrBytes.length );
WrappedReportEntry t2 =
new WrappedReportEntry( new SimpleReportEntry( Inner.class.getName(), testName2, stackTraceWriter, 13 ),
ReportEntryType.error, 13, stdOut, stdErr );
stats.testSucceeded( t2 );
StatelessXmlReporter reporter = new StatelessXmlReporter( new File( "." ), null, false );
reporter.testSetCompleted( testSetReportEntry, stats );