2 * To change this template, choose Tools | Templates
3 * and open the template in the editor.
5 package org.apidesign.bck2brwsr.dew;
7 import java.io.IOException;
9 import static org.testng.Assert.*;
10 import org.testng.annotations.Test;
14 * @author Jaroslav Tulach <jtulach@netbeans.org>
16 public class CompileTest {
17 @Test public void testCompile() throws IOException {
18 String html = "<html><body>"
19 + " <button id='btn'>Hello!</button>"
21 String java = "package x.y.z;"
22 + "import org.apidesign.bck2brwsr.htmlpage.api.*;"
23 + "@Page(xhtml=\"index.html\", className=\"Index\")"
25 + " @OnClick(id=\"btn\") static void clcs() {}"
27 Map<String,byte[]> result = Compile.compile(html, java);
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);