Package com.google.protobuf.MessageLite

Examples of com.google.protobuf.MessageLite.Builder


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

    // 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);
    builder = Request.newBuilder();
    persistent.receiveProtoMessage(builder);
    assertEquals(MESSAGE1, builder.build());
    persistent.close();

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


  private void receiveRequest(final Connection connection) {
    new Thread(new Runnable() {
      @Override
      public void run() {
        Builder builder = Request.newBuilder();
        try {
          connection.receiveProtoMessage(builder);
          connection.sendProtoMessage(MESSAGE2);
        } catch (IOException e) {
          failed.set(true);
          throw new RuntimeException(e);
        }
        assertEquals(MESSAGE1, builder.build());
      }
    }).start();
  }
View Full Code Here

            f._convertor = this;
    }

    public Builder parseFrom(JsonParser parser) throws IOException
    {       
        Builder builder = _model.getModelMeta().getPrototype().newBuilderForType();
        mergeFrom(parser, builder);       
        return builder;
    }
View Full Code Here

TOP

Related Classes of com.google.protobuf.MessageLite.Builder

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.