protected void ensurePluginLoaded(PluginSpecification plugin) throws TestRunnerException { String id = plugin.getPluginId(); if (usingEmu) { TestEmu.loadPseudoPlugin(id, plugin.getClassName()); } else { String ver = (plugin.getPluginVersion().length() == 0) ? System.getProperty("os.version") : plugin.getPluginVersion(); try { PluginManager mgr = InitialNaming.lookup(PluginManager.NAME); PluginRegistry reg = mgr.getRegistry(); if (reg.getPluginDescriptor(id) == null) { reg.loadPlugin(mgr.getLoaderManager(), new PluginReference(id, new Version(ver)), true); } } catch (Exception ex) { System.out.println(ex.getMessage()); throw new TestRunnerException( "Cannot load plugin '" + plugin.getPluginId() + "/" + ver + "'", ex); } } }
public TestRunnerBase(TestSpecification spec, TestHarness harness) { super(); this.spec = spec; this.harness = harness; this.usingEmu = TestEmu.initEmu(harness.getRoot()); }