Skip to content

Commit 1e0e1f9

Browse files
committed
HADOOP-19415. [JDK17] Upgrade JUnit from 4 to 5 in hadoop-common Part8.
1 parent ae7a58d commit 1e0e1f9

File tree

5 files changed

+425
-332
lines changed

5 files changed

+425
-332
lines changed

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

Lines changed: 14 additions & 11 deletions
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;
@@ -26,7 +30,6 @@
2630
import org.apache.hadoop.fs.Options.CreateOpts.BlockSize;
2731
import org.apache.hadoop.io.IOUtils;
2832
import org.apache.hadoop.test.GenericTestUtils;
29-
import org.junit.Assert;
3033

3134
/**
3235
* Helper class for unit tests.
@@ -220,28 +223,28 @@ public enum fileType {isDir, isFile, isSymlink};
220223
public static void checkFileStatus(FileContext aFc, String path,
221224
fileType expectedType) throws IOException {
222225
FileStatus s = aFc.getFileStatus(new Path(path));
223-
Assert.assertNotNull(s);
226+
assertNotNull(s);
224227
if (expectedType == fileType.isDir) {
225-
Assert.assertTrue(s.isDirectory());
228+
assertTrue(s.isDirectory());
226229
} else if (expectedType == fileType.isFile) {
227-
Assert.assertTrue(s.isFile());
230+
assertTrue(s.isFile());
228231
} else if (expectedType == fileType.isSymlink) {
229-
Assert.assertTrue(s.isSymlink());
232+
assertTrue(s.isSymlink());
230233
}
231-
Assert.assertEquals(aFc.makeQualified(new Path(path)), s.getPath());
234+
assertEquals(aFc.makeQualified(new Path(path)), s.getPath());
232235
}
233236

234237
public static void checkFileLinkStatus(FileContext aFc, String path,
235238
fileType expectedType) throws IOException {
236239
FileStatus s = aFc.getFileLinkStatus(new Path(path));
237-
Assert.assertNotNull(s);
240+
assertNotNull(s);
238241
if (expectedType == fileType.isDir) {
239-
Assert.assertTrue(s.isDirectory());
242+
assertTrue(s.isDirectory());
240243
} else if (expectedType == fileType.isFile) {
241-
Assert.assertTrue(s.isFile());
244+
assertTrue(s.isFile());
242245
} else if (expectedType == fileType.isSymlink) {
243-
Assert.assertTrue(s.isSymlink());
246+
assertTrue(s.isSymlink());
244247
}
245-
Assert.assertEquals(aFc.makeQualified(new Path(path)), s.getPath());
248+
assertEquals(aFc.makeQualified(new Path(path)), s.getPath());
246249
}
247250
}

0 commit comments

Comments
 (0)