use of org.pentaho.platform.engine.core.solution.ContentGeneratorInfo 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"));
}
use of org.pentaho.platform.engine.core.solution.ContentGeneratorInfo in project pentaho-platform by pentaho.
the class ContentGeneratorInfoTest method testContentGeneratorInfo.
public void testContentGeneratorInfo() {
ContentGeneratorInfo cgi = new ContentGeneratorInfo();
cgi.setClassname("test classname");
cgi.setDescription("test description");
cgi.setId("test id");
cgi.setTitle("test title");
cgi.setType("test type");
cgi.setUrl("test url");
assertEquals("wrong field", "test classname", cgi.getClassname());
assertEquals("wrong field", "test description", cgi.getDescription());
assertEquals("wrong field", "test id", cgi.getId());
assertEquals("wrong field", "test title", cgi.getTitle());
assertEquals("wrong field", "test type", cgi.getType());
assertEquals("wrong field", "test url", cgi.getUrl());
}
use of org.pentaho.platform.engine.core.solution.ContentGeneratorInfo in project pentaho-platform by pentaho.
the class SystemPathXmlPluginProvider method createContentGenerator.
private static IContentGeneratorInfo createContentGenerator(PlatformPlugin plugin, String id, String title, String description, String type, String url, String className, IPentahoSession session, String location) throws ClassNotFoundException, InstantiationException, IllegalAccessException {
ContentGeneratorInfo info = new ContentGeneratorInfo();
info.setId(id);
info.setTitle(title);
info.setDescription(description);
// $NON-NLS-1$
info.setUrl((url != null) ? url : "");
info.setType(type);
info.setClassname(className);
return info;
}
Aggregations