Browse Source

Make all test stub methods open.

Daniel Alm 8 years ago
parent
commit
f4040f9017

+ 6 - 6
Sources/gRPC/GenCodeSupport/ClientCallClientStreaming.swift

@@ -95,20 +95,20 @@ open class ClientCallClientStreamingImpl<InputType: Message, OutputType: Message
 open class ClientCallClientStreamingTestStub<InputType: Message, OutputType: Message>: ClientCallClientStreamingBase {
   open class var method: String { fatalError("needs to be overridden") }
   
-  var inputs: [InputType] = []
-  var output: OutputType?
+  open var inputs: [InputType] = []
+  open var output: OutputType?
   
-  public func send(_ message: InputType, errorHandler:@escaping (Error)->()) throws {
+  open func send(_ message: InputType, errorHandler:@escaping (Error)->()) throws {
     inputs.append(message)
   }
   
-  public func closeAndReceive(completion:@escaping (OutputType?, ClientError?)->()) throws {
+  open func closeAndReceive(completion:@escaping (OutputType?, ClientError?)->()) throws {
     completion(output!, nil)
   }
   
-  public func closeAndReceive() throws -> OutputType {
+  open func closeAndReceive() throws -> OutputType {
     return output!
   }
   
-  public func cancel() { }
+  open func cancel() { }
 }

+ 4 - 4
Sources/gRPC/GenCodeSupport/ClientCallServerStreaming.swift

@@ -91,9 +91,9 @@ open class ClientCallServerStreamingImpl<InputType: Message, OutputType: Message
 open class ClientCallServerStreamingTestStub<OutputType: Message>: ClientCallServerStreamingBase {
   open class var method: String { fatalError("needs to be overridden") }
   
-  var outputs: [OutputType] = []
+  open var outputs: [OutputType] = []
   
-  public func receive(completion:@escaping (OutputType?, ClientError?)->()) throws {
+  open func receive(completion:@escaping (OutputType?, ClientError?)->()) throws {
     if let output = outputs.first {
       outputs.removeFirst()
       completion(output, nil)
@@ -102,7 +102,7 @@ open class ClientCallServerStreamingTestStub<OutputType: Message>: ClientCallSer
     }
   }
   
-  public func receive() throws -> OutputType {
+  open func receive() throws -> OutputType {
     if let output = outputs.first {
       outputs.removeFirst()
       return output
@@ -111,5 +111,5 @@ open class ClientCallServerStreamingTestStub<OutputType: Message>: ClientCallSer
     }
   }
   
-  public func cancel() { }
+  open func cancel() { }
 }