|
17 | 17 | */ |
18 | 18 | package org.apache.hadoop.fs; |
19 | 19 |
|
| 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 | + |
20 | 24 | import java.io.DataInputStream; |
21 | 25 | import java.io.IOException; |
22 | 26 | import java.io.FileNotFoundException; |
|
26 | 30 | import org.apache.hadoop.fs.Options.CreateOpts.BlockSize; |
27 | 31 | import org.apache.hadoop.io.IOUtils; |
28 | 32 | import org.apache.hadoop.test.GenericTestUtils; |
29 | | -import org.junit.Assert; |
30 | 33 |
|
31 | 34 | /** |
32 | 35 | * Helper class for unit tests. |
@@ -220,28 +223,28 @@ public enum fileType {isDir, isFile, isSymlink}; |
220 | 223 | public static void checkFileStatus(FileContext aFc, String path, |
221 | 224 | fileType expectedType) throws IOException { |
222 | 225 | FileStatus s = aFc.getFileStatus(new Path(path)); |
223 | | - Assert.assertNotNull(s); |
| 226 | + assertNotNull(s); |
224 | 227 | if (expectedType == fileType.isDir) { |
225 | | - Assert.assertTrue(s.isDirectory()); |
| 228 | + assertTrue(s.isDirectory()); |
226 | 229 | } else if (expectedType == fileType.isFile) { |
227 | | - Assert.assertTrue(s.isFile()); |
| 230 | + assertTrue(s.isFile()); |
228 | 231 | } else if (expectedType == fileType.isSymlink) { |
229 | | - Assert.assertTrue(s.isSymlink()); |
| 232 | + assertTrue(s.isSymlink()); |
230 | 233 | } |
231 | | - Assert.assertEquals(aFc.makeQualified(new Path(path)), s.getPath()); |
| 234 | + assertEquals(aFc.makeQualified(new Path(path)), s.getPath()); |
232 | 235 | } |
233 | 236 |
|
234 | 237 | public static void checkFileLinkStatus(FileContext aFc, String path, |
235 | 238 | fileType expectedType) throws IOException { |
236 | 239 | FileStatus s = aFc.getFileLinkStatus(new Path(path)); |
237 | | - Assert.assertNotNull(s); |
| 240 | + assertNotNull(s); |
238 | 241 | if (expectedType == fileType.isDir) { |
239 | | - Assert.assertTrue(s.isDirectory()); |
| 242 | + assertTrue(s.isDirectory()); |
240 | 243 | } else if (expectedType == fileType.isFile) { |
241 | | - Assert.assertTrue(s.isFile()); |
| 244 | + assertTrue(s.isFile()); |
242 | 245 | } else if (expectedType == fileType.isSymlink) { |
243 | | - Assert.assertTrue(s.isSymlink()); |
| 246 | + assertTrue(s.isSymlink()); |
244 | 247 | } |
245 | | - Assert.assertEquals(aFc.makeQualified(new Path(path)), s.getPath()); |
| 248 | + assertEquals(aFc.makeQualified(new Path(path)), s.getPath()); |
246 | 249 | } |
247 | 250 | } |
0 commit comments