use of com.qcadoo.plugin.api.PluginOperationResult in project qcadoo by qcadoo.
the class PluginIntegrationTest method shouldUninstallPlugin.
@Test
public void shouldUninstallPlugin() throws Exception {
// given
JarPluginArtifact artifact = new JarPluginArtifact(new File("src/test/resources/com/qcadoo/plugin/integration/plugin4.jar"));
pluginManager.installPlugin(artifact);
pluginManager.enablePlugin("plugin4");
// when
PluginOperationResult result = pluginManager.uninstallPlugin("plugin4");
// then
assertTrue(result.isSuccess());
assertTrue(result.isRestartNeccessary());
assertNull(pluginAccessor.getPlugin("plugin4"));
}
use of com.qcadoo.plugin.api.PluginOperationResult in project qcadoo by qcadoo.
the class PluginIntegrationTest method shouldEnableInstalledPlugin.
@Test
public void shouldEnableInstalledPlugin() throws Exception {
// given
JarPluginArtifact artifact = new JarPluginArtifact(new File("src/test/resources/com/qcadoo/plugin/integration/plugin4.jar"));
pluginManager.installPlugin(artifact);
// when
PluginOperationResult result = pluginManager.enablePlugin("plugin4");
// then
assertTrue(result.isSuccess());
assertTrue(result.isRestartNeccessary());
assertNotNull(pluginAccessor.getPlugin("plugin4"));
assertTrue(pluginAccessor.getPlugin("plugin4").hasState(PluginState.ENABLING));
}
use of com.qcadoo.plugin.api.PluginOperationResult in project qcadoo by qcadoo.
the class PluginIntegrationTest method shouldNotEnablePluginWithDisabledDependencies.
@Test
public void shouldNotEnablePluginWithDisabledDependencies() throws Exception {
// given
pluginManager.disablePlugin("plugin1", "plugin2");
// when
PluginOperationResult result = pluginManager.enablePlugin("plugin2");
// then
assertFalse(result.isSuccess());
assertFalse(result.isRestartNeccessary());
assertEquals(1, result.getPluginDependencyResult().getDependenciesToEnable().size());
assertEquals("plugin1", result.getPluginDependencyResult().getDependenciesToEnable().iterator().next().getIdentifier());
assertEquals(PluginOperationStatus.DEPENDENCIES_TO_ENABLE, result.getStatus());
}
use of com.qcadoo.plugin.api.PluginOperationResult in project qcadoo by qcadoo.
the class PluginIntegrationTest method shouldInstallPlugin.
@Test
public void shouldInstallPlugin() throws Exception {
// given
JarPluginArtifact artifact = new JarPluginArtifact(new File("src/test/resources/com/qcadoo/plugin/integration/plugin4.jar"));
// when
PluginOperationResult result = pluginManager.installPlugin(artifact);
// then
assertTrue(result.isSuccess());
assertFalse(result.isRestartNeccessary());
assertNotNull(pluginAccessor.getPlugin("plugin4"));
assertTrue(pluginAccessor.getPlugin("plugin4").hasState(PluginState.TEMPORARY));
}
use of com.qcadoo.plugin.api.PluginOperationResult in project qcadoo by qcadoo.
the class PluginIntegrationTest method shouldNotDisablePluginWithEnabledDependency.
@Test
public void shouldNotDisablePluginWithEnabledDependency() throws Exception {
// given
pluginManager.enablePlugin("plugin1", "plugin2");
// when
PluginOperationResult result = pluginManager.disablePlugin("plugin1");
// then
assertFalse(result.isSuccess());
assertEquals(1, result.getPluginDependencyResult().getDependenciesToDisable().size());
assertEquals(PluginOperationStatus.DEPENDENCIES_TO_DISABLE, result.getStatus());
}
Aggregations