Search in sources :

Example 36 with After

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

the class TestJMXGet method tearDown.

/**
   * clean up
   */
@After
public void tearDown() throws Exception {
    if (cluster != null) {
        if (cluster.isClusterUp()) {
            cluster.shutdown();
        }
        File data_dir = new File(cluster.getDataDirectory());
        if (data_dir.exists() && !FileUtil.fullyDelete(data_dir)) {
            throw new IOException("Could not delete hdfs directory in tearDown '" + data_dir + "'");
        }
        cluster = null;
    }
}
Also used : IOException(java.io.IOException) File(java.io.File) After(org.junit.After)

Example 37 with After

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

the class TestRollingFileSystemSinkWithSecureHdfs method stopCluster.

/**
   * Stop the mini-DFS cluster.
   */
@After
public void stopCluster() {
    if (cluster != null) {
        cluster.shutdown();
    }
    // Restore non-secure conf
    UserGroupInformation.setConfiguration(new Configuration());
    RollingFileSystemSink.suppliedConf = null;
    RollingFileSystemSink.suppliedFilesystem = null;
}
Also used : Configuration(org.apache.hadoop.conf.Configuration) HdfsConfiguration(org.apache.hadoop.hdfs.HdfsConfiguration) After(org.junit.After)

Example 38 with After

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

the class TestRefreshUserMappings method tearDown.

@After
public void tearDown() throws Exception {
    if (cluster != null) {
        cluster.shutdown();
        cluster = null;
    }
    if (tempResource != null) {
        File f = new File(tempResource);
        f.delete();
        tempResource = null;
    }
}
Also used : File(java.io.File) After(org.junit.After)

Example 39 with After

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

the class TestViewFsTrash method tearDown.

@After
public void tearDown() throws Exception {
    ViewFileSystemTestSetup.tearDown(fileSystemTestHelper, fsTarget);
    fsTarget.delete(new Path(fsTarget.getHomeDirectory(), ".Trash/Current"), true);
}
Also used : Path(org.apache.hadoop.fs.Path) After(org.junit.After)

Example 40 with After

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

the class TestDataNodeReconfiguration method tearDown.

@After
public void tearDown() throws Exception {
    if (cluster != null) {
        cluster.shutdown();
        cluster = null;
    }
    File dir = new File(DATA_DIR);
    if (dir.exists())
        Assert.assertTrue("Cannot delete data-node dirs", FileUtil.fullyDelete(dir));
}
Also used : File(java.io.File) 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