Search in sources :

Example 1 with FakeServiceImpl

use of com.google.api.gax.grpc.testing.FakeServiceImpl in project gax-java by googleapis.

the class GrpcDirectServerStreamingCallableTest method setUp.

@Before
public void setUp() throws InstantiationException, IllegalAccessException, IOException {
    String serverName = "fakeservice";
    FakeServiceImpl serviceImpl = new FakeServiceImpl();
    inprocessServer = new InProcessServer<>(serviceImpl, serverName);
    inprocessServer.start();
    channel = InProcessChannelBuilder.forName(serverName).directExecutor().usePlaintext().build();
    clientContext = ClientContext.newBuilder().setTransportChannel(GrpcTransportChannel.create(channel)).setDefaultCallContext(GrpcCallContext.of(channel, CallOptions.DEFAULT)).build();
    streamingCallSettings = ServerStreamingCallSettings.<Color, Money>newBuilder().build();
    streamingCallable = GrpcCallableFactory.createServerStreamingCallable(GrpcCallSettings.create(METHOD_SERVER_STREAMING_RECOGNIZE), streamingCallSettings, clientContext);
}
Also used : Money(com.google.type.Money) FakeServiceImpl(com.google.api.gax.grpc.testing.FakeServiceImpl) Color(com.google.type.Color) Before(org.junit.Before)

Example 2 with FakeServiceImpl

use of com.google.api.gax.grpc.testing.FakeServiceImpl in project gax-java by googleapis.

the class GrpcDirectStreamingCallableTest method setUp.

@Before
public void setUp() throws InstantiationException, IllegalAccessException, IOException {
    String serverName = "fakeservice";
    serviceImpl = new FakeServiceImpl();
    inprocessServer = new InProcessServer<>(serviceImpl, serverName);
    inprocessServer.start();
    channel = InProcessChannelBuilder.forName(serverName).directExecutor().usePlaintext().build();
    clientContext = ClientContext.newBuilder().setTransportChannel(GrpcTransportChannel.create(channel)).setDefaultCallContext(GrpcCallContext.of(channel, CallOptions.DEFAULT)).build();
}
Also used : FakeServiceImpl(com.google.api.gax.grpc.testing.FakeServiceImpl) Before(org.junit.Before)

Example 3 with FakeServiceImpl

use of com.google.api.gax.grpc.testing.FakeServiceImpl in project gax-java by googleapis.

the class GrpcCallableFactoryTest method setUp.

@Before
public void setUp() throws Exception {
    String serverName = "fakeservice";
    FakeServiceImpl serviceImpl = new FakeServiceImpl();
    inprocessServer = new InProcessServer<>(serviceImpl, serverName);
    inprocessServer.start();
    channel = InProcessChannelBuilder.forName(serverName).directExecutor().usePlaintext().build();
    clientContext = ClientContext.newBuilder().setTransportChannel(GrpcTransportChannel.create(channel)).setDefaultCallContext(GrpcCallContext.of(channel, CallOptions.DEFAULT)).build();
}
Also used : FakeServiceImpl(com.google.api.gax.grpc.testing.FakeServiceImpl) Before(org.junit.Before)

Aggregations

FakeServiceImpl (com.google.api.gax.grpc.testing.FakeServiceImpl)3 Before (org.junit.Before)3 Color (com.google.type.Color)1 Money (com.google.type.Money)1