You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "ayushtkn (via GitHub)" <gi...@apache.org> on 2023/05/12 22:45:41 UTC

[GitHub] [hadoop] ayushtkn commented on a diff in pull request #5028: MAPREDUCE-7419. Upgrade Junit 4 to 5 in hadoop-mapreduce-client-common

ayushtkn commented on code in PR #5028:
URL: https://github.com/apache/hadoop/pull/5028#discussion_r1192841288


##########
hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/test/java/org/apache/hadoop/mapred/TestJobClient.java:
##########
@@ -22,77 +22,81 @@
 import java.util.Collection;
 
 import org.apache.hadoop.conf.Configuration;
+
+import static org.junit.jupiter.api.Assertions.*;

Review Comment:
   expand, we don't use .* in general



##########
hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/test/java/org/apache/hadoop/mapred/TestJobClientGetJob.java:
##########
@@ -18,15 +18,15 @@
 
 package org.apache.hadoop.mapred;
 
-import static org.junit.Assert.assertNotNull;
-
 import java.io.IOException;
 
 import org.apache.hadoop.conf.Configuration;
+
+import static org.junit.jupiter.api.Assertions.assertNotNull;

Review Comment:
   import order is wrong



##########
hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/test/java/org/apache/hadoop/mapred/TestJobClient.java:
##########
@@ -22,77 +22,81 @@
 import java.util.Collection;
 
 import org.apache.hadoop.conf.Configuration;
+
+import static org.junit.jupiter.api.Assertions.*;
+
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.FileUtil;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.mapred.ClusterStatus.BlackListInfo;
 import org.apache.hadoop.mapreduce.MRConfig;
 import org.apache.hadoop.mapreduce.server.jobtracker.JTConfig;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
 
 public class TestJobClient {
 
   final static String TEST_DIR = new File("target",
     TestJobClient.class.getSimpleName()).getAbsolutePath();
 
-  @After
+  @AfterEach
   public void tearDown() {
     FileUtil.fullyDelete(new File(TEST_DIR));
   }
 
   @Test
-  public void testGetClusterStatusWithLocalJobRunner() throws Exception {
+  void testGetClusterStatusWithLocalJobRunner() throws Exception {
     Configuration conf = new Configuration();
     conf.set(JTConfig.JT_IPC_ADDRESS, MRConfig.LOCAL_FRAMEWORK_NAME);
     conf.set(MRConfig.FRAMEWORK_NAME, MRConfig.LOCAL_FRAMEWORK_NAME);
     JobClient client = new JobClient(conf);
     ClusterStatus clusterStatus = client.getClusterStatus(true);
     Collection<String> activeTrackerNames = clusterStatus
         .getActiveTrackerNames();
-    Assert.assertEquals(0, activeTrackerNames.size());
+    assertEquals(0, activeTrackerNames.size());
     int blacklistedTrackers = clusterStatus.getBlacklistedTrackers();
-    Assert.assertEquals(0, blacklistedTrackers);
+    assertEquals(0, blacklistedTrackers);
     Collection<BlackListInfo> blackListedTrackersInfo = clusterStatus
         .getBlackListedTrackersInfo();
-    Assert.assertEquals(0, blackListedTrackersInfo.size());
+    assertEquals(0, blackListedTrackersInfo.size());
   }
 
-  @Test(timeout = 10000)
-  public void testIsJobDirValid() throws IOException {

Review Comment:
   is removing public mandatory? if things can work with this and others staying public, Would prefer it stay as public only



##########
hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/test/java/org/apache/hadoop/mapreduce/v2/util/TestMRApps.java:
##########
@@ -18,12 +18,7 @@
 
 package org.apache.hadoop.mapreduce.v2.util;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.*;

Review Comment:
   expand



##########
hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/test/java/org/apache/hadoop/mapreduce/v2/api/records/TestIds.java:
##########
@@ -19,28 +19,26 @@
 
 package org.apache.hadoop.mapreduce.v2.api.records;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.*;

Review Comment:
   expand



##########
hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/test/java/org/apache/hadoop/mapred/TestMRWithDistributedCache.java:
##########
@@ -27,9 +27,10 @@
 import java.util.jar.JarOutputStream;
 import java.util.zip.ZipEntry;
 
-import org.junit.Assert;
-import org.junit.Test;
-import static org.junit.Assert.*;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
+
+import static org.junit.jupiter.api.Assertions.*;

Review Comment:
   expand



##########
hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/test/java/org/apache/hadoop/mapreduce/TestTypeConverter.java:
##########
@@ -20,6 +20,7 @@
 import org.apache.hadoop.util.StringUtils;
 
 import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.jupiter.api.Assertions.*;

Review Comment:
   expand the import



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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