Search in sources :

Example 31 with After

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

the class TaskTestBase method shutdownMemoryManager.

@After
public void shutdownMemoryManager() throws Exception {
    if (this.memorySize > 0) {
        MemoryManager memMan = getMemoryManager();
        if (memMan != null) {
            Assert.assertTrue("Memory Manager managed memory was not completely freed.", memMan.verifyEmpty());
            memMan.shutdown();
        }
    }
}
Also used : MemoryManager(org.apache.flink.runtime.memory.MemoryManager) After(org.junit.After)

Example 32 with After

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

the class TestDistributedShell method tearDown.

@After
public void tearDown() throws IOException {
    if (yarnCluster != null) {
        try {
            yarnCluster.stop();
        } finally {
            yarnCluster = null;
        }
    }
    if (hdfsCluster != null) {
        try {
            hdfsCluster.shutdown();
        } finally {
            hdfsCluster = null;
        }
    }
    FileContext fsContext = FileContext.getLocalFSFileContext();
    fsContext.delete(new Path(conf.get(YarnConfiguration.TIMELINE_SERVICE_LEVELDB_PATH)), true);
}
Also used : Path(org.apache.hadoop.fs.Path) FileContext(org.apache.hadoop.fs.FileContext) After(org.junit.After)

Example 33 with After

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

the class TestNodeStatusUpdater method deleteBaseDir.

@After
public void deleteBaseDir() throws IOException {
    FileContext lfs = FileContext.getLocalFSFileContext();
    lfs.delete(new Path(basedir.getPath()), true);
}
Also used : Path(org.apache.hadoop.fs.Path) FileContext(org.apache.hadoop.fs.FileContext) After(org.junit.After)

Example 34 with After

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

the class TestResourceTrackerService method tearDown.

@After
public void tearDown() {
    if (hostFile != null && hostFile.exists()) {
        hostFile.delete();
    }
    ClusterMetrics.destroy();
    if (rm != null) {
        rm.stop();
    }
    MetricsSystem ms = DefaultMetricsSystem.instance();
    if (ms.getSource("ClusterMetrics") != null) {
        DefaultMetricsSystem.shutdown();
    }
}
Also used : DefaultMetricsSystem(org.apache.hadoop.metrics2.lib.DefaultMetricsSystem) MetricsSystem(org.apache.hadoop.metrics2.MetricsSystem) After(org.junit.After)

Example 35 with After

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

the class TestNameNodeMetrics method tearDown.

@After
public void tearDown() throws Exception {
    MetricsSource source = DefaultMetricsSystem.instance().getSource("UgiMetrics");
    if (source != null) {
        // Run only once since the UGI metrics is cleaned up during teardown
        MetricsRecordBuilder rb = getMetrics(source);
        assertQuantileGauges("GetGroups1s", rb);
    }
    if (cluster != null) {
        cluster.shutdown();
        cluster = null;
    }
}
Also used : MetricsSource(org.apache.hadoop.metrics2.MetricsSource) MetricsRecordBuilder(org.apache.hadoop.metrics2.MetricsRecordBuilder) 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