Search in sources :

Example 1 with PluginAdapter

use of org.pentaho.platform.plugin.services.pluginmgr.PluginAdapter in project pentaho-platform by pentaho.

the class PluginAdapterIT method init0.

@SuppressWarnings("deprecation")
@Before
public void init0() {
    microPlatform = new MicroPlatform(TestResourceLocation.TEST_RESOURCES + "/PluginManagerTest/");
    microPlatform.define(ISolutionEngine.class, SolutionEngine.class);
    microPlatform.define(IPluginManager.class, DefaultPluginManager.class);
    microPlatform.define(IPluginProvider.class, SystemPathXmlPluginProvider.class);
    microPlatform.define(IServiceManager.class, DefaultServiceManager.class);
    session = new StandaloneSession();
    pluginAdapter = new PluginAdapter();
    microPlatform.addAdminAction(pluginAdapter);
    microPlatform.init();
}
Also used : PluginAdapter(org.pentaho.platform.plugin.services.pluginmgr.PluginAdapter) StandaloneSession(org.pentaho.platform.engine.core.system.StandaloneSession) MicroPlatform(org.pentaho.test.platform.engine.core.MicroPlatform) Before(org.junit.Before)

Example 2 with PluginAdapter

use of org.pentaho.platform.plugin.services.pluginmgr.PluginAdapter in project pentaho-platform by pentaho.

the class PluginManagerNotConfiguredIT method testPluginAdapterViaSystemListenerAPI.

@SuppressWarnings("cast")
public void testPluginAdapterViaSystemListenerAPI() throws Exception {
    startTest();
    // $NON-NLS-1$
    IPentahoSession session = new StandaloneSession("test user");
    PluginAdapter mgr = new PluginAdapter();
    assertTrue(mgr instanceof IPentahoSystemListener);
    IPentahoSystemListener listener = (IPentahoSystemListener) mgr;
    assertFalse(listener.startup(session));
    // this does not do anything but it shouldn't error
    listener.shutdown();
    finishTest();
}
Also used : PluginAdapter(org.pentaho.platform.plugin.services.pluginmgr.PluginAdapter) IPentahoSystemListener(org.pentaho.platform.api.engine.IPentahoSystemListener) StandaloneSession(org.pentaho.platform.engine.core.system.StandaloneSession) IPentahoSession(org.pentaho.platform.api.engine.IPentahoSession)

Example 3 with PluginAdapter

use of org.pentaho.platform.plugin.services.pluginmgr.PluginAdapter in project pentaho-platform by pentaho.

the class PentahoBoot method enablePluginManager.

/**
 * Enables the plugin manager
 */
public void enablePluginManager() {
    if (getFactory() instanceof IPentahoDefinableObjectFactory) {
        define(IPluginProvider.class, SystemPathXmlPluginProvider.class, Scope.GLOBAL);
        define(IPluginManager.class, DefaultPluginManager.class, Scope.GLOBAL);
        define(IServiceManager.class, DefaultServiceManager.class, Scope.GLOBAL);
        define(IPluginResourceLoader.class, PluginResourceLoader.class, Scope.GLOBAL);
    }
    addLifecycleListener(new PluginAdapter());
}
Also used : IPentahoDefinableObjectFactory(org.pentaho.platform.api.engine.IPentahoDefinableObjectFactory) PluginAdapter(org.pentaho.platform.plugin.services.pluginmgr.PluginAdapter)

Example 4 with PluginAdapter

use of org.pentaho.platform.plugin.services.pluginmgr.PluginAdapter in project pentaho-platform by pentaho.

the class PluginManagerNotConfiguredIT method testPluginAdapterViaPublisherAPI.

@SuppressWarnings("cast")
public void testPluginAdapterViaPublisherAPI() throws Exception {
    startTest();
    // $NON-NLS-1$
    IPentahoSession session = new StandaloneSession("test user");
    PluginAdapter mgr = new PluginAdapter();
    assertTrue(mgr instanceof IPentahoPublisher);
    IPentahoPublisher publisher = (IPentahoPublisher) mgr;
    // $NON-NLS-1$
    assertEquals(Messages.getInstance().getString("PluginAdapter.USER_PLUGIN_MANAGER"), publisher.getName());
    // $NON-NLS-1$
    assertNotSame("!PluginAdapter.USER_PLUGIN_MANAGER!", publisher.getName());
    // $NON-NLS-1$
    assertEquals(Messages.getInstance().getString("PluginAdapter.USER_REFRESH_PLUGINS"), publisher.getDescription());
    // $NON-NLS-1$
    assertNotSame("!PluginAdapter.USER_REFRESH_PLUGINS!", publisher.getName());
    String str = publisher.publish(session, ILogger.DEBUG);
    // $NON-NLS-1$
    assertEquals(str, Messages.getInstance().getString("PluginAdapter.ERROR_0001_PLUGIN_MANAGER_NOT_CONFIGURED"));
    finishTest();
}
Also used : PluginAdapter(org.pentaho.platform.plugin.services.pluginmgr.PluginAdapter) IPentahoPublisher(org.pentaho.platform.api.engine.IPentahoPublisher) StandaloneSession(org.pentaho.platform.engine.core.system.StandaloneSession) IPentahoSession(org.pentaho.platform.api.engine.IPentahoSession)

Aggregations

PluginAdapter (org.pentaho.platform.plugin.services.pluginmgr.PluginAdapter)4 StandaloneSession (org.pentaho.platform.engine.core.system.StandaloneSession)3 IPentahoSession (org.pentaho.platform.api.engine.IPentahoSession)2 Before (org.junit.Before)1 IPentahoDefinableObjectFactory (org.pentaho.platform.api.engine.IPentahoDefinableObjectFactory)1 IPentahoPublisher (org.pentaho.platform.api.engine.IPentahoPublisher)1 IPentahoSystemListener (org.pentaho.platform.api.engine.IPentahoSystemListener)1 MicroPlatform (org.pentaho.test.platform.engine.core.MicroPlatform)1