launcher/src/test/java/org/apidesign/bck2brwsr/dew/CompileTest.java
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Wed, 16 Jan 2013 10:52:06 +0100
branchdew
changeset 463 3641fd0663d3
parent 462 aa69b1387624
child 464 9823859d253a
permissions -rw-r--r--
After Lahvac's tweaks the compilation seems to run OK
     1 /*
     2  * To change this template, choose Tools | Templates
     3  * and open the template in the editor.
     4  */
     5 package org.apidesign.bck2brwsr.dew;
     6 
     7 import java.io.IOException;
     8 import java.util.Map;
     9 import static org.testng.Assert.*;
    10 import org.testng.annotations.Test;
    11 
    12 /**
    13  *
    14  * @author Jaroslav Tulach <jtulach@netbeans.org>
    15  */
    16 public class CompileTest  {
    17     @Test public void testCompile() throws IOException {
    18         String html = "<html><body>"
    19                 + " <button id='btn'>Hello!</button>"
    20                 + "</body></html>";
    21         String java = "package x.y.z;"
    22                 + "import org.apidesign.bck2brwsr.htmlpage.api.*;"
    23             + "@Page(xhtml=\"index.html\", className=\"Index\")"
    24             + "class X { "
    25             + "   @OnClick(id=\"btn\") static void clcs() {}"
    26             + "}";
    27         Map<String,byte[]> result = Compile.compile(html, java);
    28 
    29         assertNotNull(result.get("x/y/z/X.class"), "Class X is compiled: " + result);
    30         assertNotNull(result.get("x/y/z/Index.class"), "Class Index is compiled: " + result);
    31     }
    32 }