You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by aa...@apache.org on 2018/05/06 16:19:12 UTC

hadoop git commit: MAPREDUCE-7093. Use assertEquals instead of assertTrue(a == b) in TestMapReduceJobControlWithMocks

Repository: hadoop
Updated Branches:
  refs/heads/trunk a732acd87 -> e9159db62


MAPREDUCE-7093. Use assertEquals instead of assertTrue(a == b) in TestMapReduceJobControlWithMocks

Signed-off-by: Akira Ajisaka <aa...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/e9159db6
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/e9159db6
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/e9159db6

Branch: refs/heads/trunk
Commit: e9159db62367920c34616179aa4ced46d1ed22e1
Parents: a732acd
Author: Abhishek Modi <ab...@gmail.com>
Authored: Mon May 7 01:15:14 2018 +0900
Committer: Akira Ajisaka <aa...@apache.org>
Committed: Mon May 7 01:15:14 2018 +0900

----------------------------------------------------------------------
 .../TestMapReduceJobControlWithMocks.java        | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/e9159db6/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/jobcontrol/TestMapReduceJobControlWithMocks.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/jobcontrol/TestMapReduceJobControlWithMocks.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/jobcontrol/TestMapReduceJobControlWithMocks.java
index e89f090..a0d5125 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/jobcontrol/TestMapReduceJobControlWithMocks.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/lib/jobcontrol/TestMapReduceJobControlWithMocks.java
@@ -19,7 +19,6 @@
 package org.apache.hadoop.mapreduce.lib.jobcontrol;
 
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
@@ -52,10 +51,10 @@ public class TestMapReduceJobControlWithMocks {
     assertEquals("Success list", 4, jobControl.getSuccessfulJobList().size());
     assertEquals("Failed list", 0, jobControl.getFailedJobList().size());
     
-    assertTrue(job1.getJobState() == ControlledJob.State.SUCCESS);
-    assertTrue(job2.getJobState() == ControlledJob.State.SUCCESS);
-    assertTrue(job3.getJobState() == ControlledJob.State.SUCCESS);
-    assertTrue(job4.getJobState() == ControlledJob.State.SUCCESS);
+    assertEquals(ControlledJob.State.SUCCESS, job1.getJobState());
+    assertEquals(ControlledJob.State.SUCCESS, job2.getJobState());
+    assertEquals(ControlledJob.State.SUCCESS, job3.getJobState());
+    assertEquals(ControlledJob.State.SUCCESS, job4.getJobState());
     
     jobControl.stop();
   }
@@ -74,10 +73,10 @@ public class TestMapReduceJobControlWithMocks {
     assertEquals("Success list", 1, jobControl.getSuccessfulJobList().size());
     assertEquals("Failed list", 3, jobControl.getFailedJobList().size());
 
-    assertTrue(job1.getJobState() == ControlledJob.State.FAILED);
-    assertTrue(job2.getJobState() == ControlledJob.State.SUCCESS);
-    assertTrue(job3.getJobState() == ControlledJob.State.DEPENDENT_FAILED);
-    assertTrue(job4.getJobState() == ControlledJob.State.DEPENDENT_FAILED);
+    assertEquals(ControlledJob.State.FAILED, job1.getJobState());
+    assertEquals(ControlledJob.State.SUCCESS, job2.getJobState());
+    assertEquals(ControlledJob.State.DEPENDENT_FAILED, job3.getJobState());
+    assertEquals(ControlledJob.State.DEPENDENT_FAILED, job4.getJobState());
     
     jobControl.stop();
   }
@@ -99,7 +98,7 @@ public class TestMapReduceJobControlWithMocks {
       assertEquals("Success list", 0, jobControl.getSuccessfulJobList().size());
       assertEquals("Failed list", 1, jobControl.getFailedJobList().size());
 
-      assertTrue(job1.getJobState() == ControlledJob.State.FAILED);
+      assertEquals(ControlledJob.State.FAILED, job1.getJobState());
     } finally {
       jobControl.stop();
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org