jaroslav@468: /** jaroslav@468: * Back 2 Browser Bytecode Translator jaroslav@468: * Copyright (C) 2012 Jaroslav Tulach jaroslav@468: * jaroslav@468: * This program is free software: you can redistribute it and/or modify jaroslav@468: * it under the terms of the GNU General Public License as published by jaroslav@468: * the Free Software Foundation, version 2 of the License. jaroslav@468: * jaroslav@468: * This program is distributed in the hope that it will be useful, jaroslav@468: * but WITHOUT ANY WARRANTY; without even the implied warranty of jaroslav@468: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the jaroslav@468: * GNU General Public License for more details. jaroslav@468: * jaroslav@468: * You should have received a copy of the GNU General Public License jaroslav@468: * along with this program. Look for COPYING file in the top folder. jaroslav@468: * If not, see http://opensource.org/licenses/GPL-2.0. jaroslav@468: */ jaroslav@462: package org.apidesign.bck2brwsr.dew; jaroslav@462: jaroslav@462: import java.io.IOException; jaroslav@462: import static org.testng.Assert.*; jaroslav@462: import org.testng.annotations.Test; jaroslav@462: jaroslav@462: /** jaroslav@462: * jaroslav@462: * @author Jaroslav Tulach jaroslav@462: */ jaroslav@462: public class CompileTest { jaroslav@462: @Test public void testCompile() throws IOException { jaroslav@462: String html = "" jaroslav@462: + " " jaroslav@462: + ""; jaroslav@462: String java = "package x.y.z;" jaroslav@463: + "import org.apidesign.bck2brwsr.htmlpage.api.*;" jaroslav@463: + "@Page(xhtml=\"index.html\", className=\"Index\")" jaroslav@463: + "class X { " jaroslav@463: + " @OnClick(id=\"btn\") static void clcs() {}" jaroslav@463: + "}"; jaroslav@464: Compile result = Compile.create(html, java); jaroslav@462: jaroslav@462: assertNotNull(result.get("x/y/z/X.class"), "Class X is compiled: " + result); jaroslav@463: assertNotNull(result.get("x/y/z/Index.class"), "Class Index is compiled: " + result); jaroslav@462: } jaroslav@462: }