EdColeman commented on code in PR #3177:
URL: https://github.com/apache/accumulo/pull/3177#discussion_r1092541358
##########
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");
+ continue;
+ case CLASSNAMELIST:
+ invalidValue = "String,Object";
+ break;
+ case DURABILITY:
+ invalidValue = "rinse";
+ break;
+ case GC_POST_ACTION:
+ invalidValue = "expand";
+ break;
+ case BOOLEAN:
+ invalidValue = "fooFalse";
+ break;
+ case URI:
+ invalidValue = "12///\\{}:;123!";
+ break;
+ default:
+ Shell.log
+ .debug("Property Type: " + propertyType.toString() + " has no
defined test case");
Review Comment:
The toString() on `propertyType.toString()` is unnecessary.
--
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]