@Test public void testSetUpConnectionOracleWithoutTns() throws Exception { final SQLInputs sqlInputs = SQLInputs.builder().build(); sqlInputs.setDbName(DB_NAME); sqlInputs.setDbServer(DB_SERVER); sqlInputs.setDbPort(DB_PORT); final List<String> dbUrls = oracleDatabase.setUp(sqlInputs); assertEquals(2, dbUrls.size()); assertEquals(ORACLE_URL + " assertEquals(ORACLE_URL + DB_SERVER + ":" + DB_PORT + ":" + DB_NAME, dbUrls.get(1)); }
@Override public List<String> setUp(@NotNull final SQLInputs sqlInputs) { loadClassForName("oracle.jdbc.driver.OracleDriver"); final List<String> dbUrls = getDbUrls(sqlInputs.getDbUrl()); if (isNoneEmpty(sqlInputs.getDbServer()) || isNoneEmpty(sqlInputs.getDbName())) { final String host = SQLUtils.getIPv4OrIPv6WithSquareBracketsHost(sqlInputs.getDbServer()); final String firstConnectionString = String.format("jdbc:oracle:thin:@ host, sqlInputs.getDbPort(), sqlInputs.getDbName()); final String secondConnectionString = String.format("jdbc:oracle:thin:@%s:%d:%s", host, sqlInputs.getDbPort(), sqlInputs.getDbName()); dbUrls.add(firstConnectionString); dbUrls.add(secondConnectionString); } return dbUrls; }
OracleDatabase implements SqlDatabase { @Override public List<String> setUp(@NotNull final SQLInputs sqlInputs) { loadClassForName("oracle.jdbc.driver.OracleDriver"); final List<String> dbUrls = getDbUrls(sqlInputs.getDbUrl()); if (isNoneEmpty(sqlInputs.getDbServer()) || isNoneEmpty(sqlInputs.getDbName())) { final String host = SQLUtils.getIPv4OrIPv6WithSquareBracketsHost(sqlInputs.getDbServer()); final String firstConnectionString = String.format("jdbc:oracle:thin:@ host, sqlInputs.getDbPort(), sqlInputs.getDbName()); final String secondConnectionString = String.format("jdbc:oracle:thin:@%s:%d:%s", host, sqlInputs.getDbPort(), sqlInputs.getDbName()); dbUrls.add(firstConnectionString); dbUrls.add(secondConnectionString); } return dbUrls; } }
OracleDatabase implements SqlDatabase { @Override public List<String> setUp(@NotNull final SQLInputs sqlInputs) { loadClassForName("oracle.jdbc.driver.OracleDriver"); final List<String> dbUrls = getDbUrls(sqlInputs.getDbUrl()); if (isNoneEmpty(sqlInputs.getDbServer()) || isNoneEmpty(sqlInputs.getDbName())) { final String host = SQLUtils.getIPv4OrIPv6WithSquareBracketsHost(sqlInputs.getDbServer()); final String firstConnectionString = String.format("jdbc:oracle:thin:@ host, sqlInputs.getDbPort(), sqlInputs.getDbName()); final String secondConnectionString = String.format("jdbc:oracle:thin:@%s:%d:%s", host, sqlInputs.getDbPort(), sqlInputs.getDbName()); dbUrls.add(firstConnectionString); dbUrls.add(secondConnectionString); } return dbUrls; }  }
OracleDatabase implements SqlDatabase { @Override public List<String> setUp(@NotNull final SQLInputs sqlInputs) { loadClassForName("oracle.jdbc.driver.OracleDriver"); final List<String> dbUrls = getDbUrls(sqlInputs.getDbUrl()); if (isNoneEmpty(sqlInputs.getDbServer()) || isNoneEmpty(sqlInputs.getDbName())) { final String host = SQLUtils.getIPv4OrIPv6WithSquareBracketsHost(sqlInputs.getDbServer()); final String firstConnectionString = String.format("jdbc:oracle:thin:@ host, sqlInputs.getDbPort(), sqlInputs.getDbName()); final String secondConnectionString = String.format("jdbc:oracle:thin:@%s:%d:%s", host, sqlInputs.getDbPort(), sqlInputs.getDbName()); dbUrls.add(firstConnectionString); dbUrls.add(secondConnectionString); } return dbUrls; }  @Override List<String> setUp(@NotNull final SQLInputs sqlInputs); }
OracleDatabase implements SqlDatabase { @Override public List<String> setUp(@NotNull final SQLInputs sqlInputs) { loadClassForName("oracle.jdbc.driver.OracleDriver"); final List<String> dbUrls = getDbUrls(sqlInputs.getDbUrl()); if (isNoneEmpty(sqlInputs.getDbServer()) || isNoneEmpty(sqlInputs.getDbName())) { final String host = SQLUtils.getIPv4OrIPv6WithSquareBracketsHost(sqlInputs.getDbServer()); final String firstConnectionString = String.format("jdbc:oracle:thin:@ host, sqlInputs.getDbPort(), sqlInputs.getDbName()); final String secondConnectionString = String.format("jdbc:oracle:thin:@%s:%d:%s", host, sqlInputs.getDbPort(), sqlInputs.getDbName()); dbUrls.add(firstConnectionString); dbUrls.add(secondConnectionString); } return dbUrls; }  @Override List<String> setUp(@NotNull final SQLInputs sqlInputs);  }