Search in sources :

Example 6 with ModuleFactory

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

the class PluginTest method shouldHaveInformation.

@Test
public void shouldHaveInformation() throws Exception {
    // given
    Plugin plugin = DefaultPlugin.Builder.identifier("identifier1", Collections.<ModuleFactory<?>>emptyList()).withDescription("description").withName("name").withVendor("vendor").withVendorUrl("vendorUrl").build();
    // then
    assertEquals("description", plugin.getPluginInformation().getDescription());
    assertEquals("name", plugin.getPluginInformation().getName());
    assertEquals("vendor", plugin.getPluginInformation().getVendor());
    assertEquals("vendorUrl", plugin.getPluginInformation().getVendorUrl());
}
Also used : ModuleFactory(com.qcadoo.plugin.api.ModuleFactory) Plugin(com.qcadoo.plugin.api.Plugin) Test(org.junit.Test)

Example 7 with ModuleFactory

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

the class PluginTest method shouldHaveUnknownStateByDefault.

@Test
public void shouldHaveUnknownStateByDefault() throws Exception {
    // given
    Plugin plugin = DefaultPlugin.Builder.identifier("identifier", Collections.<ModuleFactory<?>>emptyList()).build();
    // then
    assertTrue(plugin.hasState(PluginState.UNKNOWN));
    assertEquals(PluginState.UNKNOWN, plugin.getState());
}
Also used : ModuleFactory(com.qcadoo.plugin.api.ModuleFactory) Plugin(com.qcadoo.plugin.api.Plugin) Test(org.junit.Test)

Example 8 with ModuleFactory

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

the class PluginTest method shouldHaveSystemFlag.

@Test
public void shouldHaveSystemFlag() throws Exception {
    // given
    Plugin plugin1 = DefaultPlugin.Builder.identifier("identifier1", Collections.<ModuleFactory<?>>emptyList()).asSystem().build();
    Plugin plugin2 = DefaultPlugin.Builder.identifier("identifier1", Collections.<ModuleFactory<?>>emptyList()).build();
    // then
    assertTrue(plugin1.isSystemPlugin());
    assertFalse(plugin2.isSystemPlugin());
}
Also used : ModuleFactory(com.qcadoo.plugin.api.ModuleFactory) Plugin(com.qcadoo.plugin.api.Plugin) Test(org.junit.Test)

Aggregations

ModuleFactory (com.qcadoo.plugin.api.ModuleFactory)8 Plugin (com.qcadoo.plugin.api.Plugin)5 InternalPlugin (com.qcadoo.plugin.internal.api.InternalPlugin)5 Module (com.qcadoo.plugin.api.Module)4 Test (org.junit.Test)4 ArrayList (java.util.ArrayList)3 MultiTenantCallback (com.qcadoo.tenant.api.MultiTenantCallback)2 Lists.newArrayList (com.google.common.collect.Lists.newArrayList)1 PluginStateResolver (com.qcadoo.plugin.api.PluginStateResolver)1 PluginUtilsService (com.qcadoo.plugin.internal.PluginUtilsService)1 MultiTenantUtil (com.qcadoo.tenant.api.MultiTenantUtil)1 DefaultMultiTenantService (com.qcadoo.tenant.internal.DefaultMultiTenantService)1 InOrder (org.mockito.InOrder)1