Copilot commented on code in PR #8042:
URL: https://github.com/apache/hbase/pull/8042#discussion_r3055394648


##########
hbase-server/src/test/java/org/apache/hadoop/hbase/fs/TestBlockReorderMultiBlocks.java:
##########
@@ -252,11 +246,11 @@ private void testFromDFS(DistributedFileSystem dfs, 
String src, int repCount, St
       final long max = EnvironmentEdgeManager.currentTime() + 10000;
       boolean done;
       do {
-        Assert.assertTrue("Can't get enouth replica", 
EnvironmentEdgeManager.currentTime() < max);
+        assertTrue(EnvironmentEdgeManager.currentTime() < max, "Can't get 
enouth replica");

Review Comment:
   Typo in assertion message: "enouth" should be "enough".



##########
hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverInterface.java:
##########
@@ -696,8 +695,8 @@ public void testCompactionOverride() throws Exception {
         assertNotNull(r);
         assertFalse(r.isEmpty());
         byte[] iBytes = Bytes.toBytes(i);
-        assertArrayEquals("Row should be " + i, r.getRow(), iBytes);
-        assertArrayEquals("Value should be " + i, r.getValue(A, A), iBytes);
+        assertArrayEquals(r.getRow(), iBytes, "Row should be " + i);
+        assertArrayEquals(r.getValue(A, A), iBytes, "Value should be " + i);

Review Comment:
   `assertArrayEquals` uses the JUnit 5 signature `assertArrayEquals(expected, 
actual, ...)`. The current argument order is reversed, which makes diffs in 
assertion failures confusing. Swap arguments so `iBytes` is expected and the 
value from `Result` is actual.



##########
hbase-server/src/test/java/org/apache/hadoop/hbase/backup/example/TestZooKeeperTableArchiveClient.java:
##########
@@ -167,20 +162,20 @@ public void testArchivingEnableDisable() throws Exception 
{
     // 1. turn on hfile backups
     LOG.debug("----Starting archiving");
     archivingClient.enableHFileBackupAsync(TABLE_NAME);
-    assertTrue("Archving didn't get turned on", 
archivingClient.getArchivingEnabled(TABLE_NAME));
+    assertTrue(archivingClient.getArchivingEnabled(TABLE_NAME), "Archving 
didn't get turned on");
 
     // 2. Turn off archiving and make sure its off
     archivingClient.disableHFileBackup();
-    assertFalse("Archving didn't get turned off.", 
archivingClient.getArchivingEnabled(TABLE_NAME));
+    assertFalse(archivingClient.getArchivingEnabled(TABLE_NAME), "Archving 
didn't get turned off.");

Review Comment:
   Typo in assertion messages: "Archving" should be "Archiving".



##########
hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestSnapshotWhenChoreCleaning.java:
##########
@@ -156,10 +147,10 @@ public void testSnapshotWhenSnapshotHFileCleanerRunning() 
throws Exception {
     }
 
     TEST_UTIL.getAdmin().snapshot("snapshotName_prev", TABLE_NAME);
-    
Assert.assertEquals(Lists.newArrayList(cleaner.getDeletableFiles(files)).size(),
 0);
+    assertEquals(Lists.newArrayList(cleaner.getDeletableFiles(files)).size(), 
0);
     TEST_UTIL.getAdmin().deleteSnapshot("snapshotName_prev");
     cleaner.getFileCacheForTesting().triggerCacheRefreshForTesting();
-    
Assert.assertEquals(Lists.newArrayList(cleaner.getDeletableFiles(files)).size(),
 100);
+    assertEquals(Lists.newArrayList(cleaner.getDeletableFiles(files)).size(), 
100);

Review Comment:
   The `assertEquals` calls have arguments reversed for JUnit 5 
(`assertEquals(expected, actual, ...)`). Using the current order makes failure 
output misleading. Swap the arguments so the expected values are `0` and `100` 
and the actual value is the computed size.



##########
hbase-server/src/test/java/org/apache/hadoop/hbase/backup/example/TestZooKeeperTableArchiveClient.java:
##########
@@ -363,7 +358,7 @@ private List<BaseHFileCleanerDelegate> 
turnOnArchiving(String tableName, HFileCl
     // turn on hfile retention
     LOG.debug("----Starting archiving for table:" + tableName);
     archivingClient.enableHFileBackupAsync(Bytes.toBytes(tableName));
-    assertTrue("Archving didn't get turned on", 
archivingClient.getArchivingEnabled(tableName));
+    assertTrue(archivingClient.getArchivingEnabled(tableName), "Archving 
didn't get turned on");

Review Comment:
   Typo in assertion message: "Archving" should be "Archiving".
   ```suggestion
       assertTrue(archivingClient.getArchivingEnabled(tableName), "Archiving 
didn't get turned on");
   ```



##########
hbase-server/src/test/java/org/apache/hadoop/hbase/backup/example/TestZooKeeperTableArchiveClient.java:
##########
@@ -167,20 +162,20 @@ public void testArchivingEnableDisable() throws Exception 
{
     // 1. turn on hfile backups
     LOG.debug("----Starting archiving");
     archivingClient.enableHFileBackupAsync(TABLE_NAME);
-    assertTrue("Archving didn't get turned on", 
archivingClient.getArchivingEnabled(TABLE_NAME));
+    assertTrue(archivingClient.getArchivingEnabled(TABLE_NAME), "Archving 
didn't get turned on");
 
     // 2. Turn off archiving and make sure its off
     archivingClient.disableHFileBackup();
-    assertFalse("Archving didn't get turned off.", 
archivingClient.getArchivingEnabled(TABLE_NAME));
+    assertFalse(archivingClient.getArchivingEnabled(TABLE_NAME), "Archving 
didn't get turned off.");
 
     // 3. Check enable/disable on a single table
     archivingClient.enableHFileBackupAsync(TABLE_NAME);
-    assertTrue("Archving didn't get turned on", 
archivingClient.getArchivingEnabled(TABLE_NAME));
+    assertTrue(archivingClient.getArchivingEnabled(TABLE_NAME), "Archving 
didn't get turned on");
 
     // 4. Turn off archiving and make sure its off
     archivingClient.disableHFileBackup(TABLE_NAME);
-    assertFalse("Archving didn't get turned off for " + STRING_TABLE_NAME,
-      archivingClient.getArchivingEnabled(TABLE_NAME));
+    assertFalse(archivingClient.getArchivingEnabled(TABLE_NAME),
+      "Archving didn't get turned off for " + STRING_TABLE_NAME);

Review Comment:
   Typo in assertion messages: "Archving" should be "Archiving".



##########
hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestIncrementAndAppendWithNullResult.java:
##########
@@ -148,9 +143,9 @@ private static void checkResult(Result r) {
 
   private static void checkResult(Object[] results) {
     for (int i = 0; i != results.length; ++i) {
-      assertNotNull("The result[" + i + "] should not be null", results[i]);
-      assertTrue("The result[" + i + "] should be Result type", results[i] 
instanceof Result);
-      assertTrue("The result[" + i + "] shuold be empty", ((Result) 
results[i]).isEmpty());
+      assertNotNull(results[i], "The result[" + i + "] should not be null");
+      assertTrue(results[i] instanceof Result, "The result[" + i + "] should 
be Result type");
+      assertTrue(((Result) results[i]).isEmpty(), "The result[" + i + "] 
shuold be empty");

Review Comment:
   Typo in assertion message: "shuold" should be "should".
   ```suggestion
         assertTrue(((Result) results[i]).isEmpty(), "The result[" + i + "] 
should be empty");
   ```



##########
hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestRestoreSnapshotHelper.java:
##########
@@ -395,13 +390,13 @@ private void verifyRestore(final Path rootDir, final 
TableDescriptor sourceHtd,
     for (int i = 0; i < files.size(); i += 2) {
       String linkFile = files.get(i);
       String refFile = files.get(i + 1);
-      assertTrue(linkFile + " should be a HFileLink", 
HFileLink.isHFileLink(linkFile));
-      assertTrue(refFile + " should be a Referene", 
StoreFileInfo.isReference(refFile));
+      assertTrue(HFileLink.isHFileLink(linkFile), linkFile + " should be a 
HFileLink");
+      assertTrue(StoreFileInfo.isReference(refFile), refFile + " should be a 
Referene");

Review Comment:
   Typo in assertion message: "Referene" should be "Reference".



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