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


##########
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:
   Should we fix the regex as part of this PR?



##########
test/src/main/java/org/apache/accumulo/test/TableOperationsIT.java:
##########
@@ -205,6 +205,17 @@ public void createTableWithTableNameLengthLimit()
     assertFalse(tableOps.exists(t2));
   }
 
+  @Test
+  public void createTableWithBadProperties()
+      throws AccumuloException, AccumuloSecurityException, 
TableExistsException {
+    TableOperations tableOps = accumuloClient.tableOperations();
+    String t0 = StringUtils.repeat('a', MAX_TABLE_NAME_LEN - 1);

Review Comment:
   We typically create table names with something like `String t0 = 
getUniqueNames(1)[0];



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