### Question:
JibSystemProperties { public static void checkProxyPortProperty() throws NumberFormatException { checkNumericSystemProperty("http.proxyPort", Range.closed(0, 65535)); checkNumericSystemProperty("https.proxyPort", Range.closed(0, 65535)); } private  JibSystemProperties(); static int getHttpTimeout(); static boolean useCrossRepositoryBlobMounts(); static boolean serializeExecution(); static boolean sendCredentialsOverHttp(); static boolean isUserAgentEnabled(); static void checkHttpTimeoutProperty(); static void checkProxyPortProperty(); static boolean skipExistingImages(); static final String UPSTREAM_CLIENT; @VisibleForTesting static final String HTTP_TIMEOUT; @VisibleForTesting
  static final String SEND_CREDENTIALS_OVER_HTTP; @VisibleForTesting static final String SKIP_EXISTING_IMAGES; }### Answer:
@Test public void testCheckHttpProxyPortProperty_undefined() throws NumberFormatException { System.clearProperty("http.proxyPort"); System.clearProperty("https.proxyPort"); JibSystemProperties.checkProxyPortProperty(); }
@Test public void testCheckHttpProxyPortProperty() throws NumberFormatException { System.setProperty("http.proxyPort", "0"); System.setProperty("https.proxyPort", "0"); JibSystemProperties.checkProxyPortProperty(); System.setProperty("http.proxyPort", "1"); System.setProperty("https.proxyPort", "1"); JibSystemProperties.checkProxyPortProperty(); System.setProperty("http.proxyPort", "65535"); System.setProperty("https.proxyPort", "65535"); JibSystemProperties.checkProxyPortProperty(); System.setProperty("http.proxyPort", "65534"); System.setProperty("https.proxyPort", "65534"); JibSystemProperties.checkProxyPortProperty(); }
@Test public void testCheckHttpProxyPortProperty_negativeValue() { System.setProperty("http.proxyPort", "-1"); System.clearProperty("https.proxyPort"); try { JibSystemProperties.checkProxyPortProperty(); Assert.fail(); } catch (NumberFormatException ex) { Assert.assertEquals("http.proxyPort cannot be less than 0: -1", ex.getMessage()); } System.clearProperty("http.proxyPort"); System.setProperty("https.proxyPort", "-1"); try { JibSystemProperties.checkProxyPortProperty(); Assert.fail(); } catch (NumberFormatException ex) { Assert.assertEquals("https.proxyPort cannot be less than 0: -1", ex.getMessage()); } }
@Test public void testCheckHttpProxyPortProperty_over65535() { System.setProperty("http.proxyPort", "65536"); System.clearProperty("https.proxyPort"); try { JibSystemProperties.checkProxyPortProperty(); Assert.fail(); } catch (NumberFormatException ex) { Assert.assertEquals("http.proxyPort cannot be greater than 65535: 65536", ex.getMessage()); } System.clearProperty("http.proxyPort"); System.setProperty("https.proxyPort", "65536"); try { JibSystemProperties.checkProxyPortProperty(); Assert.fail(); } catch (NumberFormatException ex) { Assert.assertEquals("https.proxyPort cannot be greater than 65535: 65536", ex.getMessage()); } }
@Test public void testCheckHttpProxyPortProperty_stringValue() { System.setProperty("http.proxyPort", "some string"); System.clearProperty("https.proxyPort"); try { JibSystemProperties.checkProxyPortProperty(); Assert.fail(); } catch (NumberFormatException ex) { Assert.assertEquals("http.proxyPort must be an integer: some string", ex.getMessage()); } System.clearProperty("http.proxyPort"); System.setProperty("https.proxyPort", "some string"); try { JibSystemProperties.checkProxyPortProperty(); Assert.fail(); } catch (NumberFormatException ex) { Assert.assertEquals("https.proxyPort must be an integer: some string", ex.getMessage()); } }