Package org.pentaho.database.service

Examples of org.pentaho.database.service.DatabaseDialectService


  protected void setUp() throws Exception {
  }

  public void testCreatePoolNoDialectService() throws Exception {
    DatabaseDialectService dialectService = new DatabaseDialectService( false );
    final DatabaseTypeHelper databaseTypeHelper = new DatabaseTypeHelper( dialectService.getDatabaseTypes() );
    final DatabaseConnection con = new DatabaseConnection();
    con.setId( "Postgres" );
    con.setName( "Postgres" );
    con.setAccessType( DatabaseAccessType.NATIVE );
    con.setDatabaseType( databaseTypeHelper.getDatabaseTypeByShortName( "GENERIC" ) );
View Full Code Here


      assertNotNull( ex );
    }
  }

  public void testCreatePoolNoDialect() throws Exception {
    DatabaseDialectService dialectService = new DatabaseDialectService( false );
    final DatabaseTypeHelper databaseTypeHelper = new DatabaseTypeHelper( dialectService.getDatabaseTypes() );
    mp = new MicroPlatform();
    mp.defineInstance( IDatabaseDialectService.class, dialectService );
    mp.start();

    final DatabaseConnection con = new DatabaseConnection();
View Full Code Here

    }

  }

  public void testCreatePoolNoClassName() throws Exception {
    DatabaseDialectService dialectService = new DatabaseDialectService( false );
    final DatabaseTypeHelper databaseTypeHelper = new DatabaseTypeHelper( dialectService.getDatabaseTypes() );
    mp = new MicroPlatform();
    mp.defineInstance( IDatabaseDialectService.class, dialectService );
    mp.start();

    final DatabaseConnection con = new DatabaseConnection();
View Full Code Here

    }

  }

  public void testCreateDatasourceNoDialect() throws Exception {
    DatabaseDialectService dialectService = new DatabaseDialectService( false );
    final DatabaseTypeHelper databaseTypeHelper = new DatabaseTypeHelper( dialectService.getDatabaseTypes() );
    mp = new MicroPlatform();
    mp.defineInstance( IDatabaseDialectService.class, dialectService );
    mp.start();
    final DatabaseConnection con = new DatabaseConnection();
    con.setId( "Postgres" );
View Full Code Here

      assertNotNull( ex );
    }
  }

  public void testCreateDatasourceNoClassName() throws Exception {
    DatabaseDialectService dialectService = new DatabaseDialectService( false );
    final DatabaseTypeHelper databaseTypeHelper = new DatabaseTypeHelper( dialectService.getDatabaseTypes() );
    mp = new MicroPlatform();
    mp.defineInstance( IDatabaseDialectService.class, dialectService );
    mp.start();

    final DatabaseConnection con = new DatabaseConnection();
View Full Code Here

  }

  @Override
  public DatabaseConnection unmarshal( DatabaseConnectionDto dbConnDto ) throws Exception {
    if ( dbConnDto != null ) {
      IDatabaseDialectService databaseDialectService = new DatabaseDialectService();
      DatabaseTypeHelper databaseTypeHelper = new DatabaseTypeHelper( databaseDialectService.getDatabaseTypes() );
      DatabaseConnection dbConn = new DatabaseConnection();
      dbConn.setId( dbConnDto.getId() );
      dbConn.setAccessType( dbConnDto.getAccessType() );
      dbConn.setAccessTypeValue( dbConnDto.getAccessTypeValue() );
      dbConn.setChanged( dbConnDto.getChanged() );
View Full Code Here

    doReturn( new RepositoryFile.Builder( parentFolderId, "databases" ).folder( true ).build() ).when( repo ).getFile(
        "/etc/pdi/databases" );
    doReturn( reservedChars ).when( repo ).getReservedChars();

    IDatasourceMgmtService datasourceMgmtService =
        new JcrBackedDatasourceMgmtService( repo, new DatabaseDialectService() );

    IDatabaseConnection databaseConnection = createDatabaseConnection( EXP_DBMETA_NAME );
    datasourceMgmtService.createDatasource( databaseConnection );

    verify( repo ).createFile( eq( parentFolderId ),
View Full Code Here

    doReturn( reservedChars ).when( repo ).getReservedChars();
    // stub out get file to delete
    doReturn( new RepositoryFile.Builder( fileId, EXP_DBMETA_NAME + dotKdb ).build() ).when( repo ).getFile(
        databasesFolderPath + RepositoryFile.SEPARATOR + EXP_DBMETA_NAME + dotKdb );
    IDatasourceMgmtService datasourceMgmtService =
        new JcrBackedDatasourceMgmtService( repo, new DatabaseDialectService() );

    datasourceMgmtService.deleteDatasourceByName( EXP_DBMETA_NAME );

    verify( repo ).deleteFile( eq( fileId ), eq( true ), anyString() );
  }
View Full Code Here

    doReturn( f ).when( repo ).getFile( databasesFolderPath + RepositoryFile.SEPARATOR + EXP_DBMETA_NAME + dotKdb );
    // stub out update file which requires a file to be returned
    doReturn( f ).when( repo )
        .updateFile( any( RepositoryFile.class ), any( NodeRepositoryFileData.class ), anyString() );
    IDatasourceMgmtService datasourceMgmtService =
        new JcrBackedDatasourceMgmtService( repo, new DatabaseDialectService() );

    IDatabaseConnection databaseConnection = createDatabaseConnection( EXP_DBMETA_NAME );
    updateDatabaseConnection( databaseConnection );
    datasourceMgmtService.updateDatasourceByName( EXP_DBMETA_NAME, databaseConnection );
View Full Code Here

        databasesFolderPath );
    doReturn( reservedChars ).when( repo ).getReservedChars();
    // stub out get file not found
    doReturn( null ).when( repo ).getFile( databasesFolderPath + RepositoryFile.SEPARATOR + fileName );
    IDatasourceMgmtService datasourceMgmtService =
        new JcrBackedDatasourceMgmtService( repo, new DatabaseDialectService() );

    Assert.assertNull( datasourceMgmtService.getDatasourceByName( datasourceName ) );
  }
View Full Code Here

TOP

Related Classes of org.pentaho.database.service.DatabaseDialectService

Copyright © 2018 www.massapicom. 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.