liuxiaocs7 commented on code in PR #7752:
URL: https://github.com/apache/hbase/pull/7752#discussion_r2807135224


##########
hbase-shell/src/test/java/org/apache/hadoop/hbase/client/AbstractTestShell.java:
##########
@@ -94,8 +94,8 @@ public void testRunShellTests() throws IOException {
     jruby.runScriptlet(PathType.ABSOLUTE, "src/test/ruby/tests_runner.rb");
   }
 
-  @BeforeClass
-  public static void setUpBeforeClass() throws Exception {
+  @BeforeEach
+  public void setUpEach() throws Exception {

Review Comment:
   Hi, @Apache9 
   
   During the migration from Junit4 to Junit5, I discovered that the 
`BeforeClass` initialization method subclass with the same name in Junit4 would 
override the parent class. However, in Junit5, the subclass does not directly 
override the parent class. Instead, the parent class is executed first, 
followed by the subclass, which leads to method incompatibilities (such as the 
possibility of starting both MiniClusters, resulting in failure). 
   
   For example, in `TestChangeSftShell` and `TestRSGroupShell`, I believe there 
may be similar issues in other parts of the HBase codebase. 
   
   Here, we modified `BeforeClass` to `BeforeEach` and overridden it in the 
subclass. Since we only have one unit test method at most, how can we minimize 
modifications when there are many unit test methods? Do you have any 
suggestions, thanks!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to