pranavshenoy commented on code in PR #4087:
URL: https://github.com/apache/cassandra/pull/4087#discussion_r2051267387


##########
test/unit/org/apache/cassandra/db/compaction/unified/ControllerTest.java:
##########
@@ -121,6 +121,50 @@ public void testValidateOptionsIntegers()
         testValidateOptions(true);
     }
 
+    @Test
+    public void testValidateOptionsInvalidTargetSSTableSize()
+    {
+        //Test 1: TARGET_SSTABLE_SIZE_OPTION = 12E899, the value reported in 
CASSANDRA-20398 
+        try {
+            Map<String, String> options = new HashMap<>();
+            options.putIfAbsent(Controller.TARGET_SSTABLE_SIZE_OPTION, 
"12E899");
+            Controller.validateOptions(options);
+            fail("TARGET_SSTABLE_SIZE_OPTION = 12E899 should have caused 
exception");
+        } catch(ConfigurationException e) {
+        }
+
+        //TEST 2: TARGET_SSTABLE_SIZE_OPTION > LONG.MAX_VALUE
+        try {
+            Map<String, String> options = new HashMap<>();
+            options.putIfAbsent(Controller.TARGET_SSTABLE_SIZE_OPTION, 
"9223372036854775907");
+            Controller.validateOptions(options);
+            fail("Passing TARGET_SSTABLE_SIZE_OPTION > LONG.MAX_VALUE should 
have caused exception");
+        } catch(ConfigurationException e) {
+        }
+
+        //TEST 3: TARGET_SSTABLE_SIZE_OPTION < Default MIN_TARGET_SSTABLE_SIZE 
(1048576)
+        try {
+            Map<String, String> options = new HashMap<>();
+            options.putIfAbsent(Controller.TARGET_SSTABLE_SIZE_OPTION, 
"1048000");
+            Controller.validateOptions(options);
+            fail("Passing TARGET_SSTABLE_SIZE_OPTION < MIN_TARGET_SSTABLE_SIZE 
should have caused exception");
+        } catch(ConfigurationException e) {

Review Comment:
   done. 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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to