Package org.apache.shindig.protocol

Examples of org.apache.shindig.protocol.RpcHandler.execute()


    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("{ headers : {}, status : 200, content : 'CONTENT' }}",
        converter.convertToString(httpApiResponse));
View Full Code Here


    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("{ headers : {}, status : 200, content : 'CONTENT', token : updated }}",
        converter.convertToString(httpApiResponse));
View Full Code Here

    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();
  }

  @Test
  public void testOAuthRequestWithParameters() throws Exception {
View Full Code Here

    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

    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();
  }

  @Test
  public void testSignedGetRequestNoSecurityToken() throws Exception {
View Full Code Here

    expect(pipeline.execute(eqRequest(httpRequest))).andReturn(builder.create()).anyTimes();
    replay();
    RpcHandler operation = registry.getRpcHandler(request);

    try {
      operation.execute(emptyFormItems, null, converter).get();
      fail("Cannot execute a request without a security token");
    } catch (ExecutionException ee) {
      assertTrue(ee.getCause() instanceof ProtocolException);
    }
    verify();
View Full Code Here

    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("{ headers : {}, status : 500, content : 'I AM AN ERROR MESSAGE' }}",
        converter.convertToString(httpApiResponse));
  }
View Full Code Here

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

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

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

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

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

    JsonAssert.assertJsonEquals(
        "{ headers : { 'set-cookie' : ['foo=bar; Secure','name=value'] },"
            + " status : 200, content : 'CONTENT' }",
View Full Code Here

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

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

    JsonAssert.assertJsonEquals("{ headers : { 'location' : ['here'] },"
            + " status : 200, content : 'CONTENT' }",
        converter.convertToString(httpApiResponse));
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.