Collection<PluginBeanDefinition> beans = plugin.getBeans();
assertEquals( "FooComponent was not loaded", 1, CollectionUtils.countMatches( beans, new Predicate() {
public boolean evaluate( Object object ) {
PluginBeanDefinition bean = (PluginBeanDefinition) object;
return bean.getBeanId().equals( "FooComponent" )
&& bean.getClassname().equals( "org.pentaho.test.platform.plugin.pluginmgr.FooComponent" );
}
} ) );
assertEquals( "genericBean was not loaded", 1, CollectionUtils.countMatches( beans, new Predicate() {
public boolean evaluate( Object object ) {
PluginBeanDefinition bean = (PluginBeanDefinition) object;
return bean.getBeanId().equals( "genericBean" ) && bean.getClassname().equals( "java.lang.Object" );
}
} ) );
}