@Test public void fileContainingExtension() throws Exception { ServerReflectionRequest request = ServerReflectionRequest.newBuilder() .setHost(TEST_HOST) .setFileContainingExtension( ExtensionRequest.newBuilder() .setContainingType("grpc.reflection.testing.ThirdLevelType") .setExtensionNumber(100) .build()) .build(); List<ByteString> goldenResponse = Arrays.asList( ReflectionTestProto.getDescriptor().toProto().toByteString(), ReflectionTestDepthTwoProto.getDescriptor().toProto().toByteString(), ReflectionTestDepthTwoAlternateProto.getDescriptor().toProto().toByteString(), ReflectionTestDepthThreeProto.getDescriptor().toProto().toByteString()); StreamRecorder<ServerReflectionResponse> responseObserver = StreamRecorder.create(); StreamObserver<ServerReflectionRequest> requestObserver = stub.serverReflectionInfo(responseObserver); requestObserver.onNext(request); requestObserver.onCompleted(); List<ByteString> response = responseObserver .firstValue() .get() .getFileDescriptorResponse() .getFileDescriptorProtoList(); assertEquals(goldenResponse.size(), response.size()); assertEquals(new HashSet<ByteString>(goldenResponse), new HashSet<ByteString>(response)); }
@Override public StreamObserver<ServerReflectionRequest> serverReflectionInfo( final StreamObserver<ServerReflectionResponse> responseObserver) { final ServerCallStreamObserver<ServerReflectionResponse> serverCallStreamObserver = (ServerCallStreamObserver<ServerReflectionResponse>) responseObserver; ProtoReflectionStreamObserver requestObserver = new ProtoReflectionStreamObserver(updateIndexIfNecessary(), serverCallStreamObserver); serverCallStreamObserver.setOnReadyHandler(requestObserver); serverCallStreamObserver.disableAutoInboundFlowControl(); serverCallStreamObserver.request(1); return requestObserver; }
ProtoReflectionService extends ServerReflectionGrpc.ServerReflectionImplBase implements InternalNotifyOnServerBuild { @Override public StreamObserver<ServerReflectionRequest> serverReflectionInfo( final StreamObserver<ServerReflectionResponse> responseObserver) { final ServerCallStreamObserver<ServerReflectionResponse> serverCallStreamObserver = (ServerCallStreamObserver<ServerReflectionResponse>) responseObserver; ProtoReflectionStreamObserver requestObserver = new ProtoReflectionStreamObserver(updateIndexIfNecessary(), serverCallStreamObserver); serverCallStreamObserver.setOnReadyHandler(requestObserver); serverCallStreamObserver.disableAutoInboundFlowControl(); serverCallStreamObserver.request(1); return requestObserver; } }
ProtoReflectionService extends ServerReflectionGrpc.ServerReflectionImplBase implements InternalNotifyOnServerBuild { @Override public StreamObserver<ServerReflectionRequest> serverReflectionInfo( final StreamObserver<ServerReflectionResponse> responseObserver) { final ServerCallStreamObserver<ServerReflectionResponse> serverCallStreamObserver = (ServerCallStreamObserver<ServerReflectionResponse>) responseObserver; ProtoReflectionStreamObserver requestObserver = new ProtoReflectionStreamObserver(updateIndexIfNecessary(), serverCallStreamObserver); serverCallStreamObserver.setOnReadyHandler(requestObserver); serverCallStreamObserver.disableAutoInboundFlowControl(); serverCallStreamObserver.request(1); return requestObserver; } private  ProtoReflectionService(); }
ProtoReflectionService extends ServerReflectionGrpc.ServerReflectionImplBase implements InternalNotifyOnServerBuild { @Override public StreamObserver<ServerReflectionRequest> serverReflectionInfo( final StreamObserver<ServerReflectionResponse> responseObserver) { final ServerCallStreamObserver<ServerReflectionResponse> serverCallStreamObserver = (ServerCallStreamObserver<ServerReflectionResponse>) responseObserver; ProtoReflectionStreamObserver requestObserver = new ProtoReflectionStreamObserver(updateIndexIfNecessary(), serverCallStreamObserver); serverCallStreamObserver.setOnReadyHandler(requestObserver); serverCallStreamObserver.disableAutoInboundFlowControl(); serverCallStreamObserver.request(1); return requestObserver; } private  ProtoReflectionService(); static BindableService newInstance(); @Override void notifyOnBuild(Server server); @Override StreamObserver<ServerReflectionRequest> serverReflectionInfo(
      final StreamObserver<ServerReflectionResponse> responseObserver); }
ProtoReflectionService extends ServerReflectionGrpc.ServerReflectionImplBase implements InternalNotifyOnServerBuild { @Override public StreamObserver<ServerReflectionRequest> serverReflectionInfo( final StreamObserver<ServerReflectionResponse> responseObserver) { final ServerCallStreamObserver<ServerReflectionResponse> serverCallStreamObserver = (ServerCallStreamObserver<ServerReflectionResponse>) responseObserver; ProtoReflectionStreamObserver requestObserver = new ProtoReflectionStreamObserver(updateIndexIfNecessary(), serverCallStreamObserver); serverCallStreamObserver.setOnReadyHandler(requestObserver); serverCallStreamObserver.disableAutoInboundFlowControl(); serverCallStreamObserver.request(1); return requestObserver; } private  ProtoReflectionService(); static BindableService newInstance(); @Override void notifyOnBuild(Server server); @Override StreamObserver<ServerReflectionRequest> serverReflectionInfo(
      final StreamObserver<ServerReflectionResponse> responseObserver);  }