public void testIdentity()
throws IOException, ParseException
{
// generate the expected model
StringWriter writer = new StringWriter();
Sink sink = new TextSink( writer );
SinkTestDocument.generate( sink );
sink.close();
expected = writer.toString();
// write to file for comparison
Writer fileWriter = getTestWriter( "expected" );
fileWriter.write( expected );
IOUtil.close( fileWriter );
// generate the actual model
writer = new StringWriter();
sink = createSink( writer );
SinkTestDocument.generate( sink );
sink.close();
StringReader reader = new StringReader( writer.toString() );
writer = new StringWriter();
sink = new TextSink( writer );
Parser parser = createParser();
parser.enableLogging( new PlexusLoggerWrapper( getContainer().getLogger() ) );
parser.parse( reader, sink );
String actual = writer.toString();