jaroslav@704: /** jaroslav@704: * Back 2 Browser Bytecode Translator jaroslav@704: * Copyright (C) 2012 Jaroslav Tulach jaroslav@704: * jaroslav@704: * This program is free software: you can redistribute it and/or modify jaroslav@704: * it under the terms of the GNU General Public License as published by jaroslav@704: * the Free Software Foundation, version 2 of the License. jaroslav@704: * jaroslav@704: * This program is distributed in the hope that it will be useful, jaroslav@704: * but WITHOUT ANY WARRANTY; without even the implied warranty of jaroslav@704: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the jaroslav@704: * GNU General Public License for more details. jaroslav@704: * jaroslav@704: * You should have received a copy of the GNU General Public License jaroslav@704: * along with this program. Look for COPYING file in the top folder. jaroslav@704: * If not, see http://opensource.org/licenses/GPL-2.0. jaroslav@704: */ jaroslav@704: package org.apidesign.vm4brwsr; jaroslav@704: jaroslav@1367: import java.net.URL; jaroslav@704: import org.testng.annotations.BeforeClass; jaroslav@789: import org.testng.annotations.AfterClass; jaroslav@704: import org.testng.annotations.Test; jaroslav@704: jaroslav@704: /** jaroslav@704: * jaroslav@704: * @author Jaroslav Tulach jaroslav@704: */ jaroslav@1367: public class DelayedLoadingTest { jaroslav@747: private static TestVM code; jaroslav@747: jaroslav@1367: @Test public void verifyUsageOf() throws Exception { jaroslav@1367: code.register(new BytesLoader()); jaroslav@704: jaroslav@1367: URL u = new URL("http://apidesign.org"); jaroslav@1367: jaroslav@1367: Object str = code.execCode("Access URI", jaroslav@1367: DelayedLoading.class, "toStrViaURI__Ljava_lang_String_2Ljava_lang_String_2", jaroslav@1367: u.toExternalForm(), u.toExternalForm() jaroslav@704: ); jaroslav@704: } jaroslav@704: jaroslav@704: jaroslav@704: @BeforeClass jaroslav@747: public static void compileTheCode() throws Exception { jaroslav@747: code = TestVM.compileClass( jaroslav@1367: "org/apidesign/vm4brwsr/DelayedLoading"); jaroslav@704: } jaroslav@789: @AfterClass jaroslav@789: public static void releaseTheCode() { jaroslav@789: code = null; jaroslav@789: } jaroslav@704: jaroslav@704: } jaroslav@704: