Package org.jostraca

Examples of org.jostraca.Generator.generate()


    PropertySet ps = new PropertySet();
    ps.set( Property.main_MakeBackup,        Standard.NO  );
    ps.set( Property.main_CompileCodeWriter, Standard.NO );
    ps.set( Property.main_ExecuteCodeWriter, Standard.NO );
    g.setCmdPropertySet( ps );
    Template tm = g.generate( FileUtil.findFile( "org/jostraca/test/simple.jtm" ) );

    // get full properties
    PropertySet mergedps = tm.getMergedPropertySet();
    assertEquals( ".jostraca", mergedps.get( Property.main_WorkFolder ) );
View Full Code Here


    ps = new PropertySet();
    ps.set( Property.main_MakeBackup,        Standard.NO  );
    ps.set( Property.main_CompileCodeWriter, Standard.YES );
    ps.set( Property.main_ExecuteCodeWriter, Standard.YES );
    g.setCmdPropertySet( ps );
    tm = g.generate( FileUtil.findFile( "org/jostraca/test/simple.jtm" ) );

    assertEquals("[.\\simple.txt]", tm.getSavedFiles().toString() );
  }

}
View Full Code Here

    PropertySet ps = new PropertySet();
    ps.set( Property.main_MakeBackup,        Standard.NO  );
    ps.set( Property.main_CompileCodeWriter, Standard.YES );
    ps.set( Property.main_ExecuteCodeWriter, Standard.YES );
    g.setCmdPropertySet( ps );
    Template tm = g.generate( FileUtil.findFile( "org/jostraca/test/simple.jtm" ) );

    RecordingUserMessageHandler rumh = (RecordingUserMessageHandler) g.getUserMessageHandler();
    assertTrue( null != rumh );
    assertEquals( 7, ((Vector)rumh.get( UserMessageHandler.DEBUG )).size() );
    assertEquals( 2, ((Vector)rumh.get( UserMessageHandler.INFO  )).size() );
View Full Code Here

    ps.set( Property.parse_OpenInnerChar,    Standard.COLON );
    ps.set( Property.parse_CloseInnerChar,   Standard.COLON );
    ps.set( Property.main_CompileCodeWriter, Standard.YES );
    ps.set( Property.main_ExecuteCodeWriter, Standard.YES );
    g.setCmdPropertySet( ps );
    g.generate( FileUtil.findFile( "org/jostraca/test/parse.jtm" ) );

    RecordingUserMessageHandler rumh = (RecordingUserMessageHandler) g.getUserMessageHandler();
    assertTrue( null != rumh );
    //System.out.println( rumh );
    assertEquals( 7, ((Vector)rumh.get( UserMessageHandler.DEBUG )).size() );
View Full Code Here

    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() );
View Full Code Here

    // 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() );
View Full Code Here

    g.setCmdPropertySet( ps );
   
    String c = "context";
    g.setContext( c );

    g.generate( FileUtil.findFile( "org/jostraca/test/context.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() );
View Full Code Here

    // 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/context.jtm" ), new RecordingUserMessageHandler() );

    rumh = (RecordingUserMessageHandler) g.getUserMessageHandler();
    assertTrue( null != rumh );
    //System.out.println( rumh );
    assertEquals( 6, ((Vector)rumh.get( UserMessageHandler.DEBUG )).size() );
View Full Code Here

    }

    Generator   g  = new Generator();
    PropertySet ps = Jostraca.parseCommandLine( "-Bcg -Dfoo=bar", new ArrayList(), new ArrayList() );
    g.setCmdPropertySet( ps );
    Template tm = g.generate( FileUtil.findFile( "org/jostraca/test/cmdargs.jtm" ) );

    RecordingUserMessageHandler rumh = (RecordingUserMessageHandler) g.getUserMessageHandler();
    assertTrue( null != rumh );
    //System.out.println( rumh );
    assertEquals( 7, ((Vector)rumh.get( UserMessageHandler.DEBUG )).size() );
View Full Code Here

    PropertySet ps = new PropertySet();
    ps.set( Property.main_MakeBackup,        Standard.NO  );
    ps.set( Property.main_CompileCodeWriter, Standard.NO );
    ps.set( Property.main_ExecuteCodeWriter, Standard.NO );
    g.setCmdPropertySet( ps );
    Template tm = g.generate( FileUtil.findFile( "org/jostraca/test/simple.jtm" ) );

    // get full properties
    PropertySet mergedps = tm.getMergedPropertySet();
    assertEquals( ".jostraca", mergedps.get( Property.main_WorkFolder ) );
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.