InstantiatingGrpcChannelProvider implements TransportChannelProvider { public static Builder newBuilder() { return new Builder(); } private  InstantiatingGrpcChannelProvider(Builder builder); @Override boolean needsExecutor(); @Deprecated @Override TransportChannelProvider withExecutor(ScheduledExecutorService executor); @Override TransportChannelProvider withExecutor(Executor executor); @Override @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") boolean needsHeaders(); @Override @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") TransportChannelProvider withHeaders(Map<String, String> headers); @Override String getTransportName(); @Override boolean needsEndpoint(); @Override TransportChannelProvider withEndpoint(String endpoint); @Override @BetaApi("The surface for customizing pool size is not stable yet and may change in the future.") boolean acceptsPoolSize(); @Override @BetaApi("The surface for customizing pool size is not stable yet and may change in the future.") TransportChannelProvider withPoolSize(int size); @Override boolean needsCredentials(); @Override TransportChannelProvider withCredentials(Credentials credentials); @Override TransportChannel getTransportChannel(); String getEndpoint(); Duration getKeepAliveTime(); Duration getKeepAliveTimeout(); Boolean getKeepAliveWithoutCalls(); @BetaApi("The surface for maximum metadata size is not stable yet and may change in the future.") Integer getMaxInboundMetadataSize(); @Override boolean shouldAutoClose(); Builder toBuilder(); static Builder newBuilder();  }
@Test(expected = IllegalArgumentException.class) public void testEndpointNoPort() { InstantiatingGrpcChannelProvider.newBuilder().setEndpoint("localhost"); }
@Test(expected = IllegalArgumentException.class) public void testEndpointBadPort() { InstantiatingGrpcChannelProvider.newBuilder().setEndpoint("localhost:abcd"); }
@Test public void testCpuPoolSize() { Builder builder = InstantiatingGrpcChannelProvider.newBuilder().setProcessorCount(2); builder.setChannelsPerCpu(2.5); assertEquals(5, builder.getPoolSize()); builder = builder.setProcessorCount(50); builder.setChannelsPerCpu(100, 10); assertEquals(10, builder.getPoolSize()); builder.setChannelsPerCpu(200); assertEquals(100, builder.getPoolSize()); }