@Before public void setUp() throws Exception { server = new InProcessServer<>(new BigtableGrpc.BigtableImplBase() {}, NAME); server.start(); channelProvider = LocalChannelProvider.create(NAME); BigtableDataSettings.Builder settings = BigtableDataSettings.newBuilder() .setProjectId(PROJECT_ID) .setInstanceId(INSTANCE_ID) .setTransportChannelProvider(channelProvider) .setCredentialsProvider(NoCredentialsProvider.create()); // Force immediate flush settings .bulkMutationsSettings() .setBatchingSettings( settings .bulkMutationsSettings() .getBatchingSettings() .toBuilder() .setElementCountThreshold(1L) .build()); client = BigtableDataClient.create(settings.build()); }
@After public void tearDown() throws Exception { client.close(); server.stop(); server.blockUntilShutdown(); }
@Override public void run() { InProcessServer.this.stop(); } });
@After public void tearDown() { channel.shutdown(); inprocessServer.stop(); }
@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(); }
@After public void tearDown() { channel.shutdown(); inprocessServer.stop(); }
@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(); }
@After public void tearDown() { channel.shutdown(); inprocessServer.stop(); }
requestHeaders = null; inprocessServer = new InProcessServer<>( serviceImpl, serverName, inprocessServer.start();
@After public void tearDown() { channel.shutdown(); inprocessServer.stop(); }
@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); }