jmark99 commented on code in PR #3199:
URL: https://github.com/apache/accumulo/pull/3199#discussion_r1114470830


##########
server/base/src/test/java/org/apache/accumulo/server/conf/CheckCompactionConfigTest.java:
##########
@@ -128,6 +128,57 @@ public void testNoPlanner() throws Exception {
     assertTrue(e.getMessage().startsWith(expectedErrorMsg));
   }
 
+  @Test
+  public void testRepeatedCompactionExecutorID() throws Exception {
+    String inputString = ("tserver.compaction.major.service.cs1.planner="
+        + "org.apache.accumulo.core.spi.compaction.DefaultCompactionPlanner \n"
+        + "tserver.compaction.major.service.cs1.planner.opts.executors=\\\n"
+        + 
"[{'name':'small','type':'internal','maxSize':'16M','numThreads':8},\\\n"
+        + 
"{'name':'medium','type':'internal','maxSize':'128M','numThreads':4},\\\n"
+        + 
"{'name':'small','type':'internal','numThreads':2}]").replaceAll("'", "\"");
+    String expectedErrorMsg = "Duplicate Compaction Executor ID found";
+
+    String filePath = writeToFileAndReturnPath(inputString);
+
+    var e = assertThrows(IllegalStateException.class,
+        () -> CheckCompactionConfig.main(new String[] {filePath}));
+    assertTrue(e.getMessage().startsWith(expectedErrorMsg));
+  }
+
+  @Test
+  public void testInvalidTypeValue() throws Exception {
+    String inputString = ("tserver.compaction.major.service.cs1.planner="
+        + "org.apache.accumulo.core.spi.compaction.DefaultCompactionPlanner \n"
+        + "tserver.compaction.major.service.cs1.planner.opts.executors=\\\n"
+        + 
"[{'name':'small','type':'internal','maxSize':'16M','numThreads':8},\\\n"
+        + 
"{'name':'medium','type':'internal','maxSize':'128M','numThreads':4},\\\n"
+        + "{'name':'large','type':'internl','numThreads':2}]").replaceAll("'", 
"\"");
+    String expectedErrorMsg = "type must be 'internal' or 'external'";
+
+    String filePath = writeToFileAndReturnPath(inputString);
+
+    var e = assertThrows(IllegalArgumentException.class,
+        () -> CheckCompactionConfig.main(new String[] {filePath}));
+    assertTrue(e.getMessage().startsWith(expectedErrorMsg));

Review Comment:
   No problem. I understood. I was just trying to point out that if you look at 
that test class in particular, all of the other error condition checks also 
check the message text. So I decided to follow the same format for the two 
additional tests. 
   Also, since the purpose of the additions was to specifically add output new 
information to the user, I'm wasn't sure of a better way to verify the new 
messages appeared in the error output. 



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