guluo2016 commented on code in PR #6989:
URL: https://github.com/apache/hbase/pull/6989#discussion_r2087186322


##########
hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestTableDescriptorChecker.java:
##########
@@ -66,21 +66,32 @@ public void testSanityCheck() throws IOException {
     t.setValue(key, "1");
     TableDescriptorChecker.sanityCheck(conf, t.build());
 
-    // Error in column family configuration.
-    cf.setValue(key, "xx");
-    t.removeColumnFamily("cf".getBytes());
-    t.setColumnFamily(cf.build());
-    try {
+    // Verify column family configuration.
+    for (boolean viaSetValue : new boolean[] { true, false }) {
+      // Error in column family configuration.
+      if (viaSetValue) {
+        cf.setValue(key, "xx");
+      } else {
+        cf.setConfiguration(key, "xx");
+      }
+      t.removeColumnFamily("cf".getBytes());
+      t.setColumnFamily(cf.build());
+      try {
+        TableDescriptorChecker.sanityCheck(conf, t.build());
+        fail("Should have thrown IllegalArgumentException");
+      } catch (DoNotRetryIOException e) {
+        // Expected
+      }

Review Comment:
   ```java
   assertThrows("Should have thrown IllegalArgumentException", 
DoNotRetryIOException.class, () -> TableDescriptorChecker.sanityCheck(conf, 
t.build()));
   ```
   Would this be more concise?



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