use of org.pentaho.platform.plugin.services.pluginmgr.PlatformPlugin in project pentaho-platform by pentaho.
the class DefaultPluginManagerIT method test17_getPluginIdForType.
@Test
public void test17_getPluginIdForType() throws PlatformInitializationException, PluginBeanException {
IPluginProvider provider = new IPluginProvider() {
public List<IPlatformPlugin> getPlugins(IPentahoSession session) throws PlatformPluginRegistrationException {
PlatformPlugin p = new PlatformPlugin(new DefaultListableBeanFactory());
p.setId("testPlugin");
ContentGeneratorInfo cg1 = new ContentGeneratorInfo();
cg1.setDescription("test 9 plugin description");
cg1.setId("oldworldCGid");
cg1.setType("oldworldCGtype");
cg1.setTitle("test");
cg1.setClassname("org.pentaho.test.platform.plugin.pluginmgr.ContentGenerator1");
// cg1.setFileInfoGeneratorClassname("org.pentaho.test.platform.plugin.pluginmgr.FileInfoGenerator");
p.addContentGenerator(cg1);
BeanDefinition beanDef = BeanDefinitionBuilder.rootBeanDefinition("org.pentaho.test.platform.plugin.pluginmgr.ContentGenerator1").setScope(BeanDefinition.SCOPE_PROTOTYPE).getBeanDefinition();
p.getBeanFactory().registerBeanDefinition("springDefinedCGid", beanDef);
p.getBeanFactory().registerAlias("springDefinedCGid", "springDefinedCGtype");
return Arrays.asList((IPlatformPlugin) p);
}
};
microPlatform.defineInstance(IPluginProvider.class, provider).start();
pluginManager.reload();
assertEquals("testPlugin", pluginManager.getPluginIdForType("oldworldCGtype"));
assertEquals("testPlugin", pluginManager.getPluginIdForType("springDefinedCGtype"));
}
Aggregations