Examples of JapidTemplate


Examples of cn.bran.japid.template.JapidTemplate

  @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 JapidTemplateCompiler();
    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 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

Examples of cn.bran.japid.template.JapidTemplate

  @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

Examples of cn.bran.japid.template.JapidTemplate

  @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

Examples of cn.bran.japid.template.JapidTemplate

public class CompilerTests {

  @Test
  public void testOpenFor() throws IOException {
    String src = readFile("JapidSample/app/japidviews/_layouts/Layout.html");
    JapidTemplate bt = new JapidTemplate("tag/Layout.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 testCompileLayout() throws IOException {
    String src = readFile("JapidSample/app/japidviews/_layouts/Layout.html");
    JapidTemplate bt = new JapidTemplate("tag/Layout.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 testIfCommand() throws IOException {
    String src = readFile("JapidSample/app/japidviews/Application/ifs.html");
    JapidTemplate bt = new JapidTemplate("Application/ifs.html", src);
    JapidAbstractCompiler cp = new JapidLayoutCompiler();
    cp.compile(bt);
    String javaSource = bt.javaSource;
    System.out.println(javaSource);
    assertTrue(javaSource.contains("if(!asBoolean(ss))"));
View Full Code Here

Examples of cn.bran.japid.template.JapidTemplate

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