Search in sources :

Example 66 with After

use of org.junit.After in project heron by twitter.

the class TMasterSinkTest method after.

@After
@SuppressWarnings("unchecked")
public void after() throws Exception {
    // Remove the Singleton by Reflection
    Field field = SingletonRegistry.INSTANCE.getClass().getDeclaredField("singletonObjects");
    field.setAccessible(true);
    Map<String, Object> singletonObjects = (Map<String, Object>) field.get(SingletonRegistry.INSTANCE);
    singletonObjects.clear();
}
Also used : Field(java.lang.reflect.Field) Map(java.util.Map) HashMap(java.util.HashMap) After(org.junit.After)

Example 67 with After

use of org.junit.After in project heron by twitter.

the class FileSinkTest method after.

@After
public void after() {
    fileSink.close();
    for (File file : tmpDir.listFiles()) {
        file.delete();
    }
    tmpDir.delete();
}
Also used : File(java.io.File) After(org.junit.After)

Example 68 with After

use of org.junit.After in project gerrit by GerritCodeReview.

the class HookTestCase method tearDown.

@Override
@After
public void tearDown() throws Exception {
    super.tearDown();
    for (File p : cleanup) {
        if (!p.delete()) {
            p.deleteOnExit();
        }
    }
    cleanup.clear();
}
Also used : File(java.io.File) After(org.junit.After)

Example 69 with After

use of org.junit.After in project aries by apache.

the class TransactionLogTest method destroy.

@After
public void destroy() throws Exception {
    txControl.close();
    checkLogClosed(txControl);
    try (Connection conn = dataSource.getConnection()) {
        conn.createStatement().execute("shutdown immediately");
    } catch (SQLException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    delete(new File("target/recovery-test"));
}
Also used : SQLException(java.sql.SQLException) Connection(java.sql.Connection) XAConnection(javax.sql.XAConnection) File(java.io.File) After(org.junit.After)

Example 70 with After

use of org.junit.After in project phoenix by apache.

the class QueryTimeoutIT method assertNoUnfreedMemory.

@After
public void assertNoUnfreedMemory() throws SQLException {
    Connection conn = DriverManager.getConnection(getUrl());
    try {
        long unfreedBytes = conn.unwrap(PhoenixConnection.class).getQueryServices().clearCache();
        assertEquals(0, unfreedBytes);
    } finally {
        conn.close();
    }
}
Also used : Connection(java.sql.Connection) PhoenixConnection(org.apache.phoenix.jdbc.PhoenixConnection) 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