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?