Examples of JapidTemplate


Examples of cn.bran.japid.template.JapidTemplate

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

Examples of cn.bran.japid.template.JapidTemplate

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

Examples of cn.bran.japid.template.JapidTemplate

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

Examples of cn.bran.japid.template.JapidTemplate

 
 
  @Test
  public void testAnotherLayout() throws IOException, ParseException {
    String src = readFile("JapidSample/app/japidviews/_layouts/TagLayout.html");
    JapidTemplate bt = new JapidTemplate("japidviews/_layouts/TagLayout.html", src);
    JapidAbstractCompiler cp = new JapidLayoutCompiler();
    cp.compile(bt);
    String srccode = bt.javaSource;
    System.out.println(srccode);
    CompilationUnit cu = JavaSyntaxTool.parse(srccode);
View Full Code Here

Examples of cn.bran.japid.template.JapidTemplate

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

Examples of cn.bran.japid.template.JapidTemplate

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

Examples of cn.bran.japid.template.JapidTemplate

 
  @Test
  public void testTemplateWithCallbackTagCalls() throws IOException, ParseException {
    String src = readFile("JapidSample/app/japidviews/templates/AllPost.html");

    JapidTemplate bt = new JapidTemplate("japidviews/templates/AllPost.html", src);
    JapidAbstractCompiler cp = new JapidTemplateCompiler();
    cp.compile(bt);
    System.out.println(bt.javaSource);
    CompilationUnit cu = JavaSyntaxTool.parse(bt.javaSource);
    System.out.println(cu);
View Full Code Here

Examples of cn.bran.japid.template.JapidTemplate

 
  @Test
  public void testOpenForInDef() throws IOException, ParseException {
    String src = readFile("tests/openForInDef.html");
   
    JapidTemplate bt = new JapidTemplate("tests/openForInDef.html", src);
    JapidAbstractCompiler cp = new JapidTemplateCompiler();
    cp.compile(bt);
    System.out.println(bt.javaSource);
    CompilationUnit cu = JavaSyntaxTool.parse(bt.javaSource);
    System.out.println(cu);
View Full Code Here

Examples of cn.bran.japid.template.JapidTemplate

  }

  @Test
  public void testCompileTagWithDoubleDispatch() throws IOException, ParseException {
    String src = readFile("JapidSample/app/japidviews/_tags/Display.html");
    JapidTemplate bt = new JapidTemplate("tags/Display.html", src);
    JapidAbstractCompiler cp = new JapidTemplateCompiler();
    cp.compile(bt);
    String srcCode = bt.javaSource;
    System.out.println(srcCode);
   
View Full Code Here

Examples of cn.bran.japid.template.JapidTemplate

 
  @Test
  public void testIfindef() throws IOException, ParseException {
    String src = readFile("tests/ifindef.html");
    JapidTemplate bt = new JapidTemplate("tests/ifindef.html", src);
    JapidAbstractCompiler cp = new JapidTemplateCompiler();
    cp.compile(bt);
    String srcCode = bt.javaSource;
//    System.out.println(srcCode);
    assertTrue(!srcCode.contains("_if"));
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.