Search in sources :

Example 1 with SimpleRequest

use of io.grpc.android.integrationtest.nano.Messages.SimpleRequest in project grpc-java by grpc.

the class InteropTester method veryLargeRequest.

public void veryLargeRequest() throws Exception {
    if (shouldSkip()) {
        return;
    }
    final SimpleRequest request = new SimpleRequest();
    request.payload = new Payload();
    request.payload.type = Messages.COMPRESSABLE;
    request.payload.body = new byte[unaryPayloadLength()];
    request.responseSize = 10;
    request.responseType = Messages.COMPRESSABLE;
    final SimpleResponse goldenResponse = new SimpleResponse();
    goldenResponse.payload = new Payload();
    goldenResponse.payload.type = Messages.COMPRESSABLE;
    goldenResponse.payload.body = new byte[10];
    assertMessageEquals(goldenResponse, blockingStub.unaryCall(request));
}
Also used : SimpleResponse(io.grpc.android.integrationtest.nano.Messages.SimpleResponse) Payload(io.grpc.android.integrationtest.nano.Messages.Payload) SimpleRequest(io.grpc.android.integrationtest.nano.Messages.SimpleRequest)

Example 2 with SimpleRequest

use of io.grpc.android.integrationtest.nano.Messages.SimpleRequest in project grpc-java by grpc.

the class InteropTester method veryLargeResponse.

public void veryLargeResponse() throws Exception {
    if (shouldSkip()) {
        return;
    }
    final SimpleRequest request = new SimpleRequest();
    request.responseSize = unaryPayloadLength();
    request.responseType = Messages.COMPRESSABLE;
    SimpleResponse resp = blockingStub.unaryCall(request);
    final SimpleResponse goldenResponse = new SimpleResponse();
    goldenResponse.payload = new Payload();
    goldenResponse.payload.type = Messages.COMPRESSABLE;
    goldenResponse.payload.body = new byte[unaryPayloadLength()];
    assertMessageSizeEquals(goldenResponse, resp);
}
Also used : SimpleResponse(io.grpc.android.integrationtest.nano.Messages.SimpleResponse) Payload(io.grpc.android.integrationtest.nano.Messages.Payload) SimpleRequest(io.grpc.android.integrationtest.nano.Messages.SimpleRequest)

Aggregations

Payload (io.grpc.android.integrationtest.nano.Messages.Payload)2 SimpleRequest (io.grpc.android.integrationtest.nano.Messages.SimpleRequest)2 SimpleResponse (io.grpc.android.integrationtest.nano.Messages.SimpleResponse)2