本文整理汇总了Java中org.pentaho.capabilities.api.ICapabilityProvider类的典型用法代码示例。如果您正苦于以下问题:Java ICapabilityProvider类的具体用法?Java ICapabilityProvider怎么用?Java ICapabilityProvider使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ICapabilityProvider类属于org.pentaho.capabilities.api包,在下文中一共展示了ICapabilityProvider类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: listCapabilities
import org.pentaho.capabilities.api.ICapabilityProvider; //导入依赖的package包/类
@Override public Set<String> listCapabilities() {
Set<String> capabilities = new HashSet<String>();
for ( ICapabilityProvider iCapabilityProvider : providers.values() ) {
Set<String> caps = iCapabilityProvider.listCapabilities();
if ( caps != null ) {
capabilities.addAll( caps );
}
}
return capabilities;
}
示例2: getCapabilityById
import org.pentaho.capabilities.api.ICapabilityProvider; //导入依赖的package包/类
@Override public ICapability getCapabilityById( String id ) {
for ( ICapabilityProvider iCapabilityProvider : providers.values() ) {
ICapability capabilityById = iCapabilityProvider.getCapabilityById( id );
if ( capabilityById != null ) {
return capabilityById;
}
}
return null;
}
示例3: capabilityExist
import org.pentaho.capabilities.api.ICapabilityProvider; //导入依赖的package包/类
@Override public boolean capabilityExist( String id ) {
for ( ICapabilityProvider iCapabilityProvider : providers.values() ) {
if ( iCapabilityProvider.capabilityExist( id ) ) {
return true;
}
}
return false;
}
示例4: getAllCapabilities
import org.pentaho.capabilities.api.ICapabilityProvider; //导入依赖的package包/类
@Override public Set<ICapability> getAllCapabilities() {
Set<ICapability> capabilities = new HashSet<ICapability>();
for ( ICapabilityProvider iCapabilityProvider : providers.values() ) {
Set<ICapability> caps = iCapabilityProvider.getAllCapabilities();
if ( caps != null ) {
capabilities.addAll( caps );
}
}
return capabilities;
}
示例5: testRegisterCapabilityProvider
import org.pentaho.capabilities.api.ICapabilityProvider; //导入依赖的package包/类
@Test
public void testRegisterCapabilityProvider() throws Exception {
Set<String> providers = manager.listProviders();
assertEquals( 0, providers.size() );
ICapabilityProvider iCapabilityProvider = mock( ICapabilityProvider.class );
when(iCapabilityProvider.getId()).thenReturn( "test" );
manager.registerCapabilityProvider( iCapabilityProvider );
providers = manager.listProviders();
assertEquals( 1, providers.size() );
assertEquals( iCapabilityProvider.getId(), providers.iterator().next() );
}
示例6: testGetProvider
import org.pentaho.capabilities.api.ICapabilityProvider; //导入依赖的package包/类
@Test
public void testGetProvider() throws Exception {
ICapabilityProvider iCapabilityProvider = mock( ICapabilityProvider.class );
when(iCapabilityProvider.getId()).thenReturn( "test" );
manager.registerCapabilityProvider( iCapabilityProvider );
ICapabilityProvider provider = manager.getProvider( "test" );
assertSame( iCapabilityProvider, provider );
}
示例7: testListCapabilities
import org.pentaho.capabilities.api.ICapabilityProvider; //导入依赖的package包/类
@Test
public void testListCapabilities() throws Exception {
ICapabilityProvider iCapabilityProvider = mock( ICapabilityProvider.class );
when(iCapabilityProvider.getId()).thenReturn( "test" );
HashSet<String> inCapabilities = new HashSet<String>( Arrays.asList( "one", "two", "three" ) );
when(iCapabilityProvider.listCapabilities()).thenReturn(
inCapabilities );
manager.registerCapabilityProvider( iCapabilityProvider );
Set<String> capabilities = manager.listCapabilities();
assertEquals(3, capabilities.size());
assertTrue( Arrays.equals( capabilities.toArray(), inCapabilities.toArray() ));
}
示例8: testGetCapabilityById
import org.pentaho.capabilities.api.ICapabilityProvider; //导入依赖的package包/类
@Test
public void testGetCapabilityById() throws Exception {
ICapabilityProvider iCapabilityProvider = mock( ICapabilityProvider.class );
when(iCapabilityProvider.getId()).thenReturn( "test" );
ICapability capability = mock( ICapability.class );
when(iCapabilityProvider.getCapabilityById( "foo" )).thenReturn( capability );
manager.registerCapabilityProvider( iCapabilityProvider );
ICapability foo = manager.getCapabilityById( "foo" );
assertSame( capability, foo );
}
示例9: testCapabilityExist
import org.pentaho.capabilities.api.ICapabilityProvider; //导入依赖的package包/类
@Test
public void testCapabilityExist() throws Exception {
ICapabilityProvider iCapabilityProvider = mock( ICapabilityProvider.class );
when(iCapabilityProvider.capabilityExist("foo")).thenReturn( true);
manager.registerCapabilityProvider( iCapabilityProvider );
boolean exists = manager.capabilityExist( "foo" );
assertSame( true, exists );
boolean doesNotExist = manager.capabilityExist( "bad" );
assertSame( false, doesNotExist );
}
示例10: testGetAllCapabilities
import org.pentaho.capabilities.api.ICapabilityProvider; //导入依赖的package包/类
@Test
public void testGetAllCapabilities() throws Exception {
ICapabilityProvider iCapabilityProvider = mock( ICapabilityProvider.class );
when(iCapabilityProvider.getId()).thenReturn( "test" );
ICapability capability = mock( ICapability.class );
when(iCapabilityProvider.getAllCapabilities()).thenReturn( new HashSet<ICapability>( Arrays.asList( capability ) ) );
manager.registerCapabilityProvider( iCapabilityProvider );
Set<ICapability> allCapabilities = manager.getAllCapabilities();
assertEquals( 1, allCapabilities.size() );
}
示例11: setup
import org.pentaho.capabilities.api.ICapabilityProvider; //导入依赖的package包/类
@Before
public void setup() throws Exception {
Configuration configuration = mock( Configuration.class );
ConfigurationAdmin configurationAdmin = mock( ConfigurationAdmin.class );
doReturn( properties ).when( configuration ).getProperties();
sparkRunConfigurationExecutor = new SparkRunConfigurationExecutor( configurationAdmin );
capabilityProvider = mock( ICapabilityProvider.class );
capabilityManager = DefaultCapabilityManager.getInstance();
capabilityManager.registerCapabilityProvider( capabilityProvider );
}
示例12: registerCapabilityProvider
import org.pentaho.capabilities.api.ICapabilityProvider; //导入依赖的package包/类
public void registerCapabilityProvider( ICapabilityProvider provider ) {
providers.put( provider.getId(), provider );
}
示例13: getProvider
import org.pentaho.capabilities.api.ICapabilityProvider; //导入依赖的package包/类
@Override public ICapabilityProvider getProvider( String id ) {
return providers.get( id );
}