Apache9 commented on code in PR #8165:
URL: https://github.com/apache/hbase/pull/8165#discussion_r3165216546


##########
hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileBlockHeaderCorruption.java:
##########
@@ -75,32 +71,52 @@
  * HBase checksum validation can be applied. As of now, this is just
  * {@code onDiskSizeWithoutHeader}.
  */
-@Category({ IOTests.class, SmallTests.class })
+@Tag(IOTests.TAG)
+@Tag(SmallTests.TAG)
 public class TestHFileBlockHeaderCorruption {
 
   private static final Logger LOG = 
LoggerFactory.getLogger(TestHFileBlockHeaderCorruption.class);
 
-  @ClassRule
-  public static final HBaseClassTestRule CLASS_RULE =
-    HBaseClassTestRule.forClass(TestHFileBlockHeaderCorruption.class);
+  private static final HBaseTestingUtil UTIL = new HBaseTestingUtil();
+  private static HFileSystem HFS;
+  private HFileContext hfileCtx;
+  private Path path;
 
-  private final HFileTestRule hFileTestRule;
-
-  @Rule
-  public final RuleChain ruleChain;
+  @BeforeAll
+  public static void setUpBeforeAll() throws IOException {
+    HFS = (HFileSystem) HFileSystem.get(UTIL.getConfiguration());
+  }
 
-  public TestHFileBlockHeaderCorruption() throws IOException {
-    TestName testName = new TestName();
-    hFileTestRule = new HFileTestRule(new HBaseTestingUtil(), testName);
-    ruleChain = RuleChain.outerRule(testName).around(hFileTestRule);
+  @BeforeEach
+  public void setUp(TestInfo testInfo) throws IOException {
+    path = new Path(UTIL.getDataTestDirOnTestFS(), 
testInfo.getTestMethod().get().getName());
+    hfileCtx = new HFileContextBuilder().withBlockSize(4 * 
1024).withHBaseCheckSum(true).build();

Review Comment:
   Follow the old pattern with method name, in our test environment a test 
method is always present.



-- 
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