From f5148ca542108d1e308a89922d765119bfa73ab4 Mon Sep 17 00:00:00 2001 From: Dongjoon Hyun Date: Tue, 28 Sep 2021 09:50:01 -0700 Subject: [PATCH] MAPREDUCE-7363. Rename JobClientUnitTest to TestJobClients (#3487) --- ...lientUnitTest.java => TestJobClients.java} | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) rename hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/{JobClientUnitTest.java => TestJobClients.java} (98%) diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/JobClientUnitTest.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestJobClients.java similarity index 98% rename from hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/JobClientUnitTest.java rename to hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestJobClients.java index c7ae57d581..770ddd2c79 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/JobClientUnitTest.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestJobClients.java @@ -44,8 +44,8 @@ import org.junit.Test; @SuppressWarnings("deprecation") -public class JobClientUnitTest { - +public class TestJobClients { + public class TestJobClient extends JobClient { TestJobClient(JobConf jobConf) throws IOException { @@ -99,57 +99,57 @@ public void testMapTaskReportsWithNullJob() throws Exception { Cluster mockCluster = mock(Cluster.class); client.setCluster(mockCluster); JobID id = new JobID("test",0); - + when(mockCluster.getJob(id)).thenReturn(null); - + TaskReport[] result = client.getMapTaskReports(id); assertEquals(0, result.length); - + verify(mockCluster).getJob(id); } - + @Test public void testReduceTaskReportsWithNullJob() throws Exception { TestJobClient client = new TestJobClient(new JobConf()); Cluster mockCluster = mock(Cluster.class); client.setCluster(mockCluster); JobID id = new JobID("test",0); - + when(mockCluster.getJob(id)).thenReturn(null); - + TaskReport[] result = client.getReduceTaskReports(id); assertEquals(0, result.length); - + verify(mockCluster).getJob(id); } - + @Test public void testSetupTaskReportsWithNullJob() throws Exception { TestJobClient client = new TestJobClient(new JobConf()); Cluster mockCluster = mock(Cluster.class); client.setCluster(mockCluster); JobID id = new JobID("test",0); - + when(mockCluster.getJob(id)).thenReturn(null); - + TaskReport[] result = client.getSetupTaskReports(id); assertEquals(0, result.length); - + verify(mockCluster).getJob(id); } - + @Test public void testCleanupTaskReportsWithNullJob() throws Exception { TestJobClient client = new TestJobClient(new JobConf()); Cluster mockCluster = mock(Cluster.class); client.setCluster(mockCluster); JobID id = new JobID("test",0); - + when(mockCluster.getJob(id)).thenReturn(null); - + TaskReport[] result = client.getCleanupTaskReports(id); assertEquals(0, result.length); - + verify(mockCluster).getJob(id); } @@ -184,7 +184,7 @@ public void testShowJob() throws Exception { when(mockCluster.getJob(jobID)).thenReturn(mockJob); client.setCluster(mockCluster); - + ByteArrayOutputStream out = new ByteArrayOutputStream(); client.displayJobList(new JobStatus[] {mockJobStatus}, new PrintWriter(out)); String commandLineOutput = out.toString();