From ae7abad3d9f9a82e4deadd9dbad72b0db7310039 Mon Sep 17 00:00:00 2001 From: Mingliang Liu Date: Sun, 27 Aug 2017 15:19:55 -0700 Subject: [PATCH] MAPREDUCE-6945. TestMapFileOutputFormat missing @after annotation. Contributed by Ajay Kumar --- .../org/apache/hadoop/mapred/TestMapFileOutputFormat.java | 6 ++++-- .../mapreduce/lib/output/TestMapFileOutputFormat.java | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/test/java/org/apache/hadoop/mapred/TestMapFileOutputFormat.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/test/java/org/apache/hadoop/mapred/TestMapFileOutputFormat.java index 7e315ae7a31..b82cd70d3f1 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/test/java/org/apache/hadoop/mapred/TestMapFileOutputFormat.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/test/java/org/apache/hadoop/mapred/TestMapFileOutputFormat.java @@ -24,6 +24,7 @@ import org.apache.hadoop.io.Text; import org.apache.hadoop.io.Writable; import org.apache.hadoop.io.WritableComparable; import org.apache.hadoop.io.MapFile.Reader; +import org.junit.After; import org.junit.Test; import org.mockito.Mockito; @@ -40,9 +41,10 @@ public class TestMapFileOutputFormat { assertTrue(!MyPartitioner.isGetPartitionCalled()); } - protected void tearDown() throws Exception { + @After + public void tearDown() throws Exception { MyPartitioner.setGetPartitionCalled(false); - }; + } private static class MyPartitioner implements Partitioner { diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/test/java/org/apache/hadoop/mapreduce/lib/output/TestMapFileOutputFormat.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/test/java/org/apache/hadoop/mapreduce/lib/output/TestMapFileOutputFormat.java index 82758f1557b..47220be2021 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/test/java/org/apache/hadoop/mapreduce/lib/output/TestMapFileOutputFormat.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/test/java/org/apache/hadoop/mapreduce/lib/output/TestMapFileOutputFormat.java @@ -25,6 +25,7 @@ import org.apache.hadoop.io.Writable; import org.apache.hadoop.io.WritableComparable; import org.apache.hadoop.io.MapFile.Reader; import org.apache.hadoop.mapreduce.Partitioner; +import org.junit.After; import org.junit.Test; import org.mockito.Mockito; @@ -41,6 +42,7 @@ public class TestMapFileOutputFormat { assertTrue(!MyPartitioner.isGetPartitionCalled()); } + @After public void tearDown() throws Exception { MyPartitioner.setGetPartitionCalled(false); }