Examples of sendProtoMessage()


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

    Response response1 = createResponse(1);
    connection1.sendProtoMessage(response1);

    Response response2 = createResponse(2);
    connection2.sendProtoMessage(response2);

    assertEquals(response1, socket1.getResponse());
    assertEquals(response2, socket2.getResponse());
  }
View Full Code Here

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

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

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

    Builder builder = Request.newBuilder();
    connection.receiveProtoMessage(builder);
View Full Code Here

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

    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.sendProtoMessage()

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

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

    Builder builder = Request.newBuilder();
    connection.receiveProtoMessage(builder);
View Full Code Here

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

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

  public void testDoMultiple() throws IOException {
View Full Code Here

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

    writeToOutputStream(MESSAGE1, os, true);
    delimited.withInputBytes(os.toByteArray());

    // 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
View Full Code Here

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

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

    // Send and receive third
    connection.sendProtoMessage(MESSAGE2);
    builder = Request.newBuilder();
    connection.receiveProtoMessage(builder);
View Full Code Here

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

    connection.receiveProtoMessage(builder);
    assertEquals(MESSAGE2, builder.build());
    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
View Full Code Here

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

  public Connection doTestFactoryTest(RpcConnectionFactory persistentFactory)
      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();
View Full Code Here

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

    // 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
    persistent = persistentFactory.createConnection();
    persistent.sendProtoMessage(MESSAGE2);
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.