use of io.grpc.testing.protobuf.SimpleRequest in project grpc-java by grpc.
the class LoggingServerProviderTest method unaryRpc.
private static String unaryRpc(String requestMessage, SimpleServiceGrpc.SimpleServiceBlockingStub blockingStub) {
SimpleRequest request = SimpleRequest.newBuilder().setRequestMessage(requestMessage).build();
SimpleResponse response = blockingStub.unaryRpc(request);
return response.getResponseMessage();
}
use of io.grpc.testing.protobuf.SimpleRequest in project grpc-java by grpc.
the class FakeControlPlaneXdsIntegrationTest method pingPong.
@Test
public void pingPong() throws Exception {
String tcpListenerName = SERVER_LISTENER_TEMPLATE_NO_REPLACEMENT;
String serverHostName = "test-server";
controlPlaneService.setXdsConfig(ADS_TYPE_URL_LDS, ImmutableMap.<String, Listener>of(tcpListenerName, serverListener(tcpListenerName), serverHostName, clientListener(serverHostName)));
startServer(defaultBootstrapOverride());
controlPlaneService.setXdsConfig(ADS_TYPE_URL_RDS, ImmutableMap.of(rdsName, rds(serverHostName)));
controlPlaneService.setXdsConfig(ADS_TYPE_URL_CDS, ImmutableMap.<String, Message>of(clusterName, cds()));
InetSocketAddress edsInetSocketAddress = (InetSocketAddress) server.getListenSockets().get(0);
controlPlaneService.setXdsConfig(ADS_TYPE_URL_EDS, ImmutableMap.<String, Message>of(edsName, eds(edsInetSocketAddress.getHostName(), edsInetSocketAddress.getPort())));
ManagedChannel channel = Grpc.newChannelBuilder(scheme + ":///" + serverHostName, InsecureChannelCredentials.create()).build();
blockingStub = SimpleServiceGrpc.newBlockingStub(channel);
SimpleRequest request = SimpleRequest.newBuilder().build();
SimpleResponse goldenResponse = SimpleResponse.newBuilder().setResponseMessage("Hi, xDS!").build();
assertEquals(goldenResponse, blockingStub.unaryRpc(request));
}
use of io.grpc.testing.protobuf.SimpleRequest in project grpc-java by grpc.
the class XdsSdsClientServerTest method unaryRpc.
/**
* Say hello to server.
*/
private static String unaryRpc(String requestMessage, SimpleServiceGrpc.SimpleServiceBlockingStub blockingStub) {
SimpleRequest request = SimpleRequest.newBuilder().setRequestMessage(requestMessage).build();
SimpleResponse response = blockingStub.unaryRpc(request);
return response.getResponseMessage();
}
Aggregations