Examples of BasicUnitList


Examples of org.jostraca.unit.BasicUnitList

  private BasicDirectiveElementProcessor create( PropertySet           pPropertySet,
                                                 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

Examples of org.jostraca.unit.BasicUnitList


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

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

Examples of org.jostraca.unit.BasicUnitList


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

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

Examples of org.jostraca.unit.BasicUnitList

    TemplateActionHandlerStub tahs  = new TemplateActionHandlerStub();
    PropertySet               ps    = new PropertySet();
    ps.load( Tools.findRelativeSystemPath( "conf/system.conf" ) );
    TextualTransformManagerTable   ttmt = new TextualTransformManagerTable( ps );

    BasicUnitList bul = new BasicUnitList();

    SectionDirective sd = new SectionDirective();
    assertTrue( "section".equals( sd.getName() ) );

    tahs.clear();
View Full Code Here

Examples of org.jostraca.unit.BasicUnitList


  /* Public Methods << */

  public void testList() throws Exception {
    BasicUnitList bus = new BasicUnitList();

    bus.add( new BasicUnit( "text",    "init", "it01" ) );
    bus.add( new BasicUnit( "script""init", "is01" ) );
    bus.add( new BasicUnit( "text",    "init", "it02" ) );
    bus.add( new BasicUnit( "script""init", "is02" ) );

    bus.add( new BasicUnit( "text",    "foo", "foot01" ) );
    bus.add( new BasicUnit( "script""foo", "foos01" ) );

    Hashtable isattr = new Hashtable();
    isattr.put( InsertSectionTransform.ATTR_unit_source_section, "foo" );

    bus.add( new BasicUnit( "text",    "body", "12345678901234567890123456789012345678901234567890" ) );
    bus.add( new BasicUnit( "text",    "body", "bt01" ) );
    bus.add( new BasicUnit( "script""body", "bs01" ) );
    bus.add( new BasicUnit( "insert-section", "body", "", new BasicUnitOrigin(), isattr ) );
    bus.add( new BasicUnit( "text",    "body", "bt02" ) );
    bus.add( new BasicUnit( "script""body", "bs02" ) );

    bus.add( new BasicUnit( "text",    "foo", "foot02" ) );
    bus.add( new BasicUnit( "script""foo", "foos02" ) );


    PropertySet ps = new PropertySet();
    ps.load( Tools.findRelativeSystemPath("src/org/jostraca/unit/test/test.conf") );

View Full Code Here

Examples of org.jostraca.unit.BasicUnitList


  /* Public Methods << */

  public void testList() throws Exception {
    BasicUnitList bus = new BasicUnitList();

    bus.add( new BasicUnit( "text",    "init", "it01" ) );
    bus.add( new BasicUnit( "script""init", "is01" ) );
    bus.add( new BasicUnit( "text",    "init", "it02" ) );
    bus.add( new BasicUnit( "script""init", "is02" ) );

    bus.add( new BasicUnit( "text",    "foo", "foot01" ) );
    bus.add( new BasicUnit( "script""foo", "foos01" ) );

    Hashtable isattr = new Hashtable();
    isattr.put( InsertSectionTransform.ATTR_unit_source_section, "foo" );

    bus.add( new BasicUnit( "text",    "body", "12345678901234567890123456789012345678901234567890" ) );
    bus.add( new BasicUnit( "text",    "body", "bt01" ) );
    bus.add( new BasicUnit( "script""body", "bs01" ) );
    bus.add( new BasicUnit( "insert-section", "body", "", new BasicUnitOrigin(), isattr ) );
    bus.add( new BasicUnit( "text",    "body", "bt02" ) );
    bus.add( new BasicUnit( "script""body", "bs02" ) );

    bus.add( new BasicUnit( "text",    "foo", "foot02" ) );
    bus.add( new BasicUnit( "script""foo", "foos02" ) );


    DebugUnitProcessor dup = new DebugUnitProcessor();
    SectionSet ss = dup.process( bus );

View Full Code Here

Examples of org.jostraca.unit.BasicUnitList


  /* Public Methods << */

  public void testCreate() {
    BasicUnitList bus = new BasicUnitList();
    assertTrue( !bus.nextUnit() );
    assertEquals( 0, bus.getNumUnits() );

    try {
      bus.getUnit();
      fail();
    }
    catch( IllegalStateException ise ) {}

    try {
      bus.getUnitIndex();
      fail();
    }
    catch( IllegalStateException ise ) {}

    try {
      bus.getUnit(0);
      fail();
    }
    catch( IllegalArgumentException iae ) {}
  }
View Full Code Here

Examples of org.jostraca.unit.BasicUnitList

    BasicUnit bu01 = new BasicUnit( bu01s, bu01s, bu01s );
    BasicUnit bu02 = new BasicUnit( bu02s, bu02s, bu02s );
    BasicUnit bu03 = new BasicUnit( bu03s, bu03s, bu03s );

    BasicUnitList bus = new BasicUnitList();
    assertEquals( 0, bus.getNumUnits() );
    bus.add( bu01 );
    assertEquals( 1, bus.getNumUnits() );
    bus.add( bu02 );
    assertEquals( 2, bus.getNumUnits() );
    bus.add( bu03 );
    assertEquals( 3, bus.getNumUnits() );

    assertTrue( bus.nextUnit() );
    assertEquals( bu01, bus.getUnit() );
    assertTrue( bus.nextUnit() );
    assertEquals( bu02, bus.getUnit() );
    assertTrue( bus.nextUnit() );
    assertEquals( bu03, bus.getUnit() );
    assertTrue( !bus.nextUnit() );
    assertTrue( bus.nextUnit() );

    assertEquals( bu02, bus.getUnit( 1 ) );
  }
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.