Examples of RpcHandler


Examples of org.apache.shindig.protocol.RpcHandler

    httpRequest.setMethod("POST");
    httpRequest.setPostBody("POSTBODY".getBytes());
    expect(pipeline.execute(eqRequest(httpRequest))).andReturn(builder.create()).anyTimes();

    replay();
    RpcHandler operation = registry.getRpcHandler(request);

    HttpRequestHandler.HttpApiResponse httpApiResponse =
        (HttpRequestHandler.HttpApiResponse)operation.execute(emptyFormItems, token, converter).get();
    verify();

    JsonAssert.assertJsonEquals(converter.convertToString(httpApiResponse),
        "{ headers : {}, status : 200, content : 'CONTENT' }}");
  }
View Full Code Here

Examples of org.apache.shindig.protocol.RpcHandler

    httpRequest.setHeader("goodheader", "good");
    httpRequest.setHeader("Content-Length", "1000");
    expect(pipeline.execute(eqRequest(httpRequest))).andReturn(builder.create()).anyTimes();

    replay();
    RpcHandler operation = registry.getRpcHandler(request);

    HttpRequestHandler.HttpApiResponse httpApiResponse =
        (HttpRequestHandler.HttpApiResponse)operation.execute(emptyFormItems, token, converter).get();
    verify();

    JsonAssert.assertJsonEquals(converter.convertToString(httpApiResponse),
        "{ headers : {}, status : 200, content : 'CONTENT' }}");
  }
View Full Code Here

Examples of org.apache.shindig.protocol.RpcHandler

    expect(pipeline.execute(eqRequest(httpRequest))).andReturn(builder.create()).anyTimes();

    replay();

    RpcHandler operation = registry.getRpcHandler(request);

    HttpRequestHandler.HttpApiResponse httpApiResponse =
        (HttpRequestHandler.HttpApiResponse)operation.execute(emptyFormItems, token, converter).get();
    verify();

    JSONObject feed = (JSONObject) httpApiResponse.getContent();
      JSONObject entry = feed.getJSONArray("Entry").getJSONObject(0);
View Full Code Here

Examples of org.apache.shindig.protocol.RpcHandler

    httpRequest.setMethod("GET");

    expect(pipeline.execute(eqRequest(httpRequest))).andReturn(builder.create()).anyTimes();

    replay();
    RpcHandler operation = registry.getRpcHandler(request);

    HttpRequestHandler.HttpApiResponse httpApiResponse =
        (HttpRequestHandler.HttpApiResponse)operation.execute(emptyFormItems, token, converter).get();
    verify();

    JSONObject feed = (JSONObject) httpApiResponse.getContent();
    JSONArray feeds = feed.getJSONArray("Entry");
View Full Code Here

Examples of org.apache.shindig.protocol.RpcHandler

    httpRequest.setMethod("GET");
    builder.setResponseString("{key:1}");
    expect(pipeline.execute(eqRequest(httpRequest))).andReturn(builder.create()).anyTimes();

    replay();
    RpcHandler operation = registry.getRpcHandler(request);

    HttpRequestHandler.HttpApiResponse httpApiResponse =
        (HttpRequestHandler.HttpApiResponse)operation.execute(emptyFormItems, token, converter).get();
    verify();

    JsonAssert.assertJsonEquals(converter.convertToString(httpApiResponse),
        "{ headers : {}, status : 200, content : {key: 1}}}");
  }
View Full Code Here

Examples of org.apache.shindig.protocol.RpcHandler

    httpRequest.setAuthType(AuthType.SIGNED);
    httpRequest.setOAuthArguments(
        new OAuthArguments(AuthType.SIGNED, ImmutableMap.<String, String>of()));
    expect(pipeline.execute(eqRequest(httpRequest))).andReturn(builder.create()).anyTimes();
    replay();
    RpcHandler operation = registry.getRpcHandler(request);

    HttpRequestHandler.HttpApiResponse httpApiResponse =
        (HttpRequestHandler.HttpApiResponse)operation.execute(emptyFormItems, token, converter).get();
    verify();

    JsonAssert.assertJsonEquals(converter.convertToString(httpApiResponse),
        "{ headers : {}, status : 200, content : 'CONTENT' }}");
View Full Code Here

Examples of org.apache.shindig.protocol.RpcHandler

    httpRequest.setOAuthArguments(
        new OAuthArguments(AuthType.SIGNED, ImmutableMap.<String, String>of()));
    httpRequest.setPostBody("POSTBODY".getBytes());
    expect(pipeline.execute(eqRequest(httpRequest))).andReturn(builder.create()).anyTimes();
    replay();
    RpcHandler operation = registry.getRpcHandler(request);

    HttpRequestHandler.HttpApiResponse httpApiResponse =
        (HttpRequestHandler.HttpApiResponse)operation.execute(emptyFormItems, token, converter).get();
    verify();

    JsonAssert.assertJsonEquals(converter.convertToString(httpApiResponse),
        "{ headers : {}, status : 200, content : 'CONTENT', token : updated }}");
View Full Code Here

Examples of org.apache.shindig.protocol.RpcHandler

    httpRequest.setOAuthArguments(
        new OAuthArguments(AuthType.OAUTH, ImmutableMap.<String, String>of()));
    httpRequest.setPostBody("POSTBODY".getBytes());
    expect(pipeline.execute(eqRequest(httpRequest))).andReturn(builder.create()).anyTimes();
    replay();
    RpcHandler operation = registry.getRpcHandler(request);

    operation.execute(emptyFormItems, token, converter).get();
    verify();
  }
View Full Code Here

Examples of org.apache.shindig.protocol.RpcHandler

    httpRequest.setPostBody("POSTBODY".getBytes());
   
    Capture<HttpRequest> requestCapture = new Capture<HttpRequest>();
    expect(pipeline.execute(capture(requestCapture))).andReturn(builder.create());
    replay();
    RpcHandler operation = registry.getRpcHandler(request);

    operation.execute(emptyFormItems, token, converter).get();
    verify();
   
    assertEquals(httpRequest.getOAuthArguments(),
        requestCapture.getValue().getOAuthArguments());
  }
View Full Code Here

Examples of org.apache.shindig.protocol.RpcHandler

    httpRequest.setMethod("POST");
    httpRequest.setAuthType(AuthType.NONE);
    httpRequest.setPostBody("POSTBODY".getBytes());
    expect(pipeline.execute(eqRequest(httpRequest))).andReturn(builder.create()).anyTimes();
    replay();
    RpcHandler operation = registry.getRpcHandler(request);

    operation.execute(emptyFormItems, token, converter).get();
    verify();
  }
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.