Package cn.bran.japid.template

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


  }
 
  @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

  }
 
  @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

 
  @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

  }

  @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

  }

  @Test
  public void testCompileTag2() throws IOException {
    String src = readFile("JapidSample/app/japidviews/_tags/Tag2.html");
    JapidTemplate bt = new JapidTemplate("tag/Tag2.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

  @Test
  public void testActionNotation() throws IOException {
    String src = readFile("JapidSample/app/japidviews/templates/Actions.html");
 
    JapidTemplate bt = new JapidTemplate("japidviews/templates/Actions.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

  @Test
  public void testOpenBrace() throws IOException {
    String srcFile = "tests/openBrace.html";
    String src = readFile(srcFile);
   
    JapidTemplate bt = new JapidTemplate(srcFile, 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

  @Test
  public void testTagCalls() throws IOException {
    String srcFile = "tests/tagCalls.html";
    String src = readFile(srcFile);
   
    JapidTemplate bt = new JapidTemplate("tagCalls.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 testTagline() throws IOException, ParseException {
    String srcFile = "tests/tagline.html";
    String src = readFile(srcFile);
   
    JapidTemplate bt = new JapidTemplate("tagline.html", src);
    JapidAbstractCompiler cp = new JapidTemplateCompiler ();
    cp.compile(bt);
    CompilationUnit cu = JavaSyntaxTool.parse(bt.javaSource);
    System.out.println(cu);
    assertTrue(bt.javaSource.contains("_my_tag0.render(a);"));
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.