jaroslav@1728: /** jaroslav@1728: * Back 2 Browser Bytecode Translator jaroslav@1787: * Copyright (C) 2012-2015 Jaroslav Tulach jaroslav@1728: * jaroslav@1728: * This program is free software: you can redistribute it and/or modify jaroslav@1728: * it under the terms of the GNU General Public License as published by jaroslav@1728: * the Free Software Foundation, version 2 of the License. jaroslav@1728: * jaroslav@1728: * This program is distributed in the hope that it will be useful, jaroslav@1728: * but WITHOUT ANY WARRANTY; without even the implied warranty of jaroslav@1728: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the jaroslav@1728: * GNU General Public License for more details. jaroslav@1728: * jaroslav@1728: * You should have received a copy of the GNU General Public License jaroslav@1728: * along with this program. Look for COPYING file in the top folder. jaroslav@1728: * If not, see http://opensource.org/licenses/GPL-2.0. jaroslav@1728: */ jaroslav@1728: package org.apidesign.bck2brwsr.aot.nb.test; jaroslav@1728: jaroslav@1728: import org.apidesign.bck2brwsr.vmtest.Compare; jaroslav@1728: import org.apidesign.bck2brwsr.vmtest.VMTest; jaroslav@1728: import org.openide.util.Lookup; jaroslav@1731: import org.openide.util.lookup.ServiceProvider; jaroslav@1728: import org.testng.annotations.Factory; jaroslav@1728: jaroslav@1728: /** jaroslav@1728: * jaroslav@1728: * @author Jaroslav Tulach jaroslav@1728: */ jaroslav@1728: public class LookupGetTest { jaroslav@1728: jaroslav@1728: @Compare public boolean getDefault() { jaroslav@1728: return Lookup.getDefault() != null; jaroslav@1728: } jaroslav@1728: jaroslav@1731: @Compare public String findImpl() { jaroslav@1731: Iface a = Lookup.getDefault().lookup(Iface.class); jaroslav@1731: return a.getClass().getName(); jaroslav@1731: } jaroslav@1731: jaroslav@1728: @Factory public static Object[] create() { jaroslav@1728: return VMTest.create(LookupGetTest.class); jaroslav@1728: } jaroslav@1731: jaroslav@1731: public static interface Iface { jaroslav@1731: } jaroslav@1731: jaroslav@1731: @ServiceProvider(service = Iface.class) jaroslav@1731: public static final class Impl implements Iface { jaroslav@1731: } jaroslav@1728: }