Package org.opensocial.http

Examples of org.opensocial.http.HttpResponseMessage


    request.setContentType("test/content-type");

    String rpcEndPoint = provider.getRpcEndpoint();
    rpcEndPoint = rpcEndPoint.substring(0, rpcEndPoint.length() - 1);

    HttpResponseMessage httpResponseMessage = new HttpResponseMessage("GET",
        new URL(provider.getRpcEndpoint()), 200, stringToInputStream("[]"));

    EasyMock.expect(authScheme.getHttpMessage(eq(provider), eq("POST"),
        eq(rpcEndPoint), isA(Map.class), isA(byte[].class)))
        .andAnswer(new IAnswer<HttpMessage>() {
View Full Code Here


    request.setCustomPayload(payload);

    String rpcEndPoint = provider.getRpcEndpoint();
    rpcEndPoint = rpcEndPoint.substring(0, rpcEndPoint.length() - 1);

    HttpResponseMessage httpResponseMessage = new HttpResponseMessage("GET",
        new URL(provider.getRpcEndpoint()), 200, stringToInputStream("[]"));

    EasyMock.expect(authScheme.getHttpMessage(eq(provider), eq("POST"),
        eq(rpcEndPoint), isA(Map.class), eq(payload))).andReturn(null);
View Full Code Here

    EasyMock.expect(authScheme.getHttpMessage(eq(provider), eq("POST"),
        or(eq(rpcUrl1), eq(rpcUrl2)), isA(Map.class), isA(byte[].class)))
        .andReturn(null);

    HttpResponseMessage httpResponseMessage = new HttpResponseMessage("GET",
        new URL(provider.getRpcEndpoint()), 200, stringToInputStream("[]"));

    EasyMock.expect(httpClient.execute((HttpMessage) eq(null))).andReturn(
        httpResponseMessage);
View Full Code Here

      responses.addLast(response);
    }

    public void addResponse(int statusCode, String response) throws
        IOException {
      addResponse(new HttpResponseMessage("GET", new URL("http://example.org"),
          statusCode, new ByteArrayInputStream(response.getBytes())));
    }
View Full Code Here

    }

    HttpMessage message = authScheme.getHttpMessage(provider, "POST",
        buildRpcUrl(requests), requestHeaders, buildRpcPayload(requests));

    HttpResponseMessage responseMessage = httpClient.execute(message);

    logger.finest(buildLogRecord(requests, responseMessage));

    Map<String, Response> responses = Response.parseRpcResponse(requests,
        responseMessage, provider.getVersion());
View Full Code Here

    HttpMessage message = authScheme.getHttpMessage(provider,
        request.getRestMethod(), buildRestUrl(request), requestHeaders,
        buildRestPayload(request));

    HttpResponseMessage responseMessage = httpClient.execute(message);

    logger.finest(buildLogRecord(request, responseMessage));

    Response response = Response.parseRestResponse(request, responseMessage,
        provider.getVersion());
View Full Code Here

    String body = "[]";
    InputStream is = new ByteArrayInputStream(body.getBytes());

    expect(httpClient.execute(null)).andReturn(
        new HttpResponseMessage("POST", new URL(url), 200, is));

    mockControl.replay();

    request.setFieldsParameter(new String[] {"field1", "field2"});
    client.send(request);
View Full Code Here

TOP

Related Classes of org.opensocial.http.HttpResponseMessage

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.