accumulo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Medinets <david.medin...@gmail.com>
Subject PORT Property Type description does not match regular expression.
Date Sun, 09 Sep 2012 01:55:01 GMT
PropertyType

  PORT("port", "\\d{1,5}", "An positive integer in the range
1024-65535, not already in use or specified elsewhere in the
configuration"),

I was writing some unit tests for PropertyType and ran across PORT:

        case PORT:
          assertFalse(pt.name(), pt.isValidFormat(null));
          assertFalse(pt.name(), pt.isValidFormat("1023"));
          for (int i = 1024; i < 65536; i++) {
            assertTrue(pt.name(), pt.isValidFormat(new Integer(i).toString()));
          }
          assertFalse(pt.name(), pt.isValidFormat("65536"));

The second test failed. And, of course, when I checked the regular
expression it allows any number from "0" to "99999". Should the
isValidFormat method actually test the port range?

Mime
View raw message