Package org.jostraca.util

Examples of org.jostraca.util.PropertySet




  public void testPerform() throws Exception {
    TemplateActionHandlerStub tahs  = new TemplateActionHandlerStub();
    PropertySet               ps    = new PropertySet();
    ps.load( Tools.findRelativeSystemPath( "conf/system.conf" ) );
    TextualTransformManagerTable   ttmt = new TextualTransformManagerTable( ps );

    BasicUnitList bul = new BasicUnitList();

    ReplaceDirective rd = new ReplaceDirective();
View Full Code Here


  }



  public void testCreate() throws Exception {
    PropertySet               ps   = new PropertySet();
    TemplateActionHandler     tah  = new TemplateActionHandlerStub();
    BasicExpressionElementProcessor btep = create( ps, tah );
  }
View Full Code Here

  }


  public void testProcessExpression() throws Exception {
    TemplateActionHandlerStub tahs  = new TemplateActionHandlerStub();
    PropertySet               ps    = new PropertySet();
    ps.load( new File( "../../../../conf/system.conf" ) );
   
    // REVIEW: this will have to change
    ps.set( Property.jostraca_old, "yes" );

    BasicExpressionElementProcessor beep = create( ps, tahs );
    String content  = "=exp";
    Block  expBlock = new Block( Block.TYPE_script, content );
View Full Code Here

    Template tm02 = PackageTest.makeTemplate("tm02");
    ArrayList tmlist = ListUtil.make( tm01, tm02 );

    preprocess( cm, tmlist );

    PropertySet sysps = PackageTest.getSystemPropertySet();
    sysps.set( Property.main_ProcessStages, "Preparer,Parser,Merger,Saver,Compiler,Controller" );

    BasicProcessManager bpsm = new BasicProcessManager( sysps );
    bpsm.setUserMessageHandler( cm );
    bpsm.process( tmlist );
View Full Code Here

    if( simple_txt.exists() ) {
      simple_txt.delete();
    }

    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.YES );
    g.setCmdPropertySet( ps );
    Template tm = g.generate( FileUtil.findFile( "org/jostraca/test/simple.jtm" ) );

    RecordingUserMessageHandler rumh = (RecordingUserMessageHandler) g.getUserMessageHandler();
    assertTrue( null != rumh );
View Full Code Here

    if( parse_txt.exists() ) {
      parse_txt.delete();
    }

    Generator   g  = new Generator( org_jostraca_test );
    PropertySet ps = new PropertySet();
    ps.set( Property.main_MakeBackup,        Standard.NO    );
    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 );
View Full Code Here

    }

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

    }

    // 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 );
   
    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() );
    assertEquals( 0, ((Vector)rumh.get( UserMessageHandler.WARN  )).size() );
    assertEquals( 0, ((Vector)rumh.get( UserMessageHandler.ERROR )).size() );
    assertEquals( 0, ((Vector)rumh.get( UserMessageHandler.FATAL )).size() );

    context_txt = FileUtil.findFile( "org/jostraca/test/context.txt" );
    assertTrue( !context_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/context.jtm" ), new RecordingUserMessageHandler() );

    rumh = (RecordingUserMessageHandler) g.getUserMessageHandler();
View Full Code Here

    if( cmdargs_txt.exists() ) {
      cmdargs_txt.delete();
    }

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

  }



  public void testCreate() throws Exception {
    PropertySet                 ps   = new PropertySet();
    ps.load( new File( "../../../../conf/system.conf" ) );
    TemplateActionHandler       tah  = new TemplateActionHandlerStub();
    BasicScriptElementProcessor bsep = create( ps, tah );
  }
View Full Code Here

TOP

Related Classes of org.jostraca.util.PropertySet

Copyright © 2018 www.massapicom. 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.