Skip to content

Commit 18ab889

Browse files
committed
HADOOP-19415. [JDK17] Upgrade JUnit from 4 to 5 in hadoop-common Part8.
1 parent 44de4dd commit 18ab889

File tree

5 files changed

+182
-108
lines changed

5 files changed

+182
-108
lines changed

hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/FileContextTestWrapper.java

+14-11
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
*/
1818
package org.apache.hadoop.fs;
1919

20+
import static org.junit.jupiter.api.Assertions.assertEquals;
21+
import static org.junit.jupiter.api.Assertions.assertNotNull;
22+
import static org.junit.jupiter.api.Assertions.assertTrue;
23+
2024
import java.io.DataInputStream;
2125
import java.io.IOException;
2226
import java.io.FileNotFoundException;
@@ -28,7 +32,6 @@
2832
import org.apache.hadoop.fs.permission.FsPermission;
2933
import org.apache.hadoop.io.IOUtils;
3034
import org.apache.hadoop.security.AccessControlException;
31-
import org.junit.Assert;
3235

3336
/**
3437
* Helper class for unit tests.
@@ -169,29 +172,29 @@ public FileStatus containsPath(String path, FileStatus[] dirList)
169172
public void checkFileStatus(String path, fileType expectedType)
170173
throws IOException {
171174
FileStatus s = fc.getFileStatus(new Path(path));
172-
Assert.assertNotNull(s);
175+
assertNotNull(s);
173176
if (expectedType == fileType.isDir) {
174-
Assert.assertTrue(s.isDirectory());
177+
assertTrue(s.isDirectory());
175178
} else if (expectedType == fileType.isFile) {
176-
Assert.assertTrue(s.isFile());
179+
assertTrue(s.isFile());
177180
} else if (expectedType == fileType.isSymlink) {
178-
Assert.assertTrue(s.isSymlink());
181+
assertTrue(s.isSymlink());
179182
}
180-
Assert.assertEquals(fc.makeQualified(new Path(path)), s.getPath());
183+
assertEquals(fc.makeQualified(new Path(path)), s.getPath());
181184
}
182185

183186
public void checkFileLinkStatus(String path, fileType expectedType)
184187
throws IOException {
185188
FileStatus s = fc.getFileLinkStatus(new Path(path));
186-
Assert.assertNotNull(s);
189+
assertNotNull(s);
187190
if (expectedType == fileType.isDir) {
188-
Assert.assertTrue(s.isDirectory());
191+
assertTrue(s.isDirectory());
189192
} else if (expectedType == fileType.isFile) {
190-
Assert.assertTrue(s.isFile());
193+
assertTrue(s.isFile());
191194
} else if (expectedType == fileType.isSymlink) {
192-
Assert.assertTrue(s.isSymlink());
195+
assertTrue(s.isSymlink());
193196
}
194-
Assert.assertEquals(fc.makeQualified(new Path(path)), s.getPath());
197+
assertEquals(fc.makeQualified(new Path(path)), s.getPath());
195198
}
196199

197200
//

0 commit comments

Comments
 (0)