|
@@ -18,10 +18,6 @@
|
|
|
package org.apache.hadoop.fs.viewfs;
|
|
|
|
|
|
|
|
|
-import static org.junit.Assert.assertEquals;
|
|
|
-import static org.junit.Assert.assertTrue;
|
|
|
-import static org.junit.Assert.fail;
|
|
|
-
|
|
|
import java.io.IOException;
|
|
|
import java.net.URI;
|
|
|
|
|
@@ -32,11 +28,17 @@ import org.apache.hadoop.fs.FileStatus;
|
|
|
import org.apache.hadoop.fs.FileSystem;
|
|
|
import org.apache.hadoop.fs.Path;
|
|
|
import static org.apache.hadoop.fs.FileSystem.TRASH_PREFIX;
|
|
|
+import static org.junit.jupiter.api.Assertions.assertEquals;
|
|
|
+import static org.junit.jupiter.api.Assertions.assertTrue;
|
|
|
+import static org.junit.jupiter.api.Assertions.fail;
|
|
|
+
|
|
|
import org.apache.hadoop.security.UserGroupInformation;
|
|
|
|
|
|
-import org.junit.After;
|
|
|
-import org.junit.Before;
|
|
|
-import org.junit.Test;
|
|
|
+import org.junit.jupiter.api.AfterEach;
|
|
|
+import org.junit.jupiter.api.BeforeEach;
|
|
|
+import org.junit.jupiter.api.Test;
|
|
|
+
|
|
|
+
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
@@ -54,7 +56,7 @@ public class TestViewFileSystemLocalFileSystem extends ViewFileSystemBaseTest {
|
|
|
LoggerFactory.getLogger(TestViewFileSystemLocalFileSystem.class);
|
|
|
|
|
|
@Override
|
|
|
- @Before
|
|
|
+ @BeforeEach
|
|
|
public void setUp() throws Exception {
|
|
|
// create the test root on local_fs
|
|
|
fsTarget = FileSystem.getLocal(new Configuration());
|
|
@@ -96,10 +98,10 @@ public class TestViewFileSystemLocalFileSystem extends ViewFileSystemBaseTest {
|
|
|
FileSystem lfs = FileSystem.getLocal(testConf);
|
|
|
for (final URI testUri : testUris) {
|
|
|
final Path testFile = new Path(new Path(testUri), testFileName);
|
|
|
- assertTrue(testFile + " should exist!", lfs.exists(testFile));
|
|
|
+ assertTrue(lfs.exists(testFile), testFile + " should exist!");
|
|
|
final FSDataInputStream fsdis = lfs.open(testFile);
|
|
|
try {
|
|
|
- assertEquals("Wrong file content", testString, fsdis.readUTF());
|
|
|
+ assertEquals(fsdis.readUTF(), testString, "Wrong file content");
|
|
|
} finally {
|
|
|
fsdis.close();
|
|
|
}
|
|
@@ -122,14 +124,14 @@ public class TestViewFileSystemLocalFileSystem extends ViewFileSystemBaseTest {
|
|
|
FileSystem.get(URI.create("viewfs://mt/"), conf);
|
|
|
fail("Expected bad minReplication exception.");
|
|
|
} catch (IOException ioe) {
|
|
|
- assertTrue("No minReplication message",
|
|
|
- ioe.getMessage().contains("Minimum replication"));
|
|
|
+ assertTrue(ioe.getMessage().contains("Minimum replication"),
|
|
|
+ "No minReplication message");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- @After
|
|
|
+ @AfterEach
|
|
|
public void tearDown() throws Exception {
|
|
|
fsTarget.delete(fileSystemTestHelper.getTestRootPath(fsTarget), true);
|
|
|
super.tearDown();
|