private void prepareConfiguration() throws IOException { databaseConfiguration.setDatabaseUrl( String.format( "jdbc:postgresql://%1$s:%2$s/%3$s", configuration.getHost(), configuration.getPort(), configuration.getDatabaseName())); databaseConfiguration.setDatabaseUser(getSystemUser()); databaseConfiguration.setDatabasePassword(getSystemPassword()); }
public DataSource systemDataSource() { final PGSimpleDataSource dataSource = new PGSimpleDataSource(); dataSource.setServerName(configuration.getHost()); dataSource.setPortNumber(configuration.getPort()); dataSource.setUser(getSystemUser()); dataSource.setPassword(getSystemPassword()); dataSource.setDatabaseName(configuration.getDatabaseName()); return dataSource; }
public DataSource superDataSource() { final PGSimpleDataSource dataSource = new PGSimpleDataSource(); dataSource.setServerName(configuration.getHost()); dataSource.setPortNumber(configuration.getPort()); dataSource.setUser(configuration.getUser()); dataSource.setPassword(configuration.getPassword()); dataSource.setDatabaseName(POSTGRES_SUPER_DATABASE); return dataSource; }
private DataSource sharkDataSource() { final PGSimpleDataSource dataSource = new PGSimpleDataSource(); dataSource.setServerName(configuration.getHost()); dataSource.setPortNumber(configuration.getPort()); dataSource.setUser(SHARK_USERNAME); dataSource.setPassword(SHARK_PASSWORD); dataSource.setDatabaseName(configuration.getDatabaseName()); return dataSource; }
@Test public final void testSetPort() throws BlindTestException { final Configuration locConfiguration = new DefaultConfiguration().load(); locConfiguration.setPort("123"); assertEquals(Integer.valueOf(123), locConfiguration.getPort()); }