}
break;
case CREATE_USER:
user = "__CREATE_USER_WITHOUT_PERM_TEST__";
try {
test_user_conn.securityOperations().createLocalUser(user, new PasswordToken(password));
throw new IllegalStateException("Should NOT be able to create a user");
} catch (AccumuloSecurityException e) {
if (e.getSecurityErrorCode() != SecurityErrorCode.PERMISSION_DENIED
|| root_conn.securityOperations().authenticateUser(user, new PasswordToken(password)))
throw e;
}
break;
case DROP_USER:
user = "__DROP_USER_WITHOUT_PERM_TEST__";
root_conn.securityOperations().createLocalUser(user, new PasswordToken(password));
try {
test_user_conn.securityOperations().dropLocalUser(user);
throw new IllegalStateException("Should NOT be able to delete a user");
} catch (AccumuloSecurityException e) {
if (e.getSecurityErrorCode() != SecurityErrorCode.PERMISSION_DENIED
|| !root_conn.securityOperations().authenticateUser(user, new PasswordToken(password)))
throw e;
}
break;
case ALTER_USER:
user = "__ALTER_USER_WITHOUT_PERM_TEST__";
root_conn.securityOperations().createLocalUser(user, new PasswordToken(password));
try {
test_user_conn.securityOperations().changeUserAuthorizations(user, new Authorizations("A", "B"));
throw new IllegalStateException("Should NOT be able to alter a user");
} catch (AccumuloSecurityException e) {
if (e.getSecurityErrorCode() != SecurityErrorCode.PERMISSION_DENIED || !root_conn.securityOperations().getUserAuthorizations(user).isEmpty())