|
|
@ -166,6 +166,19 @@ public class DefaultPluginManagerTest { |
|
|
|
assertSame(PluginState.DISABLED, plugin.getPluginState()); |
|
|
|
assertSame(PluginState.DISABLED, plugin.getPluginState()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
|
|
void shouldDisablePluginAfterStarting() throws IOException { |
|
|
|
|
|
|
|
new PluginZip.Builder(pluginsPath.resolve("my-plugin-1.2.3.zip"), "myPlugin") |
|
|
|
|
|
|
|
.pluginVersion("1.2.3") |
|
|
|
|
|
|
|
.build(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pluginManager.loadPlugins(); |
|
|
|
|
|
|
|
pluginManager.startPlugins(); |
|
|
|
|
|
|
|
assertEquals(PluginState.STARTED, pluginManager.getPlugin("myPlugin").getPluginState()); |
|
|
|
|
|
|
|
pluginManager.disablePlugin("myPlugin"); |
|
|
|
|
|
|
|
assertEquals(PluginState.DISABLED, pluginManager.getPlugin("myPlugin").getPluginState()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void deleteZipPlugin() throws Exception { |
|
|
|
public void deleteZipPlugin() throws Exception { |
|
|
|
PluginZip pluginZip = new PluginZip.Builder(pluginsPath.resolve("my-plugin-1.2.3.zip"), "myPlugin") |
|
|
|
PluginZip pluginZip = new PluginZip.Builder(pluginsPath.resolve("my-plugin-1.2.3.zip"), "myPlugin") |
|
|
|