use of com.qcadoo.plugin.api.artifact.JarPluginArtifact 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.artifact.JarPluginArtifact 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.artifact.JarPluginArtifact in project qcadoo by qcadoo.
the class PluginIntegrationTest method shouldNotDowngradePlugin.
@Test
public void shouldNotDowngradePlugin() throws Exception {
// given
JarPluginArtifact artifact = new JarPluginArtifact(new File("src/test/resources/com/qcadoo/plugin/integration/plugin4.jar"));
JarPluginArtifact artifact2 = new JarPluginArtifact(new File("src/test/resources/com/qcadoo/plugin/integration/plugin4.1.jar"));
pluginManager.installPlugin(artifact2);
// when
PluginOperationResult result = pluginManager.installPlugin(artifact);
// then
assertFalse(result.isSuccess());
assertEquals(PluginOperationStatus.CANNOT_DOWNGRADE_PLUGIN, result.getStatus());
assertNotNull(pluginAccessor.getPlugin("plugin4"));
assertTrue(pluginAccessor.getPlugin("plugin4").hasState(PluginState.TEMPORARY));
assertEquals(new Version("1.2.4"), pluginAccessor.getPlugin("plugin4").getVersion());
}
use of com.qcadoo.plugin.api.artifact.JarPluginArtifact in project qcadoo by qcadoo.
the class PluginIntegrationTest method shouldNotDisableTemporaryPlugin.
@Test
public void shouldNotDisableTemporaryPlugin() 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.disablePlugin("plugin4");
// then
assertTrue(result.isSuccess());
assertNotNull(pluginAccessor.getPlugin("plugin4"));
assertTrue(pluginAccessor.getPlugin("plugin4").hasState(PluginState.TEMPORARY));
}
use of com.qcadoo.plugin.api.artifact.JarPluginArtifact in project qcadoo by qcadoo.
the class PluginIntegrationTest method shouldUpdateTemporaryPlugin.
@Test
public void shouldUpdateTemporaryPlugin() throws Exception {
// given
JarPluginArtifact artifact = new JarPluginArtifact(new File("src/test/resources/com/qcadoo/plugin/integration/plugin4.jar"));
JarPluginArtifact artifact2 = new JarPluginArtifact(new File("src/test/resources/com/qcadoo/plugin/integration/plugin4.1.jar"));
pluginManager.installPlugin(artifact);
// when
PluginOperationResult result = pluginManager.installPlugin(artifact2);
// then
assertTrue(result.isSuccess());
assertFalse(result.isRestartNeccessary());
assertNotNull(pluginAccessor.getPlugin("plugin4"));
assertTrue(pluginAccessor.getPlugin("plugin4").hasState(PluginState.TEMPORARY));
assertEquals(new Version("1.2.4"), pluginAccessor.getPlugin("plugin4").getVersion());
}
Aggregations