@Test public void testBuildURL_upperBounds() { traceWindow.numericalDataCheckBox.setValue(true); traceWindow.forcedHopField.setValue("256.256.256.256"); assertNull(traceWindow.buildURL()); }
protected URL buildURL() { boolean validInput = false; try { validInput = validateInput(); } catch (Exception e) { getApplication().getMainWindow().showNotification(e.getMessage(), Notification.TYPE_WARNING_MESSAGE); return null; } if (validInput) { final URL baseUrl = getApplication().getURL(); final StringBuilder options = new StringBuilder(tracerouteUrl); options.append("&address=").append(ipDropdown.getValue()); if (!("".equals(forcedHopField.getValue().toString()))) { options.append("&hopAddress=").append(forcedHopField.getValue()); } if (numericalDataCheckBox.getValue().equals(true)) { options.append("&numericOutput=true"); } try { return new URL(baseUrl, options.toString()); } catch (final MalformedURLException e) { getApplication().getMainWindow().showNotification("Could not build URL: " + options.toString(), Notification.TYPE_WARNING_MESSAGE); return null; } } else { getApplication().getMainWindow().showNotification("Invalid IP addresss", Notification.TYPE_WARNING_MESSAGE); return null; } }
TracerouteWindow extends Window { protected URL buildURL() { boolean validInput = false; try { validInput = validateInput(); } catch (Exception e) { getApplication().getMainWindow().showNotification(e.getMessage(), Notification.TYPE_WARNING_MESSAGE); return null; } if (validInput) { final URL baseUrl = getApplication().getURL(); final StringBuilder options = new StringBuilder(tracerouteUrl); options.append("&address=").append(ipDropdown.getValue()); if (!("".equals(forcedHopField.getValue().toString()))) { options.append("&hopAddress=").append(forcedHopField.getValue()); } if (numericalDataCheckBox.getValue().equals(true)) { options.append("&numericOutput=true"); } try { return new URL(baseUrl, options.toString()); } catch (final MalformedURLException e) { getApplication().getMainWindow().showNotification("Could not build URL: " + options.toString(), Notification.TYPE_WARNING_MESSAGE); return null; } } else { getApplication().getMainWindow().showNotification("Invalid IP addresss", Notification.TYPE_WARNING_MESSAGE); return null; } } }
TracerouteWindow extends Window { protected URL buildURL() { boolean validInput = false; try { validInput = validateInput(); } catch (Exception e) { getApplication().getMainWindow().showNotification(e.getMessage(), Notification.TYPE_WARNING_MESSAGE); return null; } if (validInput) { final URL baseUrl = getApplication().getURL(); final StringBuilder options = new StringBuilder(tracerouteUrl); options.append("&address=").append(ipDropdown.getValue()); if (!("".equals(forcedHopField.getValue().toString()))) { options.append("&hopAddress=").append(forcedHopField.getValue()); } if (numericalDataCheckBox.getValue().equals(true)) { options.append("&numericOutput=true"); } try { return new URL(baseUrl, options.toString()); } catch (final MalformedURLException e) { getApplication().getMainWindow().showNotification("Could not build URL: " + options.toString(), Notification.TYPE_WARNING_MESSAGE); return null; } } else { getApplication().getMainWindow().showNotification("Invalid IP addresss", Notification.TYPE_WARNING_MESSAGE); return null; } } TracerouteWindow(final Node node, final String url); }
TracerouteWindow extends Window { protected URL buildURL() { boolean validInput = false; try { validInput = validateInput(); } catch (Exception e) { getApplication().getMainWindow().showNotification(e.getMessage(), Notification.TYPE_WARNING_MESSAGE); return null; } if (validInput) { final URL baseUrl = getApplication().getURL(); final StringBuilder options = new StringBuilder(tracerouteUrl); options.append("&address=").append(ipDropdown.getValue()); if (!("".equals(forcedHopField.getValue().toString()))) { options.append("&hopAddress=").append(forcedHopField.getValue()); } if (numericalDataCheckBox.getValue().equals(true)) { options.append("&numericOutput=true"); } try { return new URL(baseUrl, options.toString()); } catch (final MalformedURLException e) { getApplication().getMainWindow().showNotification("Could not build URL: " + options.toString(), Notification.TYPE_WARNING_MESSAGE); return null; } } else { getApplication().getMainWindow().showNotification("Invalid IP addresss", Notification.TYPE_WARNING_MESSAGE); return null; } } TracerouteWindow(final Node node, final String url); @Override void attach(); }
TracerouteWindow extends Window { protected URL buildURL() { boolean validInput = false; try { validInput = validateInput(); } catch (Exception e) { getApplication().getMainWindow().showNotification(e.getMessage(), Notification.TYPE_WARNING_MESSAGE); return null; } if (validInput) { final URL baseUrl = getApplication().getURL(); final StringBuilder options = new StringBuilder(tracerouteUrl); options.append("&address=").append(ipDropdown.getValue()); if (!("".equals(forcedHopField.getValue().toString()))) { options.append("&hopAddress=").append(forcedHopField.getValue()); } if (numericalDataCheckBox.getValue().equals(true)) { options.append("&numericOutput=true"); } try { return new URL(baseUrl, options.toString()); } catch (final MalformedURLException e) { getApplication().getMainWindow().showNotification("Could not build URL: " + options.toString(), Notification.TYPE_WARNING_MESSAGE); return null; } } else { getApplication().getMainWindow().showNotification("Invalid IP addresss", Notification.TYPE_WARNING_MESSAGE); return null; } } TracerouteWindow(final Node node, final String url); @Override void attach();  }