Skip to content

Commit eb70639

Browse files
authored
HDFS-17827. [JDK17] Upgrade JUnit from 4 to 5 in hadoop-hdfs-native-client. (#7950)
* HDFS-17827. [JDK17] Upgrade JUnit from 4 to 5 in hadoop-hdfs-native-client. Reviewed-by: Shilun Fan <[email protected]> Signed-off-by: Shilun Fan <[email protected]>
1 parent 949c0d5 commit eb70639

File tree

1 file changed

+12
-8
lines changed
  • hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/fuse-dfs/test

1 file changed

+12
-8
lines changed

hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/fuse-dfs/test/TestFuseDFS.java

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,13 @@
3232
import org.apache.hadoop.test.GenericTestUtils;
3333
import org.apache.hadoop.util.StringUtils;
3434

35-
import org.junit.Test;
36-
import org.junit.BeforeClass;
37-
import org.junit.AfterClass;
38-
import static org.junit.Assert.*;
35+
import org.junit.jupiter.api.Test;
36+
import org.junit.jupiter.api.BeforeAll;
37+
import org.junit.jupiter.api.AfterAll;
38+
import static org.junit.jupiter.api.Assertions.assertEquals;
39+
import static org.junit.jupiter.api.Assertions.assertTrue;
40+
import static org.junit.jupiter.api.Assertions.assertNull;
41+
import static org.junit.jupiter.api.Assertions.fail;
3942

4043
/**
4144
* Basic functional tests on a fuse-dfs mount.
@@ -135,7 +138,7 @@ private static void checkFile(File f, String expectedContents)
135138
fi.close(); // NB: leaving f unclosed prevents unmount
136139
}
137140
String s = new String(b, 0, len);
138-
assertEquals("File content differs", expectedContents, s);
141+
assertEquals(expectedContents, s, "File content differs");
139142
}
140143

141144
private static class RedirectToStdoutThread extends Thread {
@@ -227,13 +230,14 @@ private static Process establishMount(URI uri) throws IOException {
227230
private static void teardownMount() throws IOException {
228231
execWaitRet("fusermount -u " + mountPoint);
229232
try {
230-
assertEquals(0, fuseProcess.waitFor()); // fuse_dfs should exit cleanly
233+
assertEquals(0,
234+
fuseProcess.waitFor()); // fuse_dfs should exit cleanly
231235
} catch (InterruptedException e) {
232236
fail("interrupted while waiting for fuse_dfs process to exit.");
233237
}
234238
}
235239

236-
@BeforeClass
240+
@BeforeAll
237241
public static void startUp() throws IOException {
238242
Configuration conf = new HdfsConfiguration();
239243
r = Runtime.getRuntime();
@@ -245,7 +249,7 @@ public static void startUp() throws IOException {
245249
fuseProcess = establishMount(fs.getUri());
246250
}
247251

248-
@AfterClass
252+
@AfterAll
249253
public static void tearDown() throws IOException {
250254
// Unmount before taking down the mini cluster
251255
// so no outstanding operations hang.

0 commit comments

Comments
 (0)