launcher/src/test/java/org/apidesign/bck2brwsr/dew/CompileTest.java
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Tue, 15 Jan 2013 22:48:17 +0100
branchdew
changeset 462 aa69b1387624
child 463 3641fd0663d3
permissions -rw-r--r--
Trying to compile Java source via the javax.tools.ToolProvider.getSystemJavaCompiler
     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                 + "class X {"
    23                 + "}";
    24         Map<String,byte[]> result = Compile.compile(html, java);
    25 
    26         assertNotNull(result.get("x/y/z/X.class"), "Class X is compiled: " + result);
    27     }
    28 }