@Test
  public void testPerformTablePermissions() throws Throwable {
    // initialize fake objects.
    String fakeUser = "user";
    TAccessControlEntity tce = new TAccessControlEntity();
    tce.setActions("R");
    tce.setTableName(Bytes.toString(tableAname));
    tce.setScope(TPermissionScope.TABLE);
    tce.setUsername(fakeUser);

    ThriftHBaseServiceHandler handler = createHandler();
    handler.grant(tce);

    List<UserPermission> permissionList = AccessControlClient
      .getUserPermissions(UTIL.getConnection(), Bytes.toString(tableAname), fakeUser);
    // we only grant one R permission
    assertEquals(permissionList.size(), 1);

    Permission.Action[] actions = permissionList.get(0).getPermission().getActions();
    assertEquals(actions.length, 1);
    assertEquals(actions[0], Permission.Action.READ);

    // than revoke the permission
    handler.revoke(tce);
    permissionList = AccessControlClient.getUserPermissions(UTIL.getConnection(),
      Bytes.toString(tableAname), fakeUser);

    // it should return an empty list
    assertEquals(0, permissionList.size());
  }
Verify that thrift2 client calling thrift server can get the thrift server type correctly.
hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift2/TestThriftHBaseServiceHandler.java