@Test public void testSetUpNoServerName() throws ClassNotFoundException, SQLException { expectedEx.expect(IllegalArgumentException.class); expectedEx.expectMessage("host not valid"); SybaseDatabase sybaseDatabase = new SybaseDatabase(); final SQLInputs sqlInputs = SQLInputs.builder().build(); sqlInputs.setDbName(DB_NAME); sqlInputs.setDbServer(null); sqlInputs.setDbPort(DB_PORT); sybaseDatabase.setUp(sqlInputs); }
@Override public List<String> setUp(@NotNull final SQLInputs sqlInputs) { loadClassForName("net.sourceforge.jtds.jdbc.Driver"); final String host = SQLUtils.getIPv4OrIPv6WithSquareBracketsHost(sqlInputs.getDbServer()); final StringBuilder connectionSb = new StringBuilder(String.format("jdbc:jtds:sybase: if (StringUtils.isNoneEmpty(sqlInputs.getDbName())) { connectionSb.append(FORWARD_SLASH) .append(sqlInputs.getDbName()); } connectionSb.append(";prepareSQL=1;useLOBs=false;TDS=4.2;"); final List<String> dbUrls = getDbUrls(sqlInputs.getDbUrl()); dbUrls.add(connectionSb.toString()); return dbUrls; }
SybaseDatabase implements SqlDatabase { @Override public List<String> setUp(@NotNull final SQLInputs sqlInputs) { loadClassForName("net.sourceforge.jtds.jdbc.Driver"); final String host = SQLUtils.getIPv4OrIPv6WithSquareBracketsHost(sqlInputs.getDbServer()); final StringBuilder connectionSb = new StringBuilder(String.format("jdbc:jtds:sybase: if (StringUtils.isNoneEmpty(sqlInputs.getDbName())) { connectionSb.append(FORWARD_SLASH) .append(sqlInputs.getDbName()); } connectionSb.append(";prepareSQL=1;useLOBs=false;TDS=4.2;"); final List<String> dbUrls = getDbUrls(sqlInputs.getDbUrl()); dbUrls.add(connectionSb.toString()); return dbUrls; } }
SybaseDatabase implements SqlDatabase { @Override public List<String> setUp(@NotNull final SQLInputs sqlInputs) { loadClassForName("net.sourceforge.jtds.jdbc.Driver"); final String host = SQLUtils.getIPv4OrIPv6WithSquareBracketsHost(sqlInputs.getDbServer()); final StringBuilder connectionSb = new StringBuilder(String.format("jdbc:jtds:sybase: if (StringUtils.isNoneEmpty(sqlInputs.getDbName())) { connectionSb.append(FORWARD_SLASH) .append(sqlInputs.getDbName()); } connectionSb.append(";prepareSQL=1;useLOBs=false;TDS=4.2;"); final List<String> dbUrls = getDbUrls(sqlInputs.getDbUrl()); dbUrls.add(connectionSb.toString()); return dbUrls; }  }
SybaseDatabase implements SqlDatabase { @Override public List<String> setUp(@NotNull final SQLInputs sqlInputs) { loadClassForName("net.sourceforge.jtds.jdbc.Driver"); final String host = SQLUtils.getIPv4OrIPv6WithSquareBracketsHost(sqlInputs.getDbServer()); final StringBuilder connectionSb = new StringBuilder(String.format("jdbc:jtds:sybase: if (StringUtils.isNoneEmpty(sqlInputs.getDbName())) { connectionSb.append(FORWARD_SLASH) .append(sqlInputs.getDbName()); } connectionSb.append(";prepareSQL=1;useLOBs=false;TDS=4.2;"); final List<String> dbUrls = getDbUrls(sqlInputs.getDbUrl()); dbUrls.add(connectionSb.toString()); return dbUrls; }  @Override List<String> setUp(@NotNull final SQLInputs sqlInputs); }
SybaseDatabase implements SqlDatabase { @Override public List<String> setUp(@NotNull final SQLInputs sqlInputs) { loadClassForName("net.sourceforge.jtds.jdbc.Driver"); final String host = SQLUtils.getIPv4OrIPv6WithSquareBracketsHost(sqlInputs.getDbServer()); final StringBuilder connectionSb = new StringBuilder(String.format("jdbc:jtds:sybase: if (StringUtils.isNoneEmpty(sqlInputs.getDbName())) { connectionSb.append(FORWARD_SLASH) .append(sqlInputs.getDbName()); } connectionSb.append(";prepareSQL=1;useLOBs=false;TDS=4.2;"); final List<String> dbUrls = getDbUrls(sqlInputs.getDbUrl()); dbUrls.add(connectionSb.toString()); return dbUrls; }  @Override List<String> setUp(@NotNull final SQLInputs sqlInputs);  }