private void metaDataGetTableTypeTest(Set<String> tabletypes)
      throws SQLException {
    ResultSet rs = con.getMetaData().getTableTypes();

    int cnt = 0;
    while (rs.next()) {
      String tabletype = rs.getString("TABLE_TYPE");
      assertEquals("Get by index different from get by name", rs.getString(1), tabletype);
      tabletypes.remove(tabletype);
      cnt++;
    }
    rs.close();
    assertEquals("Incorrect tabletype count.", 0, tabletypes.size());
    assertTrue("Found less tabletypes then we test for.", cnt >= tabletypes.size());
  }
Test if Connection.getMetaData().getTableTypes() returns expected
 tabletypes
@param tabletypes expected table types
@throws SQLException
itests/hive-unit/src/test/java/org/apache/hive/jdbc/cbo_rp_TestJdbcDriver2.java