Search in sources :

Example 21 with IPlatformPlugin

use of org.pentaho.platform.api.engine.IPlatformPlugin in project pentaho-platform by pentaho.

the class SystemPathPluginProviderIT method testLoadPerspectives.

@SuppressWarnings("deprecation")
@Test
public void testLoadPerspectives() throws PlatformPluginRegistrationException {
    microPlatform.init();
    List<IPlatformPlugin> plugins = provider.getPlugins(new StandaloneSession());
    IPlatformPlugin plugin = (IPlatformPlugin) CollectionUtils.find(plugins, new PluginNameMatcherPredicate("Plugin 1"));
    assertNotNull("Plugin 1 should have been found", plugin);
    assertEquals(2, plugin.getPluginPerspectives().size());
    IPluginPerspective perspective = plugin.getPluginPerspectives().get(0);
    assertEquals(perspective.getId(), "perspective1");
    assertEquals(perspective.getTitle(), "Test Perspective 1");
    assertEquals(perspective.getLayoutPriority(), 500);
}
Also used : StandaloneSession(org.pentaho.platform.engine.core.system.StandaloneSession) IPluginPerspective(org.pentaho.platform.api.engine.perspective.pojo.IPluginPerspective) IPlatformPlugin(org.pentaho.platform.api.engine.IPlatformPlugin) Test(org.junit.Test)

Aggregations

IPlatformPlugin (org.pentaho.platform.api.engine.IPlatformPlugin)21 Test (org.junit.Test)9 StandaloneSession (org.pentaho.platform.engine.core.system.StandaloneSession)7 PlatformPluginRegistrationException (org.pentaho.platform.api.engine.PlatformPluginRegistrationException)6 IPluginProvider (org.pentaho.platform.api.engine.IPluginProvider)5 IPentahoSession (org.pentaho.platform.api.engine.IPentahoSession)4 ArrayList (java.util.ArrayList)3 Predicate (org.apache.commons.collections.Predicate)3 GenericApplicationContext (org.springframework.context.support.GenericApplicationContext)3 File (java.io.File)2 IPentahoObjectRegistration (org.pentaho.platform.api.engine.IPentahoObjectRegistration)2 IPluginResourceLoader (org.pentaho.platform.api.engine.IPluginResourceLoader)2 IServiceManager (org.pentaho.platform.api.engine.IServiceManager)2 PluginBeanDefinition (org.pentaho.platform.api.engine.PluginBeanDefinition)2 ServiceInitializationException (org.pentaho.platform.api.engine.ServiceInitializationException)2 StandaloneSpringPentahoObjectFactory (org.pentaho.platform.engine.core.system.objfac.StandaloneSpringPentahoObjectFactory)2 IOException (java.io.IOException)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1