Search in sources :

Example 1 with InProcessChannelBuilder

use of org.apache.beam.vendor.grpc.v1p43p2.io.grpc.inprocess.InProcessChannelBuilder in project grpc-java by grpc.

the class InProcessTest method createChannelBuilder.

@Override
protected InProcessChannelBuilder createChannelBuilder() {
    InProcessChannelBuilder builder = InProcessChannelBuilder.forName(SERVER_NAME);
    // Disable the default census stats interceptor, use testing interceptor instead.
    InternalInProcessChannelBuilder.setStatsEnabled(builder, false);
    return builder.intercept(createCensusStatsClientInterceptor());
}
Also used : InternalInProcessChannelBuilder(io.grpc.inprocess.InternalInProcessChannelBuilder) InProcessChannelBuilder(io.grpc.inprocess.InProcessChannelBuilder)

Example 2 with InProcessChannelBuilder

use of org.apache.beam.vendor.grpc.v1p43p2.io.grpc.inprocess.InProcessChannelBuilder in project jetcd by coreos.

the class GrpcServerExtension method beforeEach.

/**
 * Before the test has started, create the server and channel.
 */
@Override
public void beforeEach(ExtensionContext context) throws Exception {
    serverName = UUID.randomUUID().toString();
    serviceRegistry = new MutableHandlerRegistry();
    InProcessServerBuilder serverBuilder = InProcessServerBuilder.forName(serverName).fallbackHandlerRegistry(serviceRegistry);
    if (useDirectExecutor) {
        serverBuilder.directExecutor();
    }
    server = serverBuilder.build().start();
    InProcessChannelBuilder channelBuilder = InProcessChannelBuilder.forName(serverName);
    if (useDirectExecutor) {
        channelBuilder.directExecutor();
    }
    channel = channelBuilder.build();
}
Also used : InProcessChannelBuilder(io.grpc.inprocess.InProcessChannelBuilder) MutableHandlerRegistry(io.grpc.util.MutableHandlerRegistry) InProcessServerBuilder(io.grpc.inprocess.InProcessServerBuilder)

Example 3 with InProcessChannelBuilder

use of org.apache.beam.vendor.grpc.v1p43p2.io.grpc.inprocess.InProcessChannelBuilder in project spring_boot by hryou0922.

the class HelloWorldClientTest method setUp.

/**
 * Creates and starts a fake in-process server, and creates a client with an in-process channel.
 */
@Before
public void setUp() throws Exception {
    String uniqueServerName = "fake server for " + getClass();
    fakeServer = InProcessServerBuilder.forName(uniqueServerName).directExecutor().addService(serviceImpl).build().start();
    InProcessChannelBuilder channelBuilder = InProcessChannelBuilder.forName(uniqueServerName).directExecutor();
    client = new HelloWorldClient(channelBuilder);
}
Also used : InProcessChannelBuilder(io.grpc.inprocess.InProcessChannelBuilder) Before(org.junit.Before)

Example 4 with InProcessChannelBuilder

use of org.apache.beam.vendor.grpc.v1p43p2.io.grpc.inprocess.InProcessChannelBuilder in project grpc-java by grpc.

the class GrpcServerRule method before.

/**
 * Before the test has started, create the server and channel.
 */
@Override
protected void before() throws Throwable {
    serverName = UUID.randomUUID().toString();
    serviceRegistry = new MutableHandlerRegistry();
    InProcessServerBuilder serverBuilder = InProcessServerBuilder.forName(serverName).fallbackHandlerRegistry(serviceRegistry);
    if (useDirectExecutor) {
        serverBuilder.directExecutor();
    }
    server = serverBuilder.build().start();
    InProcessChannelBuilder channelBuilder = InProcessChannelBuilder.forName(serverName);
    if (useDirectExecutor) {
        channelBuilder.directExecutor();
    }
    channel = channelBuilder.build();
}
Also used : InProcessChannelBuilder(io.grpc.inprocess.InProcessChannelBuilder) MutableHandlerRegistry(io.grpc.util.MutableHandlerRegistry) InProcessServerBuilder(io.grpc.inprocess.InProcessServerBuilder)

Aggregations

InProcessChannelBuilder (io.grpc.inprocess.InProcessChannelBuilder)4 InProcessServerBuilder (io.grpc.inprocess.InProcessServerBuilder)2 MutableHandlerRegistry (io.grpc.util.MutableHandlerRegistry)2 InternalInProcessChannelBuilder (io.grpc.inprocess.InternalInProcessChannelBuilder)1 Before (org.junit.Before)1