Examples of receiveProtoMessage()


Examples of com.googlecode.protobuf.socketrpc.RpcConnectionFactory.Connection.receiveProtoMessage()

    Request.Builder builder = Request.newBuilder();
    connection1.receiveProtoMessage(builder);
    assertEquals(request1, builder.build());

    builder = Request.newBuilder();
    connection2.receiveProtoMessage(builder);
    assertEquals(request2, builder.build());

    Response response1 = createResponse(1);
    connection1.sendProtoMessage(response1);
View Full Code Here

Examples of com.googlecode.protobuf.socketrpc.RpcConnectionFactory.Connection.receiveProtoMessage()

    connection.sendProtoMessage(MESSAGE);
    ByteArrayInputStream is = new ByteArrayInputStream(socket.getOutputBytes());
    assertEquals(MESSAGE, Request.parseDelimitedFrom(is));

    Builder builder = Request.newBuilder();
    connection.receiveProtoMessage(builder);
    assertEquals(MESSAGE, builder.build());
  }

  public void testConnectionInputOutput() throws IOException {
    FakeSocket socket = new FakeSocket(true);
View Full Code Here

Examples of com.googlecode.protobuf.socketrpc.RpcConnectionFactory.Connection.receiveProtoMessage()

    MESSAGE.writeDelimitedTo(os);
    socket.withInputBytes(os.toByteArray());
    Connection connection = connectionForSocket(socket);

    Builder builder = Request.newBuilder();
    connection.receiveProtoMessage(builder);
    assertEquals(MESSAGE, builder.build());

    connection.sendProtoMessage(MESSAGE);
    ByteArrayInputStream is = new ByteArrayInputStream(socket.getOutputBytes());
    assertEquals(MESSAGE, Request.parseDelimitedFrom(is));
View Full Code Here

Examples of com.googlecode.protobuf.socketrpc.RpcConnectionFactory.Connection.receiveProtoMessage()

    connection.sendProtoMessage(MESSAGE1);
    ByteArrayInputStream is = new ByteArrayInputStream(socket.getOutputBytes());
    assertEquals(MESSAGE1, readFromInputStream(is, isDelimited));

    Builder builder = Request.newBuilder();
    connection.receiveProtoMessage(builder);
    assertEquals(MESSAGE1, builder.build());
  }

  public void testConnectionInputOutput_delimited() throws IOException {
    doTestInputOutput(delimited, true);
View Full Code Here

Examples of com.googlecode.protobuf.socketrpc.RpcConnectionFactory.Connection.receiveProtoMessage()

    writeToOutputStream(MESSAGE1, os, isDelimited);
    socket.withInputBytes(os.toByteArray());

    Connection connection = new SocketConnection(socket, isDelimited);
    Builder builder = Request.newBuilder();
    connection.receiveProtoMessage(builder);
    assertEquals(MESSAGE1, builder.build());

    connection.sendProtoMessage(MESSAGE1);
    ByteArrayInputStream is = new ByteArrayInputStream(socket.getOutputBytes());
    assertEquals(MESSAGE1, readFromInputStream(is, isDelimited));
View Full Code Here

Examples of com.googlecode.protobuf.socketrpc.RpcConnectionFactory.Connection.receiveProtoMessage()

    // Send and receive first
    Connection connection = new SocketConnection(delimited, true);
    connection.sendProtoMessage(MESSAGE2);
    Builder builder = Request.newBuilder();
    connection.receiveProtoMessage(builder);
    assertEquals(MESSAGE1, builder.build());

    // Receive and send second
    builder = Request.newBuilder();
    connection.receiveProtoMessage(builder);
View Full Code Here

Examples of com.googlecode.protobuf.socketrpc.RpcConnectionFactory.Connection.receiveProtoMessage()

    connection.receiveProtoMessage(builder);
    assertEquals(MESSAGE1, builder.build());

    // Receive and send second
    builder = Request.newBuilder();
    connection.receiveProtoMessage(builder);
    assertEquals(MESSAGE2, builder.build());
    connection.sendProtoMessage(MESSAGE1);

    // Send and receive third
    connection.sendProtoMessage(MESSAGE2);
View Full Code Here

Examples of com.googlecode.protobuf.socketrpc.RpcConnectionFactory.Connection.receiveProtoMessage()

    connection.sendProtoMessage(MESSAGE1);

    // Send and receive third
    connection.sendProtoMessage(MESSAGE2);
    builder = Request.newBuilder();
    connection.receiveProtoMessage(builder);
    assertEquals(MESSAGE1, builder.build());

    // Get 3 messages from output
    ByteArrayInputStream is = new ByteArrayInputStream(
        delimited.getOutputBytes());
View Full Code Here

Examples of com.googlecode.protobuf.socketrpc.RpcConnectionFactory.Connection.receiveProtoMessage()

      throws IOException {
    // Send and receive first
    Connection persistent = persistentFactory.createConnection();
    persistent.sendProtoMessage(MESSAGE2);
    Builder builder = Request.newBuilder();
    persistent.receiveProtoMessage(builder);
    assertEquals(MESSAGE1, builder.build());
    persistent.close();

    // Receive and send second
    persistent = persistentFactory.createConnection();
View Full Code Here

Examples of com.googlecode.protobuf.socketrpc.RpcConnectionFactory.Connection.receiveProtoMessage()

    persistent.close();

    // Receive and send second
    persistent = persistentFactory.createConnection();
    builder = Request.newBuilder();
    persistent.receiveProtoMessage(builder);
    assertEquals(MESSAGE2, builder.build());
    persistent.sendProtoMessage(MESSAGE1);
    persistent.close();

    // Send and receive third
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.