|
|
@ -48,9 +48,9 @@ static NSString * const kPackage = @"grpc.testing"; |
|
|
|
static NSString * const kService = @"TestService"; |
|
|
|
static NSString * const kService = @"TestService"; |
|
|
|
static NSString * const kRemoteSSLHost = @"grpc-test.sandbox.googleapis.com"; |
|
|
|
static NSString * const kRemoteSSLHost = @"grpc-test.sandbox.googleapis.com"; |
|
|
|
|
|
|
|
|
|
|
|
static ProtoMethod *kInexistentMethod; |
|
|
|
static GRPCProtoMethod *kInexistentMethod; |
|
|
|
static ProtoMethod *kEmptyCallMethod; |
|
|
|
static GRPCProtoMethod *kEmptyCallMethod; |
|
|
|
static ProtoMethod *kUnaryCallMethod; |
|
|
|
static GRPCProtoMethod *kUnaryCallMethod; |
|
|
|
|
|
|
|
|
|
|
|
/** Observer class for testing that responseMetadata is KVO-compliant */ |
|
|
|
/** Observer class for testing that responseMetadata is KVO-compliant */ |
|
|
|
@interface PassthroughObserver : NSObject |
|
|
|
@interface PassthroughObserver : NSObject |
|
|
@ -109,15 +109,15 @@ static ProtoMethod *kUnaryCallMethod; |
|
|
|
[GRPCCall useInsecureConnectionsForHost:kHostAddress]; |
|
|
|
[GRPCCall useInsecureConnectionsForHost:kHostAddress]; |
|
|
|
|
|
|
|
|
|
|
|
// This method isn't implemented by the remote server. |
|
|
|
// This method isn't implemented by the remote server. |
|
|
|
kInexistentMethod = [[ProtoMethod alloc] initWithPackage:kPackage |
|
|
|
kInexistentMethod = [[GRPCProtoMethod alloc] initWithPackage:kPackage |
|
|
|
service:kService |
|
|
|
service:kService |
|
|
|
method:@"Inexistent"]; |
|
|
|
method:@"Inexistent"]; |
|
|
|
kEmptyCallMethod = [[ProtoMethod alloc] initWithPackage:kPackage |
|
|
|
kEmptyCallMethod = [[GRPCProtoMethod alloc] initWithPackage:kPackage |
|
|
|
service:kService |
|
|
|
service:kService |
|
|
|
method:@"EmptyCall"]; |
|
|
|
method:@"EmptyCall"]; |
|
|
|
kUnaryCallMethod = [[ProtoMethod alloc] initWithPackage:kPackage |
|
|
|
kUnaryCallMethod = [[GRPCProtoMethod alloc] initWithPackage:kPackage |
|
|
|
service:kService |
|
|
|
service:kService |
|
|
|
method:@"UnaryCall"]; |
|
|
|
method:@"UnaryCall"]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
- (void)testConnectionToRemoteServer { |
|
|
|
- (void)testConnectionToRemoteServer { |
|
|
@ -303,9 +303,9 @@ static ProtoMethod *kUnaryCallMethod; |
|
|
|
|
|
|
|
|
|
|
|
// Try to set parameters to nil for GRPCCall. This should cause an exception |
|
|
|
// Try to set parameters to nil for GRPCCall. This should cause an exception |
|
|
|
@try { |
|
|
|
@try { |
|
|
|
GRPCCall *call = [[GRPCCall alloc] initWithHost:nil |
|
|
|
(void)[[GRPCCall alloc] initWithHost:nil |
|
|
|
path:nil |
|
|
|
path:nil |
|
|
|
requestsWriter:nil]; |
|
|
|
requestsWriter:nil]; |
|
|
|
XCTFail(@"Did not receive an exception when parameters are nil"); |
|
|
|
XCTFail(@"Did not receive an exception when parameters are nil"); |
|
|
|
} @catch(NSException *theException) { |
|
|
|
} @catch(NSException *theException) { |
|
|
|
NSLog(@"Received exception as expected: %@", theException.name); |
|
|
|
NSLog(@"Received exception as expected: %@", theException.name); |
|
|
@ -316,9 +316,9 @@ static ProtoMethod *kUnaryCallMethod; |
|
|
|
GRXWriter *requestsWriter = [GRXWriter emptyWriter]; |
|
|
|
GRXWriter *requestsWriter = [GRXWriter emptyWriter]; |
|
|
|
[requestsWriter finishWithError:nil]; |
|
|
|
[requestsWriter finishWithError:nil]; |
|
|
|
@try { |
|
|
|
@try { |
|
|
|
GRPCCall *call = [[GRPCCall alloc] initWithHost:kHostAddress |
|
|
|
(void)[[GRPCCall alloc] initWithHost:kHostAddress |
|
|
|
path:kUnaryCallMethod.HTTPPath |
|
|
|
path:kUnaryCallMethod.HTTPPath |
|
|
|
requestsWriter:requestsWriter]; |
|
|
|
requestsWriter:requestsWriter]; |
|
|
|
XCTFail(@"Did not receive an exception when GRXWriter has incorrect state."); |
|
|
|
XCTFail(@"Did not receive an exception when GRXWriter has incorrect state."); |
|
|
|
} @catch(NSException *theException) { |
|
|
|
} @catch(NSException *theException) { |
|
|
|
NSLog(@"Received exception as expected: %@", theException.name); |
|
|
|
NSLog(@"Received exception as expected: %@", theException.name); |
|
|
|