Martin Peřina has posted comments on this change. Change subject: tools: Validate WebSocketProxy config value ......................................................................
Patch Set 1: (2 comments) http://gerrit.ovirt.org/#/c/37498/1/backend/manager/tools/src/main/java/org/ovirt/engine/core/config/entity/helper/WebSocketProxyLocationValueHelper.java File backend/manager/tools/src/main/java/org/ovirt/engine/core/config/entity/helper/WebSocketProxyLocationValueHelper.java: Line 23: } Line 24: } Line 25: Line 26: private boolean matchesHostColonPort(String s) { Line 27: return (s == null ? false : s.matches("\\S+:\\d+")); //$NON-NLS-1$ > In the new PS I used URI class for validation host:port as both 'Engine' an That sounds good, if URI validation doesn't do any remote checks (like DNS queries). And please try to test corner cases for port numbers (0, 65536) Line 28: } http://gerrit.ovirt.org/#/c/37498/1/backend/manager/tools/src/test/java/org/ovirt/engine/core/config/entity/helper/WebSocketProxyLocationValueHelperTest.java File backend/manager/tools/src/test/java/org/ovirt/engine/core/config/entity/helper/WebSocketProxyLocationValueHelperTest.java: Line 22: Line 23: @Test Line 24: public void testValidateIncomplete() throws Exception { Line 25: WebSocketProxyLocationValueHelper helper = new WebSocketProxyLocationValueHelper(); Line 26: assertFalse(helper.validate(null, "myengine:").isOk()); > yes, but the this case is invalid since user must specify port as well. Sorry, my bad, I missed the missing port :-) Line 27: } Line 28: Line 29: @Test Line 30: public void testValidateHostPort() throws Exception { -- To view, visit http://gerrit.ovirt.org/37498 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I84b02d25a15762ba24544bd678328e6532d360ac Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Frank Kobzik <[email protected]> Gerrit-Reviewer: Eli Mesika <[email protected]> Gerrit-Reviewer: Frank Kobzik <[email protected]> Gerrit-Reviewer: Martin Peřina <[email protected]> Gerrit-Reviewer: Yair Zaslavsky <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
