*/
@Test
public void testRevokeRoleTable() throws Exception {
DDLWork work = analyze(parse("REVOKE " + ALL + " ON TABLE " + TABLE
+ " FROM ROLE " + ROLE));
RevokeDesc grantDesc = work.getRevokeDesc();
Assert.assertNotNull("Revoke should not be null", grantDesc);
for (PrincipalDesc principal : assertSize(1, grantDesc.getPrincipals())) {
Assert.assertEquals(PrincipalType.ROLE, principal.getType());
Assert.assertEquals(ROLE, principal.getName());
}
for (PrivilegeDesc privilege : assertSize(1, grantDesc.getPrivileges())) {
Assert.assertEquals(Privilege.ALL, privilege.getPrivilege());
}
Assert.assertTrue("Expected table", grantDesc.getPrivilegeSubjectDesc()
.getTable());
Assert.assertEquals(TABLE, grantDesc.getPrivilegeSubjectDesc().getObject());
}