Package org.jostraca

Examples of org.jostraca.VirtualTemplate



  public void testVirtual() throws Exception {
    String      sc = (FileUtil.findFile("org/jostraca").getAbsolutePath())+"/../../../conf/system.conf";
    PropertySet ps = new PropertySet( sc );
    VirtualTemplate     vt01  = new VirtualTemplate( "vt01" );
    vt01.setSource( "<% @conf main.JostracaVersion = "+Service.VERSION_NUMBER+"\n"
                    +"  main.FileNameSuffix = .txt %>\n"
                    +"start\n"
                    +"[<%=\"expr\"%>]\n"
                    );
View Full Code Here


   
    //Tracker.activate(new File("/log/jostraca.log"));
   
    Generator g = makeVirtualGenerator(null);
   
    Template t = new VirtualTemplate("test01.js",TM_SOURCE_01);
    g.generate(t);
   
    assertEquals("Hi Bob",t.getResult());
  }
View Full Code Here

   
    String src =
      "<% @conf main.JostracaVersion = 0.4 \n main.TemplateScript = javascript %>"
      +"Hi <% @"+IncludeDirectiveSupport.NAME+" foo bar %>";
   
    Template t = new VirtualTemplate("test01.js",src);

    try {
      g.generate(t);
    }
    catch( Exception e ) {
      System.out.println("cw:"+t.getCodeWriterSource());
      throw e;
    }

    System.out.println("res:"+t.getResult());
   
    assertEquals("Hi include this",t.getResult());
  }
View Full Code Here

TOP

Related Classes of org.jostraca.VirtualTemplate

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.