test_class.file: rest-backend/src/test/java/org/eclipse/steady/backend/util/ConnectionUtilTest.java
test_class.identifier: ConnectionUtilTest
test_case.body: @Test
    public void testGetProxy() {
  
      String host = System.getProperty("http.proxyHost");
      String port = System.getProperty("http.proxyPort");
  
      RequestConfig g = ConnectionUtil.getProxyConfig();
  
      System.setProperty("http.proxyHost", "proxy");
      System.setProperty("http.proxyPort", "80");
      g = ConnectionUtil.getProxyConfig();
      assertEquals(g.getProxy().toString(), "http://proxy:80");
  
      System.setProperty("http.proxyPort", "");
      g = ConnectionUtil.getProxyConfig();
      assertEquals(g, null);
      // System.out.println(g.getProxy());
  
      if (host != null) System.setProperty("http.proxyHost", host);
      if (port != null) System.setProperty("http.proxyPort", port);
    }
test_case.class_method_signature: ConnectionUtilTest.testGetProxy()
test_case.full_signature: @Test public void testGetProxy()
test_case.identifier: testGetProxy
test_case.invocations: getProperty getProperty getProxyConfig setProperty setProperty getProxyConfig assertEquals toString getProxy setProperty getProxyConfig assertEquals setProperty setProperty
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetProxy()
focal_class.declarator: log = LoggerFactory.getLogger(ConnectionUtil.class)
focal_class.modifier: private static
focal_class.original_string: private static Logger log = LoggerFactory.getLogger(ConnectionUtil.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.file: rest-backend/src/main/java/org/eclipse/steady/backend/util/ConnectionUtil.java
focal_class.identifier: ConnectionUtil
focal_class.class_method_signature: ConnectionUtil.getProxyConfig()
focal_class.full_signature: public static RequestConfig getProxyConfig()
focal_class.identifier: getProxyConfig
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: RequestConfig
focal_class.signature: RequestConfig getProxyConfig()
focal_class.class_method_signature: ConnectionUtil.readInputStream(@NotNull InputStream _is)
focal_class.full_signature: public static String readInputStream(@NotNull InputStream _is)
focal_class.identifier: readInputStream
focal_class.modifiers: public static
focal_class.parameters: (@NotNull InputStream _is)
focal_class.return: String
focal_class.signature: String readInputStream(@NotNull InputStream _is)
focal_method.body: public static RequestConfig getProxyConfig() {
      RequestConfig config = null;
      final String phost = System.getProperty("http.proxyHost", null);
      final String pport = System.getProperty("http.proxyPort", "-1");
      int pport_int = -1;
      try {
        pport_int = Integer.parseInt(pport);
      } catch (NumberFormatException e) {
        log.warn(
            "The value '"
                + pport
                + "' is not a valid proxy port, the request will be executed without proxy");
      }
      if (phost != null && pport_int != -1) {
        final HttpHost http_proxy = new HttpHost(phost, pport_int, "http");
        config = RequestConfig.custom().setProxy(http_proxy).build();
      }
      return config;
    }
focal_method.class_method_signature: ConnectionUtil.getProxyConfig()
focal_method.full_signature: public static RequestConfig getProxyConfig()
focal_method.identifier: getProxyConfig
focal_method.invocations: getProperty getProperty parseInt warn build setProxy custom
focal_method.modifiers: public static
focal_method.parameters: ()
focal_method.return: RequestConfig
focal_method.signature: RequestConfig getProxyConfig()