Search in sources :

Example 71 with After

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

the class AbstractExternalAuthTest method after.

@After
public void after() throws Exception {
    try {
        destroyIDP();
        idp = null;
        if (systemSession != null) {
            systemSession.close();
        }
        // discard any pending changes
        root.refresh();
        UserManager userManager = getUserManager(root);
        Iterator<String> iter = getAllAuthorizableIds(userManager);
        while (iter.hasNext()) {
            String id = iter.next();
            if (!ids.remove(id)) {
                Authorizable a = userManager.getAuthorizable(id);
                if (a != null) {
                    a.remove();
                }
            }
        }
        root.commit();
    } finally {
        root.refresh();
        super.after();
    }
}
Also used : UserManager(org.apache.jackrabbit.api.security.user.UserManager) Authorizable(org.apache.jackrabbit.api.security.user.Authorizable) After(org.junit.After)

Example 72 with After

use of org.junit.After in project lucene-solr by apache.

the class OverseerTest method tearDown.

@After
public void tearDown() throws Exception {
    super.tearDown();
    for (Overseer overseer : overseers) {
        overseer.close();
    }
    overseers.clear();
    for (ZkStateReader reader : readers) {
        reader.close();
    }
    readers.clear();
    for (HttpShardHandlerFactory handlerFactory : httpShardHandlerFactorys) {
        handlerFactory.close();
    }
    httpShardHandlerFactorys.clear();
    for (UpdateShardHandler updateShardHandler : updateShardHandlers) {
        updateShardHandler.close();
    }
    updateShardHandlers.clear();
}
Also used : ZkStateReader(org.apache.solr.common.cloud.ZkStateReader) UpdateShardHandler(org.apache.solr.update.UpdateShardHandler) HttpShardHandlerFactory(org.apache.solr.handler.component.HttpShardHandlerFactory) After(org.junit.After)

Example 73 with After

use of org.junit.After in project lucene-solr by apache.

the class SolrMetricsIntegrationTest method afterTest.

@After
public void afterTest() throws Exception {
    SolrCoreMetricManager coreMetricManager = h.getCore().getCoreMetricManager();
    Map<String, SolrMetricReporter> reporters = metricManager.getReporters(coreMetricManager.getRegistryName());
    deleteCore();
    for (String reporterName : RENAMED_REPORTERS) {
        SolrMetricReporter reporter = reporters.get(reporterName + "@" + tag);
        MockMetricReporter mockReporter = (MockMetricReporter) reporter;
        assertTrue("Reporter " + reporterName + " was not closed: " + mockReporter, mockReporter.didClose);
    }
}
Also used : MockMetricReporter(org.apache.solr.metrics.reporters.MockMetricReporter) After(org.junit.After)

Example 74 with After

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

the class AccessControlValidatorTest method after.

@After
public void after() throws Exception {
    try {
        Tree testRoot = root.getTree(testPath);
        if (testRoot.exists()) {
            testRoot.remove();
            root.commit();
        }
    } finally {
        super.after();
    }
}
Also used : Tree(org.apache.jackrabbit.oak.api.Tree) After(org.junit.After)

Example 75 with After

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

the class ReadOnlyVersionManagerTest method after.

@Override
@After
public void after() throws Exception {
    try {
        root.refresh();
        Tree a = root.getTree("/a");
        if (a.exists()) {
            a.remove();
            root.commit();
        }
    } finally {
        super.after();
    }
}
Also used : Tree(org.apache.jackrabbit.oak.api.Tree) 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