• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2015 The gRPC Authors
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package io.grpc.testing.integration;
18 
19 import io.grpc.ManagedChannel;
20 import io.grpc.inprocess.InProcessChannelBuilder;
21 import io.grpc.inprocess.InProcessServerBuilder;
22 import io.grpc.internal.AbstractServerImplBuilder;
23 import org.junit.runner.RunWith;
24 import org.junit.runners.JUnit4;
25 
26 /** Unit tests for {@link io.grpc.inprocess}. */
27 @RunWith(JUnit4.class)
28 public class InProcessTest extends AbstractInteropTest {
29 
30   private static final String SERVER_NAME = "test";
31 
32   @Override
getServerBuilder()33   protected AbstractServerImplBuilder<?> getServerBuilder() {
34     // Starts the in-process server.
35     return InProcessServerBuilder.forName(SERVER_NAME);
36   }
37 
38   @Override
createChannel()39   protected ManagedChannel createChannel() {
40     InProcessChannelBuilder builder = InProcessChannelBuilder.forName(SERVER_NAME);
41     io.grpc.internal.TestingAccessor.setStatsImplementation(
42         builder, createClientCensusStatsModule());
43     return builder.build();
44   }
45 
46   @Override
metricsExpected()47   protected boolean metricsExpected() {
48     // TODO(zhangkun83): InProcessTransport by-passes framer and deframer, thus message sizes are
49     // not counted. (https://github.com/grpc/grpc-java/issues/2284)
50     return false;
51   }
52 
53   @Override
maxInboundSize_tooBig()54   public void maxInboundSize_tooBig() {
55     // noop, not enforced.
56   }
57 
58   @Override
maxOutboundSize_tooBig()59   public void maxOutboundSize_tooBig() {
60     // noop, not enforced.
61   }
62 }
63