This is an automated email from the ASF dual-hosted git repository.

slfan1989 pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/trunk by this push:
     new f34c4be413d HADOOP-19433. [JDK17] Upgrade JUnit from 4 to 5 in 
hadoop-extras. (#7586)
f34c4be413d is described below

commit f34c4be413dc74e96c86a94fd1f575134bb6d3a4
Author: slfan1989 <55643692+slfan1...@users.noreply.github.com>
AuthorDate: Thu May 15 13:21:46 2025 +0800

    HADOOP-19433. [JDK17] Upgrade JUnit from 4 to 5 in hadoop-extras. (#7586)
    
    Co-authored-by: Chris Nauroth <cnaur...@apache.org>
    Reviewed-by: Chris Nauroth <cnaur...@apache.org>
    Signed-off-by: Shilun Fan <slfan1...@apache.org>
---
 .../apache/hadoop/mapred/tools/TestGetGroups.java  | 55 ----------------------
 .../java/org/apache/hadoop/tools/TestDistCh.java   | 21 +++++----
 2 files changed, 11 insertions(+), 65 deletions(-)

diff --git 
a/hadoop-tools/hadoop-extras/src/test/java/org/apache/hadoop/mapred/tools/TestGetGroups.java
 
b/hadoop-tools/hadoop-extras/src/test/java/org/apache/hadoop/mapred/tools/TestGetGroups.java
deleted file mode 100644
index ed7b8aa8632..00000000000
--- 
a/hadoop-tools/hadoop-extras/src/test/java/org/apache/hadoop/mapred/tools/TestGetGroups.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.hadoop.mapred.tools;
-
-import java.io.IOException;
-import java.io.PrintStream;
-
-import org.apache.hadoop.mapred.MiniMRCluster;
-import org.apache.hadoop.mapred.tools.GetGroups;
-import org.apache.hadoop.tools.GetGroupsTestBase;
-import org.apache.hadoop.util.Tool;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Ignore;
-
-/**
- * Tests for the MR implementation of {@link GetGroups}
- */
-@Ignore
-public class TestGetGroups extends GetGroupsTestBase {
-  
-  private MiniMRCluster cluster;
-
-  @Before
-  public void setUpJobTracker() throws IOException, InterruptedException {
-    cluster = new MiniMRCluster(0, "file:///", 1);
-    conf = cluster.createJobConf();
-  }
-  
-  @After
-  public void tearDownJobTracker() throws IOException {
-    cluster.shutdown();
-  }
-
-  @Override
-  protected Tool getTool(PrintStream o) {
-    return new GetGroups(conf, o);
-  }
-
-}
diff --git 
a/hadoop-tools/hadoop-extras/src/test/java/org/apache/hadoop/tools/TestDistCh.java
 
b/hadoop-tools/hadoop-extras/src/test/java/org/apache/hadoop/tools/TestDistCh.java
index 3e52b3cb6d1..7efaaf1a25d 100644
--- 
a/hadoop-tools/hadoop-extras/src/test/java/org/apache/hadoop/tools/TestDistCh.java
+++ 
b/hadoop-tools/hadoop-extras/src/test/java/org/apache/hadoop/tools/TestDistCh.java
@@ -38,11 +38,12 @@
 import org.apache.hadoop.mapred.MiniMRClientClusterFactory;
 import org.apache.hadoop.test.GenericTestUtils;
 import 
org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacitySchedulerConfiguration;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.slf4j.event.Level;
 
 import static org.slf4j.LoggerFactory.getLogger;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 public class TestDistCh {
   {
@@ -77,20 +78,20 @@ static class FileTree {
 
     Path createSmallFile(Path dir) throws IOException {
       final Path f = new Path(dir, "f" + ++fcount);
-      Assert.assertTrue(!fs.exists(f));
+      assertTrue(!fs.exists(f));
       final DataOutputStream out = fs.create(f);
       try {
         out.writeBytes("createSmallFile: f=" + f);
       } finally {
         out.close();
       }
-      Assert.assertTrue(fs.exists(f));
+      assertTrue(fs.exists(f));
       return f;
     }
 
     Path mkdir(Path dir) throws IOException {
-      Assert.assertTrue(fs.mkdirs(dir));
-      Assert.assertTrue(fs.getFileStatus(dir).isDirectory());
+      assertTrue(fs.mkdirs(dir));
+      assertTrue(fs.getFileStatus(dir).isDirectory());
       return dir;
     }
     
@@ -193,13 +194,13 @@ public void testDistCh() throws Exception {
   }
 
   static void checkFileStatus(ChPermissionStatus expected, FileStatus actual) {
-    Assert.assertEquals(expected.getUserName(), actual.getOwner());
-    Assert.assertEquals(expected.getGroupName(), actual.getGroup());
+    assertEquals(expected.getUserName(), actual.getOwner());
+    assertEquals(expected.getGroupName(), actual.getGroup());
     FsPermission perm = expected.getPermission();
     if (actual.isFile() && expected.defaultPerm) {
       perm = perm.applyUMask(UMASK);
     }
-    Assert.assertEquals(perm, actual.getPermission());
+    assertEquals(perm, actual.getPermission());
   }
 
   private static String runLsr(final FsShell shell, String root, int 
returnvalue
@@ -213,7 +214,7 @@ private static String runLsr(final FsShell shell, String 
root, int returnvalue
     System.setErr(out);
     final String results;
     try {
-      Assert.assertEquals(returnvalue, shell.run(new String[]{"-lsr", root}));
+      assertEquals(returnvalue, shell.run(new String[]{"-lsr", root}));
       results = bytes.toString();
     } finally {
       IOUtils.closeStream(out);


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

Reply via email to