ddanielr commented on code in PR #3177:
URL: https://github.com/apache/accumulo/pull/3177#discussion_r1092203370


##########
test/src/main/java/org/apache/accumulo/test/shell/ShellIT.java:
##########
@@ -470,6 +472,93 @@ public void grepTest() throws IOException {
     exec("deletetable t -f", true, "Table: [t] has been deleted");
   }
 
+  @Test
+  void configTest() throws IOException {
+    Shell.log.debug("Starting config property type test 
-------------------------");
+
+    String testTable = "test";
+    exec("createtable " + testTable, true);
+
+    for (Property property : Property.values()) {
+      PropertyType propertyType = property.getType();
+      String invalidValue, validValue = property.getDefaultValue();
+
+      // Skip test if we can't set this property via shell
+      if (!Property.isValidZooPropertyKey(property.getKey())) {
+        Shell.log.debug("Property {} with type {} cannot be modified by 
shell", property.getKey(),
+            propertyType.toString());
+        continue;
+      }
+
+      switch (propertyType) {
+        case PATH:
+        case PREFIX:
+        case STRING:
+          Shell.log.debug("Skipping " + propertyType + " Property Types");
+          continue;
+        case TIMEDURATION:
+          invalidValue = "1h30min";
+          break;
+        case BYTES:
+          invalidValue = "1M500k";
+          break;
+        case MEMORY:
+          invalidValue = "1.5G";
+          break;
+        case HOSTLIST:
+          invalidValue = ":1000";
+          break;
+        case PORT:
+          invalidValue = "65539";
+          break;
+        case COUNT:
+          invalidValue = "-1";
+          break;
+        case FRACTION:
+          invalidValue = "10Percent";
+          break;
+        case ABSOLUTEPATH:
+          invalidValue = "~/foo";
+          break;
+        case CLASSNAME:
+          Shell.log.debug("CLASSNAME properties currently fail this test");
+          Shell.log.debug("Regex used for CLASSNAME property types may need to 
be modified");

Review Comment:
   Currently, all of these changes don't alter property structure, they just 
enforce the previously defined types. 
   
   Modifying a property regex has the potential to break legitimate uses.
   So, I'd rather open an issue for the regex fix and track that as a separate 
action. 



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