/** SHOW CURRENT ROLE */ @Test public void testShowCurrentRole() throws Exception { DDLWork work = analyze(parse("SHOW CURRENT ROLES")); RoleDDLDesc roleDDLDesc = work.getRoleDDLDesc(); Assert.assertEquals(PrincipalType.USER, roleDDLDesc.getPrincipalType()); Assert.assertEquals(RoleOperation.SHOW_CURRENT_ROLE, roleDDLDesc.getOperation()); }
/** CREATE ROLE ... */ @Test public void testCreateRole() throws Exception { DDLWork work = analyze(parse("CREATE ROLE " + ROLE)); RoleDDLDesc roleDesc = work.getRoleDDLDesc(); Assert.assertNotNull("Role should not be null", roleDesc); Assert.assertEquals(RoleOperation.CREATE_ROLE, roleDesc.getOperation()); Assert.assertFalse("Did not expect a group", roleDesc.getGroup()); Assert.assertEquals(ROLE, roleDesc.getName()); }
/** SHOW ROLE GRANT GROUP ... */ @Test public void testShowRoleGrantGroup() throws Exception { DDLWork work = analyze(parse("SHOW ROLE GRANT GROUP " + GROUP)); RoleDDLDesc roleDesc = work.getRoleDDLDesc(); Assert.assertNotNull("Role should not be null", roleDesc); Assert.assertEquals(RoleOperation.SHOW_ROLE_GRANT, roleDesc.getOperation()); Assert.assertEquals(PrincipalType.GROUP, roleDesc.getPrincipalType()); Assert.assertEquals(GROUP, roleDesc.getName()); }
/** SHOW ROLES */ @Test public void testShowRoles() throws Exception { DDLWork work = analyze(parse("SHOW ROLES")); RoleDDLDesc roleDDLDesc = work.getRoleDDLDesc(); Assert.assertEquals(RoleOperation.SHOW_ROLES, roleDDLDesc.getOperation()); }