Search in sources :

Example 1 with After

use of org.junit.After in project deeplearning4j by deeplearning4j.

the class SentenceIteratorTest method after.

@After
public void after() throws Exception {
    File test = new File("dir");
    test.mkdir();
    FileUtils.deleteQuietly(test);
    FileUtils.deleteQuietly(new File("multidir"));
}
Also used : File(java.io.File) After(org.junit.After)

Example 2 with After

use of org.junit.After in project elasticsearch by elastic.

the class CloseIndexDisableCloseAllIT method afterTest.

@After
public void afterTest() {
    Settings settings = Settings.builder().put(TransportCloseIndexAction.CLUSTER_INDICES_CLOSE_ENABLE_SETTING.getKey(), (String) null).build();
    assertAcked(client().admin().cluster().prepareUpdateSettings().setTransientSettings(settings));
}
Also used : Settings(org.elasticsearch.common.settings.Settings) After(org.junit.After)

Example 3 with After

use of org.junit.After in project elasticsearch by elastic.

the class TribeIT method wipeRemoteClusters.

@After
public void wipeRemoteClusters() {
    doWithAllClusters(c -> {
        final String clusterName = c.getClusterName();
        try {
            c.client().admin().indices().prepareDelete(MetaData.ALL).get();
            c.afterTest();
        } catch (IOException e) {
            throw new RuntimeException("Failed to clean up remote cluster [" + clusterName + "]", e);
        }
    });
}
Also used : Matchers.containsString(org.hamcrest.Matchers.containsString) IOException(java.io.IOException) After(org.junit.After)

Example 4 with After

use of org.junit.After in project jetty.project by eclipse.

the class TestNamingEntries method after.

/**
     * after each test we should scrape out any lingering bindings to prevent cross test pollution
     * as observed when running java 7
     *
     * @throws Exception on test failure
     */
@After
public void after() throws Exception {
    InitialContext icontext = new InitialContext();
    NamingEnumeration<Binding> bindings = icontext.listBindings("");
    List<String> names = new ArrayList<String>();
    while (bindings.hasMore()) {
        Binding bd = (Binding) bindings.next();
        names.add(bd.getName());
    }
    for (String name : names) {
        icontext.unbind(name);
    }
}
Also used : Binding(javax.naming.Binding) ArrayList(java.util.ArrayList) InitialContext(javax.naming.InitialContext) After(org.junit.After)

Example 5 with After

use of org.junit.After in project jetty.project by eclipse.

the class PlusDescriptorProcessorTest method tearDown.

@After
public void tearDown() throws Exception {
    ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
    Thread.currentThread().setContextClassLoader(context.getClassLoader());
    Context ic = new InitialContext();
    Context compCtx = (Context) ic.lookup("java:comp");
    compCtx.destroySubcontext("env");
    Thread.currentThread().setContextClassLoader(oldLoader);
}
Also used : InitialContext(javax.naming.InitialContext) WebAppContext(org.eclipse.jetty.webapp.WebAppContext) Context(javax.naming.Context) WebAppClassLoader(org.eclipse.jetty.webapp.WebAppClassLoader) InitialContext(javax.naming.InitialContext) After(org.junit.After)

Aggregations

After (org.junit.After)1404 File (java.io.File)284 Before (org.junit.Before)137 Test (org.junit.Test)127 List (java.util.List)87 IOException (java.io.IOException)82 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