Search in sources :

Example 1 with PluginManager

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

the class PluginIntegrationTest method init.

@Before
public void init() throws Exception {
    MultiTenantUtil multiTenantUtil = new MultiTenantUtil();
    ReflectionTestUtils.setField(multiTenantUtil, "multiTenantService", new DefaultMultiTenantService());
    multiTenantUtil.init();
    PluginStateResolver mockPluginStateResolver = mock(PluginStateResolver.class);
    given(mockPluginStateResolver.isEnabled(Mockito.anyString())).willReturn(true);
    PluginUtilsService pluginUtil = new PluginUtilsService(mockPluginStateResolver);
    pluginUtil.init();
    new File("target/plugins").mkdir();
    new File("target/tmpPlugins").mkdir();
    applicationContext = new ClassPathXmlApplicationContext();
    applicationContext.setConfigLocation("com/qcadoo/plugin/integration/spring.xml");
    applicationContext.registerShutdownHook();
    applicationContext.refresh();
    pluginAccessor = applicationContext.getBean(InternalPluginAccessor.class);
    pluginManager = applicationContext.getBean(PluginManager.class);
    sessionFactory = applicationContext.getBean(SessionFactory.class);
}
Also used : MultiTenantUtil(com.qcadoo.tenant.api.MultiTenantUtil) PluginManager(com.qcadoo.plugin.api.PluginManager) SessionFactory(org.hibernate.SessionFactory) PluginUtilsService(com.qcadoo.plugin.internal.PluginUtilsService) ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) PluginStateResolver(com.qcadoo.plugin.api.PluginStateResolver) InternalPluginAccessor(com.qcadoo.plugin.internal.api.InternalPluginAccessor) File(java.io.File) DefaultMultiTenantService(com.qcadoo.tenant.internal.DefaultMultiTenantService) Before(org.junit.Before)

Aggregations

PluginManager (com.qcadoo.plugin.api.PluginManager)1 PluginStateResolver (com.qcadoo.plugin.api.PluginStateResolver)1 PluginUtilsService (com.qcadoo.plugin.internal.PluginUtilsService)1 InternalPluginAccessor (com.qcadoo.plugin.internal.api.InternalPluginAccessor)1 MultiTenantUtil (com.qcadoo.tenant.api.MultiTenantUtil)1 DefaultMultiTenantService (com.qcadoo.tenant.internal.DefaultMultiTenantService)1 File (java.io.File)1 SessionFactory (org.hibernate.SessionFactory)1 Before (org.junit.Before)1 ClassPathXmlApplicationContext (org.springframework.context.support.ClassPathXmlApplicationContext)1