@Test
  public void testTransformerMultiTable() throws Exception {
    try {
      resetHMSClient();

      final String dbName = "testdb";
      final String ext_table = "ext_table";
      final String acidTable = "managed_table";
      final String part_ext = "part_ext";

      try {
        silentDropDatabase(dbName);
      } catch (Exception e) {
        LOG.info("Drop database failed for " + dbName);
      }

      new DatabaseBuilder()
          .setName(dbName)
          .create(client, conf);

      List<String> capabilities = new ArrayList<>();
      capabilities.add("HIVEFULLACIDWRITE");
      setHMSClient("TestTransformerMultiTable", (String[])(capabilities.toArray(new String[0])));

      Map<String, Object> tProps = new HashMap<>();
      tProps.put("DBNAME", dbName);
      tProps.put("TBLNAME", ext_table);
      tProps.put("TBLTYPE", TableType.EXTERNAL_TABLE);
      tProps.put("DROPDB", Boolean.FALSE);
      StringBuilder properties = new StringBuilder();
      properties.append("EXTERNAL").append("=").append("TRUE");
      tProps.put("PROPERTIES", properties.toString());
      Table tbl = createTableWithCapabilities(tProps);

      tProps.put("TBLNAME", acidTable);
      tProps.put("TBLTYPE", TableType.MANAGED_TABLE);
      properties = new StringBuilder();
      properties.append("transactional").append("=").append("true");
      tProps.put("PROPERTIES", properties.toString());
      tProps.put("DROPDB", Boolean.FALSE);
      tbl = createTableWithCapabilities(tProps);

      tProps = new HashMap<>();
      tProps.put("DBNAME", dbName);
      tProps.put("TBLNAME", part_ext);
      tProps.put("TBLTYPE", TableType.EXTERNAL_TABLE);
      tProps.put("DROPDB", Boolean.FALSE);
      properties = new StringBuilder();
      properties.append("EXTERNAL").append("=").append("TRUE");
      tProps.put("PROPERTIES", properties.toString());
      tProps.put("PARTITIONS", 10);
      tbl = createTableWithCapabilities(tProps);

      resetHMSClient();
      capabilities = new ArrayList<>();
      capabilities.add("EXTWRITE");
      capabilities.add("EXTREAD");
      setHMSClient("TestTransformerMultiTable", (String[])(capabilities.toArray(new String[0])));
      tbl = client.getTable(dbName, acidTable);
      assertEquals("AccessType does not match", ACCESSTYPE_NONE, tbl.getAccessType());
      tbl = client.getTable(dbName, acidTable);
      assertEquals("AccessType does not match", ACCESSTYPE_NONE, tbl.getAccessType());

      tbl = client.getTable(dbName, ext_table);
      assertEquals("AccessType does not match", ACCESSTYPE_READWRITE, tbl.getAccessType());
      tbl = client.getTable(dbName, acidTable);
      assertEquals("AccessType does not match", ACCESSTYPE_NONE, tbl.getAccessType());
      resetHMSClient();

      capabilities = new ArrayList<>();
      capabilities.add("EXTWRITE");
      capabilities.add("EXTREAD");
      capabilities.add("HIVESQL");
      capabilities.add("SPARKSQL");
      capabilities.add("HIVEBUCKET2");
      setHMSClient("TestTransformerMultiTable", (String[])(capabilities.toArray(new String[0])));
      tbl = client.getTable(dbName, acidTable);
      assertEquals("AccessType does not match", ACCESSTYPE_NONE, tbl.getAccessType());
      tbl = client.getTable(dbName, acidTable);
      assertEquals("AccessType does not match", ACCESSTYPE_NONE, tbl.getAccessType());

      tbl = client.getTable(dbName, part_ext);
      assertEquals("AccessType does not match", ACCESSTYPE_READWRITE, tbl.getAccessType());
      tbl = client.getTable(dbName, acidTable);
      assertEquals("AccessType does not match", ACCESSTYPE_NONE, tbl.getAccessType());
      resetHMSClient();

    } catch (Exception e) {
      e.printStackTrace();
      System.err.println(org.apache.hadoop.util.StringUtils.stringifyException(e));
      System.err.println("testTransformerDatabase() failed.");
      fail("testTransformerDatabase failed:" + e.getMessage());
    } finally {
      resetHMSClient();
    }
  }
EXTERNAL_TABLE
  1) Old table (name in upper case) with no capabilities
  2) Old table with no capabilities
  3a) New table with capabilities with no client requirements
  3b) New table with capabilities with no matching client requirements
  3c) New table with capabilities with partial match requirements
  3d) New table with capabilities with full match requirements
itests/hive-unit/src/test/java/org/apache/hadoop/hive/metastore/TestHiveMetastoreTransformer.java