client.grantTablePrivilege(requestorUserName, roleName2, "server", "db3", "table5", "ALL");
Set<TSentryPrivilege> listPrivilegesByRoleName = client.listPrivilegesByRoleName(requestorUserName, roleName2, Lists.newArrayList(new Server("server"), new Database("db1")));
assertEquals("Privilege not assigned to role2 !!", 2, listPrivilegesByRoleName.size());
listPrivilegesByRoleName = client.listPrivilegesByRoleName(requestorUserName, roleName2, Lists.newArrayList(new Server("server"), new Database("db2"), new Table("table1")));
assertEquals("Privilege not assigned to role2 !!", 0, listPrivilegesByRoleName.size());
listPrivilegesByRoleName = client.listPrivilegesByRoleName(requestorUserName, roleName2, Lists.newArrayList(new Server("server"), new Database("db1"), new Table("table1")));
assertEquals("Privilege not assigned to role2 !!", 1, listPrivilegesByRoleName.size());
listPrivilegesByRoleName = client.listPrivilegesByRoleName(requestorUserName, roleName2, Lists.newArrayList(new Server("server"), new Database("db3")));
assertEquals("Privilege not assigned to role2 !!", 1, listPrivilegesByRoleName.size());