Package org.apache.http.conn

Examples of org.apache.http.conn.HttpHostConnectException


        Socket sock;
        try {
            sock = lsf.createLayeredSocket(
                    conn.getSocket(), target.getHostName(), target.getPort(), true);
        } catch (ConnectException ex) {
            throw new HttpHostConnectException(target, ex);
        }
        prepareSocket(sock, context, params);
        conn.update(sock, target, lsf.isSecure(sock), params);
    }
View Full Code Here


        try {
            sock = sf.connectSocket(sock, target.getHostName(),
                    schm.resolvePort(target.getPort()),
                    local, 0, params);
        } catch (ConnectException ex) {
            throw new HttpHostConnectException(target, ex);
        }
        prepareSocket(sock, context, params);
        conn.openCompleted(sf.isSecure(sock), params);
    }
View Full Code Here

        final Socket sock;
        try {
            sock = lsf.createSocket
                (conn.getSocket(), target.getHostName(), target.getPort(), true);
        } catch (ConnectException ex) {
            throw new HttpHostConnectException(target, ex);
        }
        prepareSocket(sock, context, params);
        conn.update(sock, target, lsf.isSecure(sock), params);
    }
View Full Code Here

      }
      prepareSocket(sock, context, params);
      conn.openCompleted(sf.isSecure(sock), params);
      return;
    } catch (ConnectException ex) {
      throw new HttpHostConnectException(target, ex);
    }
  }
View Full Code Here

   }

   @Test
   public void testHttpHostConnectException() throws Exception
   {
      doTest(new ResteasyHttpHostConnectException(), new HttpHostConnectException(null, null));
   }
View Full Code Here

                    }

                    return;
                } catch (ConnectException ex) {
                    if (last) {
                        throw new HttpHostConnectException(target, ex);
                    }
                } catch (ConnectTimeoutException ex) {
                    if (last) {
                        throw ex;
                    }
View Full Code Here

                if (last) {
                    final String msg = ex.getMessage();
                    if ("Connection timed out".equals(msg)) {
                        throw new ConnectTimeoutException(ex, host, addresses);
                    } else {
                        throw new HttpHostConnectException(ex, host, addresses);
                    }
                }
            }
            if (this.log.isDebugEnabled()) {
                this.log.debug("Connect to " + remoteAddress + " timed out. " +
View Full Code Here

            final String json = RestAssured.post(LOGIN_URL).asString();
            assertThat("Failed to login into mifosx platform", StringUtils.isBlank(json), is(false));
            return JsonPath.with(json).get("base64EncodedAuthenticationKey");
        } catch (final Exception e) {
            if (e instanceof HttpHostConnectException) {
                final HttpHostConnectException hh = (HttpHostConnectException) e;
                fail("Failed to connect to mifosx platform:" + hh.getMessage());
            }

            throw new RuntimeException(e);
        }
    }
View Full Code Here

            final String json = RestAssured.post(LOGIN_URL).asString();
            assertThat("Failed to login into mifosx platform", StringUtils.isBlank(json), is(false));
            return JsonPath.with(json).get("base64EncodedAuthenticationKey");
        } catch (final Exception e) {
            if (e instanceof HttpHostConnectException) {
                final HttpHostConnectException hh = (HttpHostConnectException) e;
                fail("Failed to connect to mifosx platform:" + hh.getMessage());
            }

            throw new RuntimeException(e);
        }
    }
View Full Code Here

        localServer.stop();

        Exchange reply = template.request(url, null);
        Exception e = reply.getException();
        assertNotNull("Should have thrown an exception", e);
        HttpHostConnectException cause = assertIsInstanceOf(HttpHostConnectException.class, e);
        assertIsInstanceOf(ConnectException.class, cause.getCause());
    }
View Full Code Here

TOP

Related Classes of org.apache.http.conn.HttpHostConnectException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.