Examples of ISystemConfig


Examples of org.pentaho.platform.api.engine.ISystemConfig

  public void setUp() throws Exception {
    mp = new MicroPlatform();
    mp.defineInstance( IAuthorizationPolicy.class, new TestAuthorizationPolicy() );
    mp.start();

    ISystemConfig systemConfig = new SystemConfig();
    IConfiguration securityConfig = mock( IConfiguration.class );
    Properties props = new Properties();
    props.setProperty( "provider", "jackrabbit" );
    when( securityConfig.getProperties() ).thenReturn( props );
    when( securityConfig.getId() ).thenReturn( "security" );
    systemConfig.registerConfiguration( securityConfig );

    systemResource = new SystemResource( systemConfig );

    StandaloneApplicationContext applicationContext = new StandaloneApplicationContext( getSolutionPath(), "" ); //$NON-NLS-1$
View Full Code Here

Examples of org.pentaho.platform.api.engine.ISystemConfig

  private Logger logger = LoggerFactory.getLogger( getClass() );

  public GuavaCachePoolPentahoJcrSessionFactory( Repository repository, String workspace ) {
    super( repository, workspace );

    ISystemConfig systemConfig = PentahoSystem.get( ISystemConfig.class );
    if ( systemConfig != null && systemConfig.getConfiguration( "repository" ) != null ) {
      try {
        this.cacheDuration =
          Integer.parseInt( systemConfig.getConfiguration( "repository" ).getProperties().getProperty(
            "cache-ttl", "300" ) );


        this.cacheSize =
          Integer.parseInt( systemConfig.getConfiguration( "repository" ).getProperties().getProperty(
            "cache-size", "100" ) );
      } catch ( IOException e ) {
        logger.info( "Could not find repository.cache-duration" );
      }
    }
View Full Code Here

Examples of org.pentaho.platform.api.engine.ISystemConfig

import org.pentaho.platform.api.engine.ISystemConfig;

public class SqlMetadataQueryExecTest {
  @Test
  public void testDriverClassesToForceMetaNoEntries() throws IOException {
    ISystemConfig sysConfig = mock( ISystemConfig.class );
    IConfiguration config = mock( IConfiguration.class );
    when( sysConfig.getConfiguration( SqlMetadataQueryExec.CONFIG_ID ) ).thenReturn( config );
    Properties props = mock( Properties.class );
    when( config.getProperties() ).thenReturn( props );
    final ArgumentCaptor<String> defaultValue = ArgumentCaptor.forClass( String.class );
    when( props.getProperty( eq( SqlMetadataQueryExec.FORCE_DB_META_CLASSES_PROP ), defaultValue.capture() ) )
        .thenAnswer( new Answer<String>() {
View Full Code Here

Examples of org.pentaho.platform.api.engine.ISystemConfig

    assertEquals( 0, sqlMetadataQueryExec.driverClassesToForceMeta.size() );
  }

  @Test
  public void testDriverClassesToForceMetaOneEntry() throws IOException {
    ISystemConfig sysConfig = mock( ISystemConfig.class );
    IConfiguration config = mock( IConfiguration.class );
    String className = "test";
    when( sysConfig.getConfiguration( SqlMetadataQueryExec.CONFIG_ID ) ).thenReturn( config );
    Properties props = mock( Properties.class );
    when( config.getProperties() ).thenReturn( props );
    when( props.getProperty( eq( SqlMetadataQueryExec.FORCE_DB_META_CLASSES_PROP ), anyString() ) ).thenReturn(
        " " + className + " " );
    SqlMetadataQueryExec sqlMetadataQueryExec = new SqlMetadataQueryExec( sysConfig );
View Full Code Here

Examples of org.pentaho.platform.api.engine.ISystemConfig

    assertTrue( sqlMetadataQueryExec.driverClassesToForceMeta.contains( className ) );
  }

  @Test
  public void testDriverClassesToForceMetaTwoEntries() throws IOException {
    ISystemConfig sysConfig = mock( ISystemConfig.class );
    IConfiguration config = mock( IConfiguration.class );
    String className = "test";
    String className2 = "test2";
    when( sysConfig.getConfiguration( SqlMetadataQueryExec.CONFIG_ID ) ).thenReturn( config );
    Properties props = mock( Properties.class );
    when( config.getProperties() ).thenReturn( props );
    when( props.getProperty( eq( SqlMetadataQueryExec.FORCE_DB_META_CLASSES_PROP ), anyString() ) ).thenReturn(
        " , " + className + " , " + className2 + " ,,, " );
    SqlMetadataQueryExec sqlMetadataQueryExec = new SqlMetadataQueryExec( sysConfig );
View Full Code Here

Examples of org.pentaho.platform.api.engine.ISystemConfig

    assertEquals( 0, sqlMetadataQueryExec.driverClassesToForceMeta.size() );
  }

  @Test
  public void testDriverClassesToForceMetaNullConfig() throws IOException {
    ISystemConfig sysConfig = mock( ISystemConfig.class );
    SqlMetadataQueryExec sqlMetadataQueryExec = new SqlMetadataQueryExec( sysConfig );
    assertEquals( 0, sqlMetadataQueryExec.driverClassesToForceMeta.size() );
  }
View Full Code Here

Examples of org.pentaho.platform.api.engine.ISystemConfig

    assertEquals( 0, sqlMetadataQueryExec.driverClassesToForceMeta.size() );
  }

  @Test
  public void testDriverClassesToForceMetaNullProps() throws IOException {
    ISystemConfig sysConfig = mock( ISystemConfig.class );
    IConfiguration config = mock( IConfiguration.class );
    when( sysConfig.getConfiguration( SqlMetadataQueryExec.CONFIG_ID ) ).thenReturn( config );
    SqlMetadataQueryExec sqlMetadataQueryExec = new SqlMetadataQueryExec( sysConfig );
    assertEquals( 0, sqlMetadataQueryExec.driverClassesToForceMeta.size() );
  }
View Full Code Here

Examples of org.pentaho.platform.api.engine.ISystemConfig

    assertEquals( 0, sqlMetadataQueryExec.driverClassesToForceMeta.size() );
  }

  @Test
  public void testDriverClassesToForceMetaIOE() throws IOException {
    ISystemConfig sysConfig = mock( ISystemConfig.class );
    IConfiguration config = mock( IConfiguration.class );
    when( sysConfig.getConfiguration( SqlMetadataQueryExec.CONFIG_ID ) ).thenReturn( config );
    when( config.getProperties() ).thenThrow( new IOException() );
    SqlMetadataQueryExec sqlMetadataQueryExec = new SqlMetadataQueryExec( sysConfig );
    assertEquals( 0, sqlMetadataQueryExec.driverClassesToForceMeta.size() );
  }
View Full Code Here

Examples of org.pentaho.platform.api.engine.ISystemConfig

   * </ul>
   */
  @Override
  public void init( final Session systemSession, final Map conf ) throws RepositoryException {
    this.configuration = conf;
    ISystemConfig settings = PentahoSystem.get( ISystemConfig.class );
    if ( settings != null ) {
      useCachingEntryCollector = "true".equals( settings.getProperty( "system.cachingEntryCollector" ) );
    }
    super.init( systemSession, conf );
    // original initRootACL should run during super.init call above
    updateRootAcl( (SessionImpl) systemSession, new ACLEditor( session, this ) );
    this.initialized = true;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.