Package com.linkedin.r2.message.rpc

Examples of com.linkedin.r2.message.rpc.RpcRequestBuilder


  @Test
  @SuppressWarnings("deprecation")
  public void testRpcReqWithEntity() throws IOException
  {
    final RpcRequest expected = new RpcRequestBuilder(URI.create("http://localhost:1234"))
            .setEntity(ByteString.copyString("This is a simple entity!", "ASCII"))
            .build();
    assertMsgEquals(expected, _serializer.readRpcRequest(getResource("rpc-req-with-entity.txt")));
  }
View Full Code Here


  }

  @SuppressWarnings("deprecation")
  private RpcRequest createRpcRequest()
  {
    return new RpcRequestBuilder(URI.create("http://linkedin.com")).build();
  }
View Full Code Here

  }

  @SuppressWarnings("deprecation")
  private void fireRpcRequest(FilterChain fc)
  {
    fc.onRpcRequest(new RpcRequestBuilder(URI.create("test")).build(),
                    createRequestContext(), createWireAttributes()
    );
  }
View Full Code Here

{
  @Test
  @SuppressWarnings("deprecation")
  public void testChainBuildRpcRequestFromRpcRequestBuilder()
  {
    final RpcRequest req = new RpcRequestBuilder(URI.create("test"))
            .setEntity(new byte[] {1,2,3,4})
            .build()
            .builder()
              .setEntity(new byte[] {5,6,7,8})
              .setURI(URI.create("anotherURI"))
View Full Code Here

  @Test
  @SuppressWarnings("deprecation")
  public void testChainBuildRpcRequestFromRequestBuilder()
  {
    final Request req = new RpcRequestBuilder(URI.create("test"))
            .setEntity(new byte[] {1,2,3,4})
            .build()
            .requestBuilder()
              .setEntity(new byte[] {5,6,7,8})
              .setURI(URI.create("anotherURI"))
View Full Code Here

  @Test
  @SuppressWarnings("deprecation")
  public void testChainBuildRpcRequestFromRpcBuilder()
  {
    final RpcMessage req = new RpcRequestBuilder(URI.create("test"))
            .setEntity(new byte[] {1,2,3,4})
            .build()
            .rpcBuilder()
              .setEntity(new byte[] {5,6,7,8})
              .build();
View Full Code Here

  @Test
  @SuppressWarnings("deprecation")
  public void testChainBuildRpcRequestFromMessageBuilder()
  {
    final MessageBuilder<?> builder = new RpcRequestBuilder(URI.create("test"))
            .setEntity(new byte[] {1,2,3,4})
            .build()
            .builder();
    final Message req = builder
            .setEntity(new byte[] {5,6,7,8})
View Full Code Here

  }

  @SuppressWarnings("deprecation")
  public static RpcRequest simpleRpcRequest()
  {
    return new RpcRequestBuilder(URI.create("simple_uri"))
            .build();
  }
View Full Code Here

      String service = _services[index];
      URI uri = URI.create("d2://" + service);

      RpcRequest req =
          new RpcRequestBuilder(uri).setEntity("hi there".getBytes("UTF-8")).build();

      try
      {
        Future<RpcResponse> response = client.rpcRequest(req);
        String responseString = response.get().getEntity().asString("UTF-8");
View Full Code Here

   */
  @Deprecated
  @SuppressWarnings("deprecation")
  public static RpcRequest toRpcRequest(RestRequest req)
  {
    return new RpcRequestBuilder(req.getURI())
            .setEntity(req.getEntity())
            .build();
  }
View Full Code Here

TOP

Related Classes of com.linkedin.r2.message.rpc.RpcRequestBuilder

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.