|
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;
|
|
28 | 32 | import org.apache.hadoop.fs.permission.FsPermission;
|
29 | 33 | import org.apache.hadoop.io.IOUtils;
|
30 | 34 | import org.apache.hadoop.security.AccessControlException;
|
31 |
| -import org.junit.Assert; |
32 | 35 |
|
33 | 36 | /**
|
34 | 37 | * Helper class for unit tests.
|
@@ -169,29 +172,29 @@ public FileStatus containsPath(String path, FileStatus[] dirList)
|
169 | 172 | public void checkFileStatus(String path, fileType expectedType)
|
170 | 173 | throws IOException {
|
171 | 174 | FileStatus s = fc.getFileStatus(new Path(path));
|
172 |
| - Assert.assertNotNull(s); |
| 175 | + assertNotNull(s); |
173 | 176 | if (expectedType == fileType.isDir) {
|
174 |
| - Assert.assertTrue(s.isDirectory()); |
| 177 | + assertTrue(s.isDirectory()); |
175 | 178 | } else if (expectedType == fileType.isFile) {
|
176 |
| - Assert.assertTrue(s.isFile()); |
| 179 | + assertTrue(s.isFile()); |
177 | 180 | } else if (expectedType == fileType.isSymlink) {
|
178 |
| - Assert.assertTrue(s.isSymlink()); |
| 181 | + assertTrue(s.isSymlink()); |
179 | 182 | }
|
180 |
| - Assert.assertEquals(fc.makeQualified(new Path(path)), s.getPath()); |
| 183 | + assertEquals(fc.makeQualified(new Path(path)), s.getPath()); |
181 | 184 | }
|
182 | 185 |
|
183 | 186 | public void checkFileLinkStatus(String path, fileType expectedType)
|
184 | 187 | throws IOException {
|
185 | 188 | FileStatus s = fc.getFileLinkStatus(new Path(path));
|
186 |
| - Assert.assertNotNull(s); |
| 189 | + assertNotNull(s); |
187 | 190 | if (expectedType == fileType.isDir) {
|
188 |
| - Assert.assertTrue(s.isDirectory()); |
| 191 | + assertTrue(s.isDirectory()); |
189 | 192 | } else if (expectedType == fileType.isFile) {
|
190 |
| - Assert.assertTrue(s.isFile()); |
| 193 | + assertTrue(s.isFile()); |
191 | 194 | } else if (expectedType == fileType.isSymlink) {
|
192 |
| - Assert.assertTrue(s.isSymlink()); |
| 195 | + assertTrue(s.isSymlink()); |
193 | 196 | }
|
194 |
| - Assert.assertEquals(fc.makeQualified(new Path(path)), s.getPath()); |
| 197 | + assertEquals(fc.makeQualified(new Path(path)), s.getPath()); |
195 | 198 | }
|
196 | 199 |
|
197 | 200 | //
|
|
0 commit comments