Examples of JapidAbstractCompiler


Examples of cn.bran.japid.compiler.JapidAbstractCompiler

 
  @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.compiler.JapidAbstractCompiler

 
  @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));
    assertTrue(srccode.contains("package japidviews._layouts;"));
    assertTrue(srccode.contains("public abstract class SubLayout extends Layout"));
View Full Code Here

Examples of cn.bran.japid.compiler.JapidAbstractCompiler

  @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);
//    assertTrue("invalid java code", JavaSyntaxValidator.isValid(bt.javaSource));
   
View Full Code Here

Examples of cn.bran.japid.compiler.JapidAbstractCompiler

  @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);
//    assertTrue("invalid java code", JavaSyntaxValidator.isValid(bt.javaSource));
   
View Full Code Here

Examples of cn.bran.japid.compiler.JapidAbstractCompiler

  @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);
   
    CompilationUnit cu = JavaSyntaxTool.parse(srcCode);
    assertTrue(srcCode.contains("package tags;"));
View Full Code Here

Examples of cn.bran.japid.compiler.JapidAbstractCompiler

 
  @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

Examples of cn.bran.japid.compiler.JapidAbstractCompiler

 
  @Test
  public void testElvis() throws IOException, ParseException {
    String src = readFile("tests/elvis.html");
    JapidTemplate bt = new JapidTemplate("tests/elvis.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.compiler.JapidAbstractCompiler

 
  @Test
  public void testOpenIf() throws IOException, ParseException {
    String src = readFile("tests/openif.html");
    JapidTemplate bt = new JapidTemplate("tests/openif.html", src);
    JapidAbstractCompiler cp = new JapidTemplateCompiler();
    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.compiler.JapidAbstractCompiler

 
  @Test
  public void testSwitch() throws IOException, ParseException {
    String src = readFile("tests/switchCase.html");
    JapidTemplate bt = new JapidTemplate("tests/switchCase.html", src);
    JapidAbstractCompiler cp = new JapidTemplateCompiler();
    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.compiler.JapidAbstractCompiler

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