PluginManager { protected void uninstallPlugin(RegisteredPlugin plugin) { this.loadedPlugins.remove(plugin); plugin.stop(); plugin.uninstall(); } protected  PluginManager(); static synchronized PluginManager getInstance(); void start(); void stop(); IPlugin installPlugin(File file); void uninstallPlugin(final PluginFile plugin); List<T> getServices(Class<T> serviceType); List<RegisteredPlugin> getPlugins(Class<T> pluginType); List<RegisteredPlugin> getActivePlugins(); Object getPresentationProperty(String property); static final String PRESENTATION_FOLDER; static final String PRESENTATION_RESOURCES_FOLDER; }
@Test public void uninstallPlugin() throws IOException { final File plugin01 = createDummyPlugin("plugin-01", "Plugin 01", "1.0"); final File plugin02 = createDummyPlugin("plugin-02", "Plugin 02", "1.0"); PluginManager.getInstance().installPlugin(plugin02); PluginManager.getInstance().installPlugin(plugin01); PluginManager.getInstance().uninstallPlugin(new PluginFile(plugin01)); final List<RegisteredPlugin> plugins = PluginManager.getInstance().getPlugins(IPlugin.class); assertAll( () -> assertNotNull(plugins), () -> assertEquals(1, plugins.size()), () -> assertEquals("1.0", plugins.get(0).getVersion()), () -> assertEquals("Plugin 02", plugins.get(0).getName()) ); }