private void checkBadUrl(String url) throws SQLException {
    try{
      DriverManager.getConnection(url, "", "");
      fail("Should have thrown JdbcUriParseException but did not ");
    } catch(JdbcUriParseException e) {
      assertTrue(e.getMessage().contains("Bad URL format"));
    }
  }
Tests malformed JDBC URL
@throws Exception
itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcDriver2.java