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();
}
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();
}
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());
}
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();
}
Aggregations