You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by "ddanielr (via GitHub)" <gi...@apache.org> on 2023/02/01 02:05:41 UTC

[GitHub] [accumulo] ddanielr commented on a diff in pull request #3177: Validate Property Values

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


##########
core/src/test/java/org/apache/accumulo/core/conf/PropertyTest.java:
##########
@@ -88,13 +88,28 @@ public void testPorts() {
     for (Property prop : Property.values()) {
       if (prop.getType().equals(PropertyType.PORT)) {
         int port = Integer.parseInt(prop.getDefaultValue());
+        assertTrue(Property.isValidProperty(prop.getKey(), Integer.toString(port)));
         assertFalse(usedPorts.contains(port), "Port already in use: " + port);
         usedPorts.add(port);
         assertTrue(port > 1023 && port < 65536, "Port out of range of valid ports: " + port);
       }
     }
   }
 
+  @Test
+  public void testBooleans() {
+    for (Property prop : Property.values()) {

Review Comment:
   Replaced `testBooleans` with `testPropertyValidation` that runs through the property possibilities and attempts invalid types. 
   
   I left the ShellIT alone since it's a client test of the RPC calls. If the shell is ever spun out of this codebase it would remain valuable.



-- 
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: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org