Package cn.bran.japid.template

Examples of cn.bran.japid.template.JapidTemplate


  @Test
  public void testLog() throws IOException, ParseException {
    String srcFile = "JapidSample/app/japidviews/templates/log.html";
    String src = readFile(srcFile);
   
    JapidTemplate bt = new JapidTemplate("japidviews/templates/Actions.html", src);
    JapidAbstractCompiler cp = new JapidTemplateCompiler ();
    cp.compile(bt);
    CompilationUnit cu = JavaSyntaxTool.parse(bt.javaSource);
    System.out.println(cu);
  }
View Full Code Here


  @Test
  public void testVerbatim() throws IOException, ParseException {
    String srcFile = "JapidSample/app/japidviews/Application/verbatim.html";
    String src = readFile(srcFile);
   
    JapidTemplate bt = new JapidTemplate("japidviews/Application/verbatim.html", src);
    JapidAbstractCompiler cp = new JapidTemplateCompiler ();
    cp.compile(bt);
    CompilationUnit cu = JavaSyntaxTool.parse(bt.javaSource);
    System.out.println(cu);
  }
View Full Code Here

  @Test
  public void testTagBlock() throws IOException {
    String srcFile = "JapidSample/app/japidviews/templates/tagBody.html";
    String src = readFile(srcFile);
   
    JapidTemplate bt = new JapidTemplate("japidviews/templates/tagBody.html", src);
    JapidAbstractCompiler cp = new JapidTemplateCompiler ();
    cp.compile(bt);
    System.out.println(bt.javaSource);
    assertTrue("invalid java code", JavaSyntaxTool.isValid(bt.javaSource));
    assertTrue(bt.javaSource.contains("_fooTag0.render(\"hi\", new fooTag.DoBody(){"));
View Full Code Here

  @Test
  public void testEachDirective() throws IOException {
    String srcFile = "tests/eachTag.html";
    String src = readFile(srcFile);
   
    JapidTemplate bt = new JapidTemplate("eachTag.html", src);
    JapidAbstractCompiler cp = new JapidTemplateCompiler ();
    cp.compile(bt);
    System.out.println(bt.javaSource);
    assertTrue("invalid java code", JavaSyntaxTool.isValid(bt.javaSource));
    assertTrue(bt.javaSource.contains("final Each _Each0 = new Each(getOut());"));
View Full Code Here

  @Test
  public void testSetDirective() throws IOException {
    String srcFile = "tests/setTag.html";
    String src = readFile(srcFile);
   
    JapidTemplate bt = new JapidTemplate("tests/setTag.html", src);
    JapidAbstractCompiler cp = new JapidTemplateCompiler ();
    cp.compile(bt);
    System.out.println(bt.javaSource);
    assertTrue("invalid java code", JavaSyntaxTool.isValid(bt.javaSource));
    assertTrue(bt.javaSource.contains("@Override protected void message() {"));
View Full Code Here

  @Test
  public void testGetDirective() throws IOException, ParseException {
    String srcFile = "tests/getTag.html";
    String src = readFile(srcFile);
   
    JapidTemplate bt = new JapidTemplate("tests/getTag.html", src);
    JapidAbstractCompiler cp = new JapidLayoutCompiler();
    cp.compile(bt);
    System.out.println(bt.javaSource);
//    assertTrue("invalid java code", JavaSyntaxTool.isValid(bt.javaSource));
    CompilationUnit cu = JavaSyntaxTool.parse(bt.javaSource);
View Full Code Here

  @Test
  public void testDefDirective() throws IOException, ParseException {
    String srcFile = "JapidSample/app/japidviews/templates/def.html";
    String src = readFile(srcFile);
   
    JapidTemplate bt = new JapidTemplate("japidviews/templates/def.html", src);
    JapidAbstractCompiler cp = new JapidLayoutCompiler();
    cp.compile(bt);
//    System.out.println(bt.javaSource);
//    assertTrue("invalid java code", JavaSyntaxTool.isValid(bt.javaSource));
    CompilationUnit cu = JavaSyntaxTool.parse(bt.javaSource);
View Full Code Here

  @Test
  public void testSimpleInvoke() throws IOException {
    String srcFile = "tests/simpleInvoke.html";
    String src = readFile(srcFile);
   
    JapidTemplate bt = new JapidTemplate("simpleInvoke.html", src);
    JapidAbstractCompiler cp = new JapidTemplateCompiler ();
    cp.compile(bt);
    String code = bt.javaSource;
    assertTrue("invalid java code", JavaSyntaxTool.isValid(bt.javaSource));
    System.out.println(code);
View Full Code Here

  @Test
  public void testScriptlineLayout() throws IOException {
    String srcFile = "JapidSample/app/japidviews/more/MyController/scriptlineLayout.html";
    String src = readFile(srcFile);
   
    JapidTemplate bt = new JapidTemplate("scriptlineLayout.html", src);
    JapidAbstractCompiler cp = new JapidLayoutCompiler();
    cp.compile(bt);
    String code = bt.javaSource;
    System.out.println(code);
    assertTrue("invalid java code", JavaSyntaxTool.isValid(bt.javaSource));
View Full Code Here

  @Test
  public void testOldInvoke() throws IOException {
    String srcFile = "JapidSample/app/japidviews/Application/authorPanel2.html";
    String src = readFile(srcFile);
   
    JapidTemplate bt = new JapidTemplate("simpleInvoke.html", src);
    JapidAbstractCompiler cp = new JapidTemplateCompiler ();
    cp.compile(bt);
    String code = bt.javaSource;
    assertTrue("invalid java code", JavaSyntaxTool.isValid(bt.javaSource));
    System.out.println(code);
View Full Code Here

TOP

Related Classes of cn.bran.japid.template.JapidTemplate

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.