38
38
import org .apache .hadoop .mapred .MiniMRClientClusterFactory ;
39
39
import org .apache .hadoop .test .GenericTestUtils ;
40
40
import org .apache .hadoop .yarn .server .resourcemanager .scheduler .capacity .CapacitySchedulerConfiguration ;
41
- import org .junit .Assert ;
42
- import org .junit .Test ;
41
+ import org .junit .jupiter .api .Test ;
43
42
import org .slf4j .event .Level ;
44
43
45
44
import static org .slf4j .LoggerFactory .getLogger ;
45
+ import static org .junit .jupiter .api .Assertions .assertEquals ;
46
+ import static org .junit .jupiter .api .Assertions .assertTrue ;
46
47
47
48
public class TestDistCh {
48
49
{
@@ -77,20 +78,20 @@ static class FileTree {
77
78
78
79
Path createSmallFile (Path dir ) throws IOException {
79
80
final Path f = new Path (dir , "f" + ++fcount );
80
- Assert . assertTrue (!fs .exists (f ));
81
+ assertTrue (!fs .exists (f ));
81
82
final DataOutputStream out = fs .create (f );
82
83
try {
83
84
out .writeBytes ("createSmallFile: f=" + f );
84
85
} finally {
85
86
out .close ();
86
87
}
87
- Assert . assertTrue (fs .exists (f ));
88
+ assertTrue (fs .exists (f ));
88
89
return f ;
89
90
}
90
91
91
92
Path mkdir (Path dir ) throws IOException {
92
- Assert . assertTrue (fs .mkdirs (dir ));
93
- Assert . assertTrue (fs .getFileStatus (dir ).isDirectory ());
93
+ assertTrue (fs .mkdirs (dir ));
94
+ assertTrue (fs .getFileStatus (dir ).isDirectory ());
94
95
return dir ;
95
96
}
96
97
@@ -193,13 +194,13 @@ public void testDistCh() throws Exception {
193
194
}
194
195
195
196
static void checkFileStatus (ChPermissionStatus expected , FileStatus actual ) {
196
- Assert . assertEquals (expected .getUserName (), actual .getOwner ());
197
- Assert . assertEquals (expected .getGroupName (), actual .getGroup ());
197
+ assertEquals (expected .getUserName (), actual .getOwner ());
198
+ assertEquals (expected .getGroupName (), actual .getGroup ());
198
199
FsPermission perm = expected .getPermission ();
199
200
if (actual .isFile () && expected .defaultPerm ) {
200
201
perm = perm .applyUMask (UMASK );
201
202
}
202
- Assert . assertEquals (perm , actual .getPermission ());
203
+ assertEquals (perm , actual .getPermission ());
203
204
}
204
205
205
206
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
213
214
System .setErr (out );
214
215
final String results ;
215
216
try {
216
- Assert . assertEquals (returnvalue , shell .run (new String []{"-lsr" , root }));
217
+ assertEquals (returnvalue , shell .run (new String []{"-lsr" , root }));
217
218
results = bytes .toString ();
218
219
} finally {
219
220
IOUtils .closeStream (out );
0 commit comments