public void testJDBCConnectionWithNoServersUp() throws Exception { // Need to build the URL before killing the cluster or we don't // add it to the URL list. StringBuilder sb = new StringBuilder(); sb.append("jdbc:voltdb://"); final List<String> listeners = m_config.getListenerAddresses(); for (String listener : listeners) { sb.append(listener).append(","); } String JDBCURL = sb.toString(); System.out.println("Connecting to JDBC URL: " + JDBCURL); // Shutdown the cluster. Need to do this before connection so that we // don't have stale connections in the connection pool m_config.shutDown(); boolean threw = false; try { connectClients(JDBCURL); } catch (Exception e) { assertTrue(e.getMessage().contains("Unable to establish")); threw = true; } assertTrue("Connection which should have failed did not.", threw); }