-
Notifications
You must be signed in to change notification settings - Fork 9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HDFS-17718. [JDK17] Upgrade JUnit from 4 to 5 in hadoop-hdfs-client. #7563
base: trunk
Are you sure you want to change the base?
Conversation
🎊 +1 overall
This message was automatically generated. |
@@ -20,7 +20,7 @@ | |||
|
|||
import org.apache.hadoop.test.GenericTestUtils; | |||
import org.junit.Rule; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
org.junit.Rule
needs to be replaced with the JUnit 5 usage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback! I'll update the code as soon as possible.
@@ -23,10 +23,10 @@ | |||
import org.apache.hadoop.hdfs.shortcircuit.ShortCircuitShm.Slot; | |||
import org.apache.hadoop.io.nativeio.SharedFileDescriptorFactory; | |||
import org.apache.hadoop.test.GenericTestUtils; | |||
import org.junit.Assert; | |||
import org.junit.Assume; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
avoid org.junit.Assume
@@ -391,7 +396,7 @@ static void sleepMs(long ms) { | |||
Thread.sleep(ms); | |||
} catch (InterruptedException e) { | |||
e.printStackTrace(); | |||
Assert.fail("Sleep is interrupted: " + e); | |||
Assertions.fail("Sleep is interrupted: " + e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should optimize the usage of Assertions.fail
by importing it statically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your suggestion! The issue has been fixed.
100, bris.startPos); | ||
assertEquals("getPos should return 101 after reading one byte", 101, | ||
bris.getPos()); | ||
assertEquals( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checkstyle issue.
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
@cnauroth Could you please help review this PR? Thank you very much! |
🎊 +1 overall
This message was automatically generated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1. Thank you, @zhtttylz and @slfan1989 .
Description of PR
JIRA:HDFS-17718. [JDK17] Upgrade JUnit from 4 to 5 in hadoop-hdfs-client.
How was this patch tested?
For code changes:
LICENSE
,LICENSE-binary
,NOTICE-binary
files?