private void removeTestUser() throws RepositoryException { testUser.remove(); superuser.save(); testUser = null; }
public static void removeUser(Context context, User user) throws RepositoryException { Iterator<Group> groups = user.memberOf(); while (groups.hasNext()) { groups.next().removeMember(user); } context.getAuthorizables().remove(user.getID()); user.remove(); }
@Override protected void tearDown() throws Exception { try { if (testUser != null) { testUser.remove(); } superuser.save(); } finally { super.tearDown(); } }
@Override public void tearDown() throws Exception { try { testUser.remove(); superuser.save(); } finally { super.tearDown(); } }
@Override public void after() throws Exception { if (user != null) { user.remove(); root.commit(); } }
@Override protected void tearDown() throws Exception { if (testuser != null) { testuser.remove(); if (doSave) { superuser.save(); } } super.tearDown(); }
@Override protected void tearDown() throws Exception { try { if (testSession != null && testSession.isLive()) { testSession.logout(); } user.remove(); superuser.save(); } finally { super.tearDown(); } }
@Test public void testRemoveAdmin() throws NotExecutableException { try { admin.remove(); superuser.save(); fail("The admin user cannot be removed."); } catch (RepositoryException e) { // OK superuser cannot be removed. not even by the superuser itself. } }
@Override public void after() throws Exception { try { if (testUser != null) { testUser.remove(); } root.commit(); } finally { super.after(); } }
@Override public void after() throws Exception { try { if (user != null) { user.remove(); root.commit(); } } finally { super.after(); } }
@Override protected void tearDown() throws Exception { newUser.remove(); save(superuser); super.tearDown(); }
@Test public void testGetDeclaredMembersWithMemberRemoved() throws RepositoryException { String uid = user.getID(); user.remove(); superuser.save(); user = null; Iterator<Authorizable> it = group.getDeclaredMembers(); while (it.hasNext()) { Authorizable a = it.next(); assertFalse(uid.equals(a.getID())); } }
@Override public void after() throws Exception { try { root.refresh(); impersonator.remove(); root.commit(); } finally { super.after(); } }
@After public void after() throws Exception { if (user != null) { user.remove(); root.commit(); } root = null; super.after(); }
@Test public void testUserWithoutPassword() throws Exception { try { pwChangeAction.onPasswordChange(user, "changedPassword", createRoot(null), namePathMapper); } finally { user.remove(); } } }
@Override protected void tearDown() throws Exception { try { testUser.remove(); adminSession.save(); adminSession.logout(); } finally { super.tearDown(); } }
@Override public void after() throws Exception { try { testUser.remove(); testGroup.remove(); root.commit(); } finally { super.after(); } }
@Test public void testTreeBasedSystemUserPrincipal() throws Exception { User systemUser = getUserManager(root).createSystemUser("systemUser" + UUID.randomUUID(), null); root.commit(); try { Principal principal = principalProvider.getPrincipal(systemUser.getPrincipal().getName()); assertTrue(principal instanceof SystemUserPrincipalImpl); } finally { systemUser.remove(); root.commit(); } }
@Test public void testCreateRemoveUser() throws RepositoryException { User u = mgr.createUser("u", "u"); assertFalse(root.hasPendingChanges()); u.remove(); assertFalse(root.hasPendingChanges()); }
@Test public void testGetImpersonatorsImpersonatorRemoved() throws Exception { Principal p = impersonator.getPrincipal(); impersonator.remove(); PrincipalIterator it = impersonation.getImpersonators(); assertTrue(it.hasNext()); assertTrue(Iterators.contains(it, p)); }