Search in sources :

Example 11 with Plugin

use of com.qcadoo.plugin.api.Plugin in project qcadoo by qcadoo.

the class PluginDescriptorParserTest method shouldHaveModulesForXml2.

@Test
public void shouldHaveModulesForXml2() throws Exception {
    // given
    // when
    Plugin result = parser.parse(xmlFile2);
    // then
    DefaultPlugin castedResult = (DefaultPlugin) result;
    assertEquals(0, castedResult.getModules(testModule1Factory).size());
    assertEquals(0, castedResult.getModules(testModule2Factory).size());
}
Also used : Plugin(com.qcadoo.plugin.api.Plugin) InternalPlugin(com.qcadoo.plugin.internal.api.InternalPlugin) DefaultPlugin(com.qcadoo.plugin.internal.DefaultPlugin) DefaultPlugin(com.qcadoo.plugin.internal.DefaultPlugin) Test(org.junit.Test)

Example 12 with Plugin

use of com.qcadoo.plugin.api.Plugin in project qcadoo by qcadoo.

the class PluginDescriptorParserTest method shouldHavePluginInformationsForXml2.

@Test
public void shouldHavePluginInformationsForXml2() {
    // given
    // when
    Plugin result = parser.parse(xmlFile2);
    // then
    assertEquals("testPlugin2Name", result.getPluginInformation().getName());
    assertNull(result.getPluginInformation().getDescription());
    assertNull(result.getPluginInformation().getVendor());
    assertNull(result.getPluginInformation().getVendorUrl());
}
Also used : Plugin(com.qcadoo.plugin.api.Plugin) InternalPlugin(com.qcadoo.plugin.internal.api.InternalPlugin) DefaultPlugin(com.qcadoo.plugin.internal.DefaultPlugin) Test(org.junit.Test)

Example 13 with Plugin

use of com.qcadoo.plugin.api.Plugin in project qcadoo by qcadoo.

the class PluginDescriptorParserTest method shouldHaveIdentifierVersionAndSystemForXml1.

@Test
public void shouldHaveIdentifierVersionAndSystemForXml1() {
    // given
    // when
    Plugin result = parser.parse(xmlFile1);
    // then
    assertEquals("testPlugin", result.getIdentifier());
    assertEquals(new Version("1.2.3"), result.getVersion());
    assertTrue(result.isSystemPlugin());
}
Also used : Version(com.qcadoo.plugin.api.Version) Plugin(com.qcadoo.plugin.api.Plugin) InternalPlugin(com.qcadoo.plugin.internal.api.InternalPlugin) DefaultPlugin(com.qcadoo.plugin.internal.DefaultPlugin) Test(org.junit.Test)

Example 14 with Plugin

use of com.qcadoo.plugin.api.Plugin in project qcadoo by qcadoo.

the class PluginDescriptorParserTest method shouldHavePluginDependenciesInformationsForXml1.

@Test
public void shouldHavePluginDependenciesInformationsForXml1() {
    // given
    // when
    Plugin result = parser.parse(xmlFile1);
    // then
    Set<PluginDependencyInformation> dependencies = result.getRequiredPlugins();
    assertEquals(3, dependencies.size());
    assertTrue(dependencies.contains(new PluginDependencyInformation("testPluginDependency1", new VersionOfDependency("(1.2.3,2.3.4]"))));
    assertTrue(dependencies.contains(new PluginDependencyInformation("testPluginDependency2", new VersionOfDependency("1.1.1"))));
    assertTrue(dependencies.contains(new PluginDependencyInformation("testPluginDependency3", new VersionOfDependency(null))));
}
Also used : VersionOfDependency(com.qcadoo.plugin.api.VersionOfDependency) PluginDependencyInformation(com.qcadoo.plugin.api.PluginDependencyInformation) Plugin(com.qcadoo.plugin.api.Plugin) InternalPlugin(com.qcadoo.plugin.internal.api.InternalPlugin) DefaultPlugin(com.qcadoo.plugin.internal.DefaultPlugin) Test(org.junit.Test)

Example 15 with Plugin

use of com.qcadoo.plugin.api.Plugin in project qcadoo by qcadoo.

the class PluginDescriptorParserTest method shouldParseXml1.

@Test
public void shouldParseXml1() {
    // given
    // when
    Plugin result = parser.parse(xmlFile1);
    // then
    assertNotNull(result);
}
Also used : Plugin(com.qcadoo.plugin.api.Plugin) InternalPlugin(com.qcadoo.plugin.internal.api.InternalPlugin) DefaultPlugin(com.qcadoo.plugin.internal.DefaultPlugin) Test(org.junit.Test)

Aggregations

Plugin (com.qcadoo.plugin.api.Plugin)71 InternalPlugin (com.qcadoo.plugin.internal.api.InternalPlugin)59 Test (org.junit.Test)58 PluginDependencyResult (com.qcadoo.plugin.api.PluginDependencyResult)38 PluginDependencyInformation (com.qcadoo.plugin.api.PluginDependencyInformation)28 HashSet (java.util.HashSet)25 ArrayList (java.util.ArrayList)15 QcadooPluginPlugin (com.qcadoo.model.beans.qcadooPlugin.QcadooPluginPlugin)13 DefaultPlugin (com.qcadoo.plugin.internal.DefaultPlugin)11 PluginOperationResult (com.qcadoo.plugin.api.PluginOperationResult)8 Version (com.qcadoo.plugin.api.Version)8 SimplePluginStatusResolver (com.qcadoo.plugin.internal.dependencymanager.SimplePluginStatusResolver)8 Lists.newArrayList (com.google.common.collect.Lists.newArrayList)6 InOrder (org.mockito.InOrder)6 ModuleFactory (com.qcadoo.plugin.api.ModuleFactory)5 VersionOfDependency (com.qcadoo.plugin.api.VersionOfDependency)4 Entity (com.qcadoo.model.api.Entity)2 EntityList (com.qcadoo.model.api.EntityList)2 Module (com.qcadoo.plugin.api.Module)2 PluginException (com.qcadoo.plugin.internal.PluginException)2