Package org.mokai.connector.http

Examples of org.mokai.connector.http.HttpConnector.process()


    HttpConfiguration configuration = new HttpConfiguration();
    configuration.setUrl("http://" + getHost() + ":" + getPort() + "/");

    HttpConnector connector = new HttpConnector(configuration);
    connector.process(new Message());
  }

  @Test(expectedExceptions=IllegalArgumentException.class)
  public void shouldFailNoUrlSpecified() throws Exception {
    MockRequestHandler mockHandler = new MockRequestHandler(HttpStatus.SC_NOT_FOUND);
View Full Code Here


  public void shouldFailNoUrlSpecified() throws Exception {
    MockRequestHandler mockHandler = new MockRequestHandler(HttpStatus.SC_NOT_FOUND);
    testServer.register("/", mockHandler);

    HttpConnector connector = new HttpConnector();
    connector.process(new Message());
  }

  @Test
  public void testDontThrowExceptionOnFailure() throws Exception {
    MockRequestHandler mockHandler = new MockRequestHandler(HttpStatus.SC_NOT_FOUND);
View Full Code Here

    HttpConfiguration configuration = new HttpConfiguration();
    configuration.setUrl("http://" + getHost() + ":" + getPort() + "/");
    configuration.setThrowExceptionOnFailure(false);

    HttpConnector connector = new HttpConnector(configuration);
    connector.process(new Message());
  }

  @Test(expectedExceptions=SocketTimeoutException.class)
  public void sholdThrowSocketTimeoutException() throws Exception {
    testServer.register("/", new HttpRequestHandler() {
View Full Code Here

    configuration.setUrl("http://" + getHost() + ":" + getPort() + "/");
    configuration.setThrowExceptionOnFailure(false);
    configuration.setSocketTimeout(3000);

    HttpConnector connector = new HttpConnector(configuration);
    connector.process(new Message());
  }

  @Test(expectedExceptions=ConnectTimeoutException.class)
  public void shoudlThrowConnectionTimeoutException() throws Exception {
View Full Code Here

    configuration.setUrl("http://www.google.com:81/");
    configuration.setThrowExceptionOnFailure(false);
    configuration.setConnectionTimeout(3000);

    HttpConnector connector = new HttpConnector(configuration);
    connector.process(new Message());
  }

  private String getHost() {
    return testServer.getServiceHostName();
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.