Search in sources :

Example 26 with After

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

the class TestAggregatedLogFormat method cleanupTestDir.

@Before
@After
public void cleanupTestDir() throws Exception {
    Path workDirPath = new Path(testWorkDir.getAbsolutePath());
    LOG.info("Cleaning test directory [" + workDirPath + "]");
    fs.delete(workDirPath, true);
}
Also used : Path(org.apache.hadoop.fs.Path) Before(org.junit.Before) After(org.junit.After)

Example 27 with After

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

the class TestZKClient method tearDown.

@After
public void tearDown() throws IOException, InterruptedException {
    if (zks != null) {
        ZKDatabase zkDb = zks.getZKDatabase();
        factory.shutdown();
        try {
            zkDb.close();
        } catch (IOException ie) {
        }
        final int PORT = Integer.parseInt(hostPort.split(":")[1]);
        Assert.assertTrue("waiting for server down", waitForServerDown("127.0.0.1:" + PORT, CONNECTION_TIMEOUT));
    }
}
Also used : IOException(java.io.IOException) ZKDatabase(org.apache.zookeeper.server.ZKDatabase) After(org.junit.After)

Example 28 with After

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

the class TestAddResource method tearDown.

@After
public void tearDown() {
    // delete sample jars
    for (int i = 1; i <= 5; i++) {
        String dataFile = TEST_JAR_DIR + "testjar" + i + ".jar";
        File f = new File(dataFile);
        if (!f.delete()) {
            throw new RuntimeException("Could not delete the data file");
        }
    }
}
Also used : File(java.io.File) After(org.junit.After)

Example 29 with After

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

the class TestNNBench method tearDown.

@After
public void tearDown() throws Exception {
    getFileSystem().delete(new Path(BASE_DIR), true);
    getFileSystem().delete(new Path(NNBench.DEFAULT_RES_FILE_NAME), true);
    super.tearDown();
}
Also used : Path(org.apache.hadoop.fs.Path) After(org.junit.After)

Example 30 with After

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

the class TestRollingLevelDBTimelineStore method tearDown.

@After
public void tearDown() throws Exception {
    store.stop();
    fsContext.delete(new Path(fsPath.getAbsolutePath()), true);
}
Also used : Path(org.apache.hadoop.fs.Path) 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