Examples of ResponseParser


Examples of com.cumulocity.sdk.client.ResponseParser

    private RestConnector restConnector;

    @Before
    public void setUp() throws Exception {
        deviceCredentialsResource = (DeviceCredentialsApiImpl) bootstrapPlatform.getDeviceCredentialsApi();
        responseParser = new ResponseParser();
        restConnector = new RestConnector(platform, responseParser);
    }
View Full Code Here

Examples of com.google.code.http4j.impl.ResponseParser

 
  @BeforeClass
  public void beforeClass() {
    manager = new ConnectionPool();
    cookieCache = new CookieStoreAdapter();
    parser = new ResponseParser();
    executor = new BasicRequestExecutor(manager, cookieCache, parser);
  }
View Full Code Here

Examples of com.google.code.http4j.impl.ResponseParser

 
  private byte[] noEntity;
 
  @BeforeClass
  public void beforeClass() {
    parser = new ResponseParser();
    identity = "HTTP/1.1 200 OK\r\nContent-Type:text/html; charset=UTF-8\r\nContent-Length:12\r\n\r\nHello World!".getBytes();
    chunked = "HTTP/1.1 200 OK\r\nContent-Type:text/html; charset=GBK\r\nTransfer-Encoding:chunked\r\n\r\n19\r\nHello World!-from http4j.\r\n1f\r\nauthor:guilin.zhang@hotmail.com\r\n0\r\n\r\n".getBytes();
    chunkedWithTrailers = "HTTP/1.1 200 OK\r\nContent-Type:text/html; charset=GBK\r\nTransfer-Encoding:chunked\r\n\r\n19\r\nHello World!-from http4j.\r\n1f\r\nauthor:guilin.zhang@hotmail.com\r\n0\r\nConnection:Keep-Alive\r\n".getBytes();
    noEntity = "HTTP/1.0 304 Not Modified\r\nContent-Type:text/html; charset=UTF-8\r\nContent-Length:12\r\n\r\n".getBytes();
  }
View Full Code Here

Examples of com.twilio.sdk.parser.ResponseParser

   *
   * @return a normalized Map of objects. Repeated elements are List values,
   *         sub-objects are Map values. All other types are String values.
   */
  public Map<String, Object> toMap() {
    ResponseParser parser = this.getParser();
    return parser.parse(this);
  }
View Full Code Here

Examples of fitnesse.http.ResponseParser

  private Thread makeParsingThread() {
    Thread parseResponseThread = new Thread(new Runnable() {
      public void run() {
        try {
          response = new ResponseParser(clientInput);
        }
        catch (Exception e) {
          e.printStackTrace();
        }
      }
View Full Code Here

Examples of fitnesse.http.ResponseParser

  @Test
  public void testBadServer() throws Exception {
    try {
      shutdown.hostname = "http://google.com";
      ResponseParser response = shutdown.buildAndSendRequest();
      String status = shutdown.checkResponse(response);
      assertEquals("Not a FitNesse server", status);
    }
    catch (Exception e) {
    }
View Full Code Here

Examples of fitnesse.http.ResponseParser

  private void run(String[] args) throws Exception {
    if (!parseArgs(args))
      usage();

    ResponseParser response = buildAndSendRequest();

    String status = checkResponse(response);
    if (!"OK".equals(status)) {
      LOG.warning("Failed to shutdown. Status = " + status);
      System.exit(response.getStatus());
    }
  }
View Full Code Here

Examples of fitnesse.http.ResponseParser

    }
  }

  public ResponseParser buildAndSendRequest() throws IOException {
    RequestBuilder request = buildRequest();
    ResponseParser response = ResponseParser.performHttpRequest(hostname, port, request);
    return response;
  }
View Full Code Here

Examples of fitnesse.http.ResponseParser

    builder.addInput("type", documentType);
    builder.setHostAndPort(remoteHostname, remotePort);
    if (remoteUsername != null)
      builder.addCredentials(remoteUsername, remotePassword);

    ResponseParser parser = ResponseParser.performHttpRequest(remoteHostname, remotePort, builder);

    if (parser.getStatus() == 404)
      throw new IOException("The remote resource, " + remoteUrl() + ", was not found.");
    if (parser.getStatus() == 401)
      throw new AuthenticationRequiredException(remoteUrl());

    String body = parser.getBody();
    return XmlUtil.newDocument(body);
  }
View Full Code Here

Examples of mireka.transmission.immediate.ResponseParser

    @Test
    public void testCreateResponseLookingForEnhancedStatusCode_original() {
        Response srcResponse = new Response(500, ENHANCED_EXAMPLE);
        MailSystemStatus basicResponse =
                new ResponseParser()
                        .createResponseLookingForEnhancedStatusCode(srcResponse);
        assertThat(basicResponse, instanceOf(EnhancedStatus.class));
        EnhancedStatus enhancedResponse = (EnhancedStatus) basicResponse;
        assertEquals("5.7.1", enhancedResponse.getEnhancedStatusCode());
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.