Search in sources :

Example 6 with InProcessServerBuilder

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

the class InProcessTest method getServerBuilder.

@Override
protected ServerBuilder<?> getServerBuilder() {
    // Starts the in-process server.
    InProcessServerBuilder builder = InProcessServerBuilder.forName(SERVER_NAME);
    // Disable the default census stats tracer, use testing tracer instead.
    InternalInProcessServerBuilder.setStatsEnabled(builder, false);
    return builder.addStreamTracerFactory(createCustomCensusTracerFactory());
}
Also used : InternalInProcessServerBuilder(io.grpc.inprocess.InternalInProcessServerBuilder) InProcessServerBuilder(io.grpc.inprocess.InProcessServerBuilder)

Example 7 with InProcessServerBuilder

use of org.apache.beam.vendor.grpc.v1p43p2.io.grpc.inprocess.InProcessServerBuilder 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

InProcessServerBuilder (io.grpc.inprocess.InProcessServerBuilder)5 InProcessChannelBuilder (io.grpc.inprocess.InProcessChannelBuilder)2 MutableHandlerRegistry (io.grpc.util.MutableHandlerRegistry)2 InProcessServerBuilder (org.apache.beam.vendor.grpc.v1p43p2.io.grpc.inprocess.InProcessServerBuilder)2 Before (org.junit.Before)2 InternalInProcessServerBuilder (io.grpc.inprocess.InternalInProcessServerBuilder)1