internal_txt.delete();
}
// just compile first
RecordingUserMessageHandler rumh = null;
Generator g = new Generator();
PropertySet ps = new PropertySet();
ps.set( Property.main_MakeBackup, Standard.NO );
ps.set( Property.main_CompileCodeWriter, Standard.YES );
ps.set( Property.main_ExecuteCodeWriter, Standard.NO );
g.setCmdPropertySet( ps );
g.generate( FileUtil.findFile( "org/jostraca/test/internal.jtm" ) );
rumh = (RecordingUserMessageHandler) g.getUserMessageHandler();
assertTrue( null != rumh );
//System.out.println( rumh );
assertEquals( 6, ((Vector)rumh.get( UserMessageHandler.DEBUG )).size() );
assertEquals( 1, ((Vector)rumh.get( UserMessageHandler.INFO )).size() );
assertEquals( 0, ((Vector)rumh.get( UserMessageHandler.WARN )).size() );
assertEquals( 0, ((Vector)rumh.get( UserMessageHandler.ERROR )).size() );
assertEquals( 0, ((Vector)rumh.get( UserMessageHandler.FATAL )).size() );
internal_txt = FileUtil.findFile( "org/jostraca/test/internal.txt" );
assertTrue( !internal_txt.exists() );
// and now execute
ps.set( Property.main_CompileCodeWriter, Standard.EMPTY );
ps.set( Property.main_ExecuteCodeWriter, Standard.YES );
g.setCmdPropertySet( ps );
g.generate( FileUtil.findFile( "org/jostraca/test/internal.jtm" ), new RecordingUserMessageHandler() );
rumh = (RecordingUserMessageHandler) g.getUserMessageHandler();
assertTrue( null != rumh );
//System.out.println( rumh );
assertEquals( 6, ((Vector)rumh.get( UserMessageHandler.DEBUG )).size() );
assertEquals( 2, ((Vector)rumh.get( UserMessageHandler.INFO )).size() );
assertEquals( 0, ((Vector)rumh.get( UserMessageHandler.WARN )).size() );