public static DataSource getDataSource( LogChannelInterface log, DatabaseMeta dbMeta, String partitionId ) throws KettleDatabaseException {
    int initialSize = dbMeta.getInitialPoolSize();
    int maximumSize = dbMeta.getMaximumPoolSize();

    lock.lock();
    try {
      if ( !isDataSourceRegistered( dbMeta, partitionId ) ) {
        addPoolableDataSource( log, dbMeta, partitionId, initialSize, maximumSize );
      }
    } finally {
      lock.unlock();
    }
    return dataSources.get( getDataSourceName( dbMeta, partitionId ) );
  }
@Test
  public void testGetConnectionEncrypted() throws Exception {
    when( dbMeta.getName() ).thenReturn( "CP2" );
    when( dbMeta.getPassword() ).thenReturn( ENCR_PASSWORD );
    when( dbMeta.getInitialPoolSize() ).thenReturn( 1 );
    when( dbMeta.getMaximumPoolSize() ).thenReturn( 2 );
    DataSource conn = ConnectionPoolUtil.getDataSource( logChannelInterface, dbMeta, "" );
    assertNotNull( conn );
  }