protected static String buildPoolName( DatabaseMeta dbMeta, String partitionId ) {
    return dbMeta.getName() + Const.NVL( dbMeta.getDatabaseName(), "" )
        + Const.NVL( dbMeta.getHostname(),  ""  ) + Const.NVL( dbMeta.getDatabasePortNumberString(),  ""  )
        + Const.NVL( partitionId, "" );
  }
@Test
  public void testGetConnectionName() {
    when( dbMeta.getName() ).thenReturn( "CP2" );
    String connectionName = ConnectionPoolUtil.buildPoolName( dbMeta, "" );
    assertEquals( "CP2", connectionName );
    assertNotEquals( "CP2pentaho", connectionName );

    when( dbMeta.getDatabaseName() ).thenReturn( "pentaho" );
    connectionName = ConnectionPoolUtil.buildPoolName( dbMeta, "" );
    assertEquals( "CP2pentaho", connectionName );
    assertNotEquals( "CP2pentaholocal", connectionName );

    when( dbMeta.getHostname() ).thenReturn( "local" );
    connectionName = ConnectionPoolUtil.buildPoolName( dbMeta, "" );
    assertEquals( "CP2pentaholocal", connectionName );
    assertNotEquals( "CP2pentaholocal3306", connectionName );

    when( dbMeta.getDatabasePortNumberString() ).thenReturn( "3306" );
    connectionName = ConnectionPoolUtil.buildPoolName( dbMeta, "" );
    assertEquals( "CP2pentaholocal3306", connectionName );
  }