Esempio n. 1
0
 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());
 }
Esempio n. 2
0
 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;
 }
Esempio n. 3
0
 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;
 }
Esempio n. 4
0
 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());
 }