Examples of JapidTemplate


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

Examples of cn.bran.japid.template.JapidTemplate

  @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

Examples of cn.bran.japid.template.JapidTemplate

  @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("((anotherTag)(new anotherTag(getOut())).setActionRunners(getActionRunners())).render(echo, new anotherTag.DoBody<String>(){"));
View Full Code Here

Examples of cn.bran.japid.template.JapidTemplate

  @Test
  public void testElvisEscape() throws IOException {
    String src = "~{ a ?: b}";
   
    JapidTemplate bt = new JapidTemplate("baba.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 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));
    assertFalse(bt.javaSource.contains("setActionRunners"));
View Full Code Here

Examples of cn.bran.japid.template.JapidTemplate

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

Examples of cn.bran.japid.template.JapidTemplate

  @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

Examples of cn.bran.japid.template.JapidTemplate

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