Search in sources :

Example 81 with After

use of org.junit.After in project jackrabbit-oak by apache.

the class MembershipBaseTest method after.

@After
public void after() throws Exception {
    try {
        root.refresh();
        for (String path : Iterables.concat(testUsers, testGroups)) {
            Authorizable auth = userMgr.getAuthorizableByPath(path);
            if (auth != null) {
                auth.remove();
            }
        }
        root.commit();
    } finally {
        testUsers.clear();
        testGroups.clear();
        super.after();
    }
}
Also used : Authorizable(org.apache.jackrabbit.api.security.user.Authorizable) After(org.junit.After)

Example 82 with After

use of org.junit.After in project jackrabbit-oak by apache.

the class ValidNamesTest method tearDown.

@After
public void tearDown() throws RepositoryException {
    Session s = testNode.getSession();
    s.removeItem(TEST_PATH);
    s.save();
    Repository r = s.getRepository();
    s.logout();
    dispose(r);
}
Also used : Repository(javax.jcr.Repository) Session(javax.jcr.Session) After(org.junit.After)

Example 83 with After

use of org.junit.After in project jackrabbit-oak by apache.

the class CreateUserTest method tearDown.

@After
@Override
protected void tearDown() throws Exception {
    superuser.refresh(false);
    // remove all created users again
    for (Object createdUser : createdUsers) {
        Authorizable auth = (Authorizable) createdUser;
        try {
            auth.remove();
            superuser.save();
        } catch (RepositoryException e) {
            log.warn("Failed to remove User " + auth.getID() + " during tearDown.");
        }
    }
    super.tearDown();
}
Also used : Authorizable(org.apache.jackrabbit.api.security.user.Authorizable) RepositoryException(javax.jcr.RepositoryException) After(org.junit.After)

Example 84 with After

use of org.junit.After in project jackrabbit-oak by apache.

the class ActiveDeletedBlobCollectionIT method after.

@After
public void after() {
    new ExecutorCloser(executorService).close();
    executorService.shutdown();
    IndexDefinition.setDisableStoredIndexDefinition(false);
}
Also used : ExecutorCloser(org.apache.jackrabbit.oak.commons.concurrent.ExecutorCloser) After(org.junit.After)

Example 85 with After

use of org.junit.After in project jackrabbit-oak by apache.

the class AbstractRandomizedTest method tearDown.

@After
public void tearDown() throws Exception {
    clearContent();
    clearAuthorizables();
    for (JackrabbitSession s : writeSessions) {
        if (s.isLive()) {
            s.logout();
        }
    }
    for (Session s : readSessions) {
        if (s.isLive()) {
            s.logout();
        }
    }
    jackrabbitRepository = dispose(jackrabbitRepository);
    oakRepository = dispose(oakRepository);
}
Also used : JackrabbitSession(org.apache.jackrabbit.api.JackrabbitSession) Session(javax.jcr.Session) JackrabbitSession(org.apache.jackrabbit.api.JackrabbitSession) After(org.junit.After)

Aggregations

After (org.junit.After)1427 File (java.io.File)284 Before (org.junit.Before)137 Test (org.junit.Test)127 List (java.util.List)87 IOException (java.io.IOException)83 Assert (org.junit.Assert)70 Collectors (java.util.stream.Collectors)67 ArrayList (java.util.ArrayList)64 Map (java.util.Map)62 Assert.assertEquals (org.junit.Assert.assertEquals)60 Arrays (java.util.Arrays)56 Collections (java.util.Collections)56 Assert.assertTrue (org.junit.Assert.assertTrue)54 HashMap (java.util.HashMap)53 Rule (org.junit.Rule)50 HashSet (java.util.HashSet)44 Set (java.util.Set)42 UUID (java.util.UUID)42 TimeUnit (java.util.concurrent.TimeUnit)41