1 19 20 package org.netbeans.core.startup; 21 22 import org.netbeans.ModuleManager; 23 import org.netbeans.junit.MockServices; 24 import org.netbeans.junit.NbTestCase; 25 import org.openide.util.Lookup; 26 27 30 public class MockServicesTest extends NbTestCase { 31 private ModuleManager mgr; 32 public MockServicesTest(String testName) { 33 super(testName); 34 } 35 36 protected void setUp() throws Exception { 37 super.setUp(); 38 mgr = org.netbeans.core.startup.Main.getModuleSystem().getManager(); 39 MockServices.setServices(MyServices.class); 40 } 41 42 public void testIfMyServiceIsReachable() { 43 assertNotNull(Lookup.getDefault().lookup(MyServices.class)); 44 assertNotNull(mgr); 45 } 46 47 public static final class MyServices {} 48 } 49 | Popular Tags |