@Test public void testGetUrlPassword() throws KettleDatabaseException, MalformedURLException { String testUsername = "testUsername"; String testPassword = "testPassword"; baseSimbaDatabaseMeta.setUsername( testUsername ); baseSimbaDatabaseMeta.setPassword( testPassword ); String testHost = "testHost"; String testPort = "1111"; String testDb = "testDb"; String urlString = baseSimbaDatabaseMeta.getURL( testHost, testPort, testDb ); assertTrue( urlString.startsWith( jdbcPrefix ) ); URL url = new URL( "http: assertEquals( testHost, url.getHost() ); assertEquals( Integer.valueOf( testPort ).intValue(), url.getPort() ); assertEquals( "/" + testDb + ";AuthMech=3;UID=" + testUsername + ";PWD=" + testPassword, url.getPath() ); }
@Override public String getURL( String hostname, String port, String databaseName ) { return SimbaUrl.Builder.create() .withAccessType( getAccessType() ) .withDatabaseName( databaseName ) .withPort( port ) .withDefaultPort( getDefaultDatabasePort() ) .withHostname( hostname ) .withJdbcPrefix( getJdbcPrefix() ) .withUsername( getUsername() ) .withPassword( getPassword() ) .withIsKerberos( isKerberos() ) .build() .getURL(); }
BaseSimbaDatabaseMeta extends Hive2DatabaseMeta { @Override public String getURL( String hostname, String port, String databaseName ) { return SimbaUrl.Builder.create() .withAccessType( getAccessType() ) .withDatabaseName( databaseName ) .withPort( port ) .withDefaultPort( getDefaultDatabasePort() ) .withHostname( hostname ) .withJdbcPrefix( getJdbcPrefix() ) .withUsername( getUsername() ) .withPassword( getPassword() ) .withIsKerberos( isKerberos() ) .build() .getURL(); } }
BaseSimbaDatabaseMeta extends Hive2DatabaseMeta { @Override public String getURL( String hostname, String port, String databaseName ) { return SimbaUrl.Builder.create() .withAccessType( getAccessType() ) .withDatabaseName( databaseName ) .withPort( port ) .withDefaultPort( getDefaultDatabasePort() ) .withHostname( hostname ) .withJdbcPrefix( getJdbcPrefix() ) .withUsername( getUsername() ) .withPassword( getPassword() ) .withIsKerberos( isKerberos() ) .build() .getURL(); } BaseSimbaDatabaseMeta( DriverLocator driverLocator, NamedClusterService namedClusterService,
                         MetastoreLocator metastoreLocator ); }
BaseSimbaDatabaseMeta extends Hive2DatabaseMeta { @Override public String getURL( String hostname, String port, String databaseName ) { return SimbaUrl.Builder.create() .withAccessType( getAccessType() ) .withDatabaseName( databaseName ) .withPort( port ) .withDefaultPort( getDefaultDatabasePort() ) .withHostname( hostname ) .withJdbcPrefix( getJdbcPrefix() ) .withUsername( getUsername() ) .withPassword( getPassword() ) .withIsKerberos( isKerberos() ) .build() .getURL(); } BaseSimbaDatabaseMeta( DriverLocator driverLocator, NamedClusterService namedClusterService,
                         MetastoreLocator metastoreLocator ); @Override abstract String getDriverClass(); @Override int[] getAccessTypeList(); @Override String getURL( String hostname, String port, String databaseName ); @Override String getFieldDefinition( ValueMetaInterface v, String tk, String pk, boolean useAutoinc,
                                    boolean addFieldname, boolean addCr ); }
BaseSimbaDatabaseMeta extends Hive2DatabaseMeta { @Override public String getURL( String hostname, String port, String databaseName ) { return SimbaUrl.Builder.create() .withAccessType( getAccessType() ) .withDatabaseName( databaseName ) .withPort( port ) .withDefaultPort( getDefaultDatabasePort() ) .withHostname( hostname ) .withJdbcPrefix( getJdbcPrefix() ) .withUsername( getUsername() ) .withPassword( getPassword() ) .withIsKerberos( isKerberos() ) .build() .getURL(); } BaseSimbaDatabaseMeta( DriverLocator driverLocator, NamedClusterService namedClusterService,
                         MetastoreLocator metastoreLocator ); @Override abstract String getDriverClass(); @Override int[] getAccessTypeList(); @Override String getURL( String hostname, String port, String databaseName ); @Override String getFieldDefinition( ValueMetaInterface v, String tk, String pk, boolean useAutoinc,
                                    boolean addFieldname, boolean addCr );  }