Package org.jostraca

Examples of org.jostraca.BasicDirectiveElementProcessor


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


  public void testProcessDirective() throws Exception {
    TemplateActionHandlerStub tahs  = new TemplateActionHandlerStub();
    PropertySet               ps    = new PropertySet();
    ps.load( new File( "../../../../conf/system.conf" ) );
    BasicDirectiveElementProcessor bdep = create( ps, tahs );

    tahs.clear();
    String s01 = "foo = bar;";
    Block  b01 = new Block( Block.TYPE_script, s01 );
    assertTrue( ! bdep.isMatch( b01 ) );

    tahs.clear();
    String s02 = "@foo bar;";
    Block  b02 = new Block( Block.TYPE_script, s02 );
    assertTrue( bdep.isMatch( b02 ) );

    tahs.clear();
    String s03 = " @section bar ";
    Block  b03 = new Block( Block.TYPE_script, s03 );
    assertTrue( bdep.isMatch( b03 ) );
    bdep.process( b03 );
    assertTrue( "bar".equals( tahs.getDefaultSectionName() ) );
    String s04 = " @section ";
    Block  b04 = new Block( Block.TYPE_script, s04 );
    assertTrue( bdep.isMatch( b04 ) );
    bdep.process( b04 );
    assertTrue( Section.NAME_body.equals( tahs.getDefaultSectionName() ) );

  }
View Full Code Here

  private BasicDirectiveElementProcessor create( PropertySet           pPropertySet,
                                                 TemplateActionHandler pTemplateActionHandler ) throws Exception {

    BasicUnitList bul = new BasicUnitList();
    TextualTransformManagerTable   ttmt = new TextualTransformManagerTable( pPropertySet );
    BasicDirectiveElementProcessor bdep = new BasicDirectiveElementProcessor( bul, pTemplateActionHandler,
                                                                              pPropertySet, ttmt );
    return bdep;
  }
View Full Code Here

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

  public void testProcessDirective() throws Exception {
    TemplateActionHandlerStub tahs  = new TemplateActionHandlerStub();
    PropertySet               ps    = new PropertySet();
    ps.load( new File( "conf/system.conf" ) );
    BasicDirectiveElementProcessor bdep = create( ps, tahs );

    tahs.clear();
    String s01 = "foo = bar;";
    Block  b01 = new Block( Block.TYPE_script, s01 );
    assertTrue( ! bdep.isMatch( b01 ) );

    tahs.clear();
    String s02 = "@foo bar;";
    Block  b02 = new Block( Block.TYPE_script, s02 );
    assertTrue( bdep.isMatch( b02 ) );

    tahs.clear();
    String s03 = " @section bar ";
    Block  b03 = new Block( Block.TYPE_script, s03 );
    assertTrue( bdep.isMatch( b03 ) );
    bdep.process( b03 );
    assertTrue( "bar".equals( tahs.getDefaultSectionName() ) );
    String s04 = " @section ";
    Block  b04 = new Block( Block.TYPE_script, s04 );
    assertTrue( bdep.isMatch( b04 ) );
    bdep.process( b04 );
    assertTrue( Section.NAME_body.equals( tahs.getDefaultSectionName() ) );

  }
View Full Code Here

                                                 TemplateActionHandler pTemplateActionHandler ) throws Exception {

    Template tm = new BasicTemplate();
    BasicUnitList bul = new BasicUnitList();
    TextualTransformManagerTable   ttmt = new TextualTransformManagerTable( pPropertySet );
    BasicDirectiveElementProcessor bdep = new BasicDirectiveElementProcessor( bul, pTemplateActionHandler,
                                                                              pPropertySet, ttmt, tm );
    return bdep;
  }
View Full Code Here

TOP

Related Classes of org.jostraca.BasicDirectiveElementProcessor

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.