@Test public void testSetUpInvalid() throws Exception { expectedEx.expect(RuntimeException.class); expectedEx.expectMessage("Could not locate either jconn2.jar or jconn3.jar file in the classpath"); final SQLInputs sqlInputs = SQLInputs.builder().build(); sqlInputs.setDbName("dbName"); sqlInputs.setDbServer(null); sqlInputs.setDbPort(30); netcoolDatabase.setUp(sqlInputs); }
@Override public List<String> setUp(@NotNull final SQLInputs sqlInputs) { try { Class.forName("com.sybase.jdbc3.jdbc.SybDriver"); } catch (Exception e) { try { Class.forName("com.sybase.jdbc2.jdbc.SybDriver"); } catch (ClassNotFoundException ex) { throw new RuntimeException("Could not locate either jconn2.jar or jconn3.jar file in the classpath!"); } } final StringBuilder connectionSb = new StringBuilder(String.format("jdbc:sybase:Tds:%s:%d", sqlInputs.getDbServer(), sqlInputs.getDbPort())); if (StringUtils.isNoneEmpty(sqlInputs.getDbName())) { connectionSb.append(FORWARD_SLASH) .append(sqlInputs.getDbName()); } final List<String> dbUrls = getDbUrls(sqlInputs.getDbUrl()); dbUrls.add(connectionSb.toString()); return dbUrls; }
NetcoolDatabase implements SqlDatabase { @Override public List<String> setUp(@NotNull final SQLInputs sqlInputs) { try { Class.forName("com.sybase.jdbc3.jdbc.SybDriver"); } catch (Exception e) { try { Class.forName("com.sybase.jdbc2.jdbc.SybDriver"); } catch (ClassNotFoundException ex) { throw new RuntimeException("Could not locate either jconn2.jar or jconn3.jar file in the classpath!"); } } final StringBuilder connectionSb = new StringBuilder(String.format("jdbc:sybase:Tds:%s:%d", sqlInputs.getDbServer(), sqlInputs.getDbPort())); if (StringUtils.isNoneEmpty(sqlInputs.getDbName())) { connectionSb.append(FORWARD_SLASH) .append(sqlInputs.getDbName()); } final List<String> dbUrls = getDbUrls(sqlInputs.getDbUrl()); dbUrls.add(connectionSb.toString()); return dbUrls; } }
NetcoolDatabase implements SqlDatabase { @Override public List<String> setUp(@NotNull final SQLInputs sqlInputs) { try { Class.forName("com.sybase.jdbc3.jdbc.SybDriver"); } catch (Exception e) { try { Class.forName("com.sybase.jdbc2.jdbc.SybDriver"); } catch (ClassNotFoundException ex) { throw new RuntimeException("Could not locate either jconn2.jar or jconn3.jar file in the classpath!"); } } final StringBuilder connectionSb = new StringBuilder(String.format("jdbc:sybase:Tds:%s:%d", sqlInputs.getDbServer(), sqlInputs.getDbPort())); if (StringUtils.isNoneEmpty(sqlInputs.getDbName())) { connectionSb.append(FORWARD_SLASH) .append(sqlInputs.getDbName()); } final List<String> dbUrls = getDbUrls(sqlInputs.getDbUrl()); dbUrls.add(connectionSb.toString()); return dbUrls; }  }
NetcoolDatabase implements SqlDatabase { @Override public List<String> setUp(@NotNull final SQLInputs sqlInputs) { try { Class.forName("com.sybase.jdbc3.jdbc.SybDriver"); } catch (Exception e) { try { Class.forName("com.sybase.jdbc2.jdbc.SybDriver"); } catch (ClassNotFoundException ex) { throw new RuntimeException("Could not locate either jconn2.jar or jconn3.jar file in the classpath!"); } } final StringBuilder connectionSb = new StringBuilder(String.format("jdbc:sybase:Tds:%s:%d", sqlInputs.getDbServer(), sqlInputs.getDbPort())); if (StringUtils.isNoneEmpty(sqlInputs.getDbName())) { connectionSb.append(FORWARD_SLASH) .append(sqlInputs.getDbName()); } final List<String> dbUrls = getDbUrls(sqlInputs.getDbUrl()); dbUrls.add(connectionSb.toString()); return dbUrls; }  @Override List<String> setUp(@NotNull final SQLInputs sqlInputs); }
NetcoolDatabase implements SqlDatabase { @Override public List<String> setUp(@NotNull final SQLInputs sqlInputs) { try { Class.forName("com.sybase.jdbc3.jdbc.SybDriver"); } catch (Exception e) { try { Class.forName("com.sybase.jdbc2.jdbc.SybDriver"); } catch (ClassNotFoundException ex) { throw new RuntimeException("Could not locate either jconn2.jar or jconn3.jar file in the classpath!"); } } final StringBuilder connectionSb = new StringBuilder(String.format("jdbc:sybase:Tds:%s:%d", sqlInputs.getDbServer(), sqlInputs.getDbPort())); if (StringUtils.isNoneEmpty(sqlInputs.getDbName())) { connectionSb.append(FORWARD_SLASH) .append(sqlInputs.getDbName()); } final List<String> dbUrls = getDbUrls(sqlInputs.getDbUrl()); dbUrls.add(connectionSb.toString()); return dbUrls; }  @Override List<String> setUp(@NotNull final SQLInputs sqlInputs);  }