From 469d4b6fde8084232cafa3972691d20b6cb359c7 Mon Sep 17 00:00:00 2001 From: Jorge Canizales Date: Fri, 3 Jul 2015 12:02:38 -0700 Subject: [PATCH] Rename GRPCMethodName->ProtoMethod --- src/objective-c/GRPCClient/GRPCCall.h | 4 ++-- src/objective-c/GRPCClient/GRPCCall.m | 4 ++-- .../GRPCClient/{GRPCMethodName.h => ProtoMethod.h} | 2 +- .../GRPCClient/{GRPCMethodName.m => ProtoMethod.m} | 4 ++-- .../private/GRPCMethodName+HTTP2Encoding.h | 4 ++-- .../private/GRPCMethodName+HTTP2Encoding.m | 2 +- src/objective-c/ProtoRPC/ProtoRPC.h | 2 +- src/objective-c/ProtoRPC/ProtoRPC.m | 4 ++-- src/objective-c/ProtoRPC/ProtoService.m | 4 ++-- src/objective-c/tests/GRPCClientTests.m | 14 +++++++------- src/objective-c/tests/LocalClearTextTests.m | 6 +++--- 11 files changed, 25 insertions(+), 25 deletions(-) rename src/objective-c/GRPCClient/{GRPCMethodName.h => ProtoMethod.h} (98%) rename src/objective-c/GRPCClient/{GRPCMethodName.m => ProtoMethod.m} (97%) diff --git a/src/objective-c/GRPCClient/GRPCCall.h b/src/objective-c/GRPCClient/GRPCCall.h index 33aae107475..ed59817952c 100644 --- a/src/objective-c/GRPCClient/GRPCCall.h +++ b/src/objective-c/GRPCClient/GRPCCall.h @@ -48,7 +48,7 @@ #import #import -@class GRPCMethodName; +@class ProtoMethod; // Key used in |NSError|'s |userInfo| dictionary to store the response metadata sent by the server. extern id const kGRPCStatusMetadataKey; @@ -90,7 +90,7 @@ extern id const kGRPCStatusMetadataKey; // the specific remote method called). // To finish a call right away, invoke cancel. - (instancetype)initWithHost:(NSString *)host - method:(GRPCMethodName *)method + method:(ProtoMethod *)method requestsWriter:(id)requestsWriter NS_DESIGNATED_INITIALIZER; // Finishes the request side of this call, notifies the server that the RPC diff --git a/src/objective-c/GRPCClient/GRPCCall.m b/src/objective-c/GRPCClient/GRPCCall.m index 77eebeff761..08b28282941 100644 --- a/src/objective-c/GRPCClient/GRPCCall.m +++ b/src/objective-c/GRPCClient/GRPCCall.m @@ -36,7 +36,7 @@ #include #include -#import "GRPCMethodName.h" +#import "ProtoMethod.h" #import "private/GRPCChannel.h" #import "private/GRPCCompletionQueue.h" #import "private/GRPCDelegateWrapper.h" @@ -95,7 +95,7 @@ NSString * const kGRPCStatusMetadataKey = @"io.grpc.StatusMetadataKey"; // Designated initializer - (instancetype)initWithHost:(NSString *)host - method:(GRPCMethodName *)method + method:(ProtoMethod *)method requestsWriter:(id)requestWriter { if (!host || !method) { [NSException raise:NSInvalidArgumentException format:@"Neither host nor method can be nil."]; diff --git a/src/objective-c/GRPCClient/GRPCMethodName.h b/src/objective-c/GRPCClient/ProtoMethod.h similarity index 98% rename from src/objective-c/GRPCClient/GRPCMethodName.h rename to src/objective-c/GRPCClient/ProtoMethod.h index fe153dd478b..814c1564641 100644 --- a/src/objective-c/GRPCClient/GRPCMethodName.h +++ b/src/objective-c/GRPCClient/ProtoMethod.h @@ -39,7 +39,7 @@ // implement multiple interfaces. // TODO(jcanizales): Move to ProtoRPC package. // TODO(jcanizales): Rename interface -> service. -@interface GRPCMethodName : NSObject +@interface ProtoMethod : NSObject @property(nonatomic, readonly) NSString *package; @property(nonatomic, readonly) NSString *interface; @property(nonatomic, readonly) NSString *method; diff --git a/src/objective-c/GRPCClient/GRPCMethodName.m b/src/objective-c/GRPCClient/ProtoMethod.m similarity index 97% rename from src/objective-c/GRPCClient/GRPCMethodName.m rename to src/objective-c/GRPCClient/ProtoMethod.m index 96724073a5f..1f5f836b7d0 100644 --- a/src/objective-c/GRPCClient/GRPCMethodName.m +++ b/src/objective-c/GRPCClient/ProtoMethod.m @@ -31,9 +31,9 @@ * */ -#import "GRPCMethodName.h" +#import "ProtoMethod.h" -@implementation GRPCMethodName +@implementation ProtoMethod - (instancetype)initWithPackage:(NSString *)package interface:(NSString *)interface method:(NSString *)method { diff --git a/src/objective-c/GRPCClient/private/GRPCMethodName+HTTP2Encoding.h b/src/objective-c/GRPCClient/private/GRPCMethodName+HTTP2Encoding.h index 81c80f2a492..ac1872879cd 100644 --- a/src/objective-c/GRPCClient/private/GRPCMethodName+HTTP2Encoding.h +++ b/src/objective-c/GRPCClient/private/GRPCMethodName+HTTP2Encoding.h @@ -33,8 +33,8 @@ #import -#import "GRPCClient/GRPCMethodName.h" +#import "GRPCClient/ProtoMethod.h" -@interface GRPCMethodName (HTTP2Encoding) +@interface ProtoMethod (HTTP2Encoding) - (NSString *)HTTP2Path; @end diff --git a/src/objective-c/GRPCClient/private/GRPCMethodName+HTTP2Encoding.m b/src/objective-c/GRPCClient/private/GRPCMethodName+HTTP2Encoding.m index 3ad757fb29a..f31d33408b0 100644 --- a/src/objective-c/GRPCClient/private/GRPCMethodName+HTTP2Encoding.m +++ b/src/objective-c/GRPCClient/private/GRPCMethodName+HTTP2Encoding.m @@ -33,7 +33,7 @@ #import "GRPCMethodName+HTTP2Encoding.h" -@implementation GRPCMethodName (HTTP2Encoding) +@implementation ProtoMethod (HTTP2Encoding) - (NSString *)HTTP2Path { if (self.package) { return [NSString stringWithFormat:@"/%@.%@/%@", self.package, self.interface, self.method]; diff --git a/src/objective-c/ProtoRPC/ProtoRPC.h b/src/objective-c/ProtoRPC/ProtoRPC.h index a3833106195..c5ab345c9cf 100644 --- a/src/objective-c/ProtoRPC/ProtoRPC.h +++ b/src/objective-c/ProtoRPC/ProtoRPC.h @@ -37,7 +37,7 @@ @interface ProtoRPC : GRPCCall - (instancetype)initWithHost:(NSString *)host - method:(GRPCMethodName *)method + method:(ProtoMethod *)method requestsWriter:(id)requestsWriter responseClass:(Class)responseClass responsesWriteable:(id)responsesWriteable NS_DESIGNATED_INITIALIZER; diff --git a/src/objective-c/ProtoRPC/ProtoRPC.m b/src/objective-c/ProtoRPC/ProtoRPC.m index 4da646d7b45..ec38077b714 100644 --- a/src/objective-c/ProtoRPC/ProtoRPC.m +++ b/src/objective-c/ProtoRPC/ProtoRPC.m @@ -43,7 +43,7 @@ } - (instancetype)initWithHost:(NSString *)host - method:(GRPCMethodName *)method + method:(ProtoMethod *)method requestsWriter:(id)requestsWriter { return [self initWithHost:host method:method @@ -54,7 +54,7 @@ // Designated initializer - (instancetype)initWithHost:(NSString *)host - method:(GRPCMethodName *)method + method:(ProtoMethod *)method requestsWriter:(id)requestsWriter responseClass:(Class)responseClass responsesWriteable:(id)responsesWriteable { diff --git a/src/objective-c/ProtoRPC/ProtoService.m b/src/objective-c/ProtoRPC/ProtoService.m index 47bdb5dc6e8..e8939389332 100644 --- a/src/objective-c/ProtoRPC/ProtoService.m +++ b/src/objective-c/ProtoRPC/ProtoService.m @@ -33,7 +33,7 @@ #import "ProtoService.h" -#import +#import #import #import @@ -69,7 +69,7 @@ requestsWriter:(id)requestsWriter responseClass:(Class)responseClass responsesWriteable:(id)responsesWriteable { - GRPCMethodName *methodName = [[GRPCMethodName alloc] initWithPackage:_packageName + ProtoMethod *methodName = [[ProtoMethod alloc] initWithPackage:_packageName interface:_serviceName method:method]; return [[ProtoRPC alloc] initWithHost:_host diff --git a/src/objective-c/tests/GRPCClientTests.m b/src/objective-c/tests/GRPCClientTests.m index e421127ea1e..e3b37b050e4 100644 --- a/src/objective-c/tests/GRPCClientTests.m +++ b/src/objective-c/tests/GRPCClientTests.m @@ -35,7 +35,7 @@ #import #import -#import +#import #import #import #import @@ -47,9 +47,9 @@ static NSString * const kHostAddress = @"grpc-test.sandbox.google.com"; static NSString * const kPackage = @"grpc.testing"; static NSString * const kService = @"TestService"; -static GRPCMethodName *kInexistentMethod; -static GRPCMethodName *kEmptyCallMethod; -static GRPCMethodName *kUnaryCallMethod; +static ProtoMethod *kInexistentMethod; +static ProtoMethod *kEmptyCallMethod; +static ProtoMethod *kUnaryCallMethod; @interface GRPCClientTests : XCTestCase @end @@ -58,13 +58,13 @@ static GRPCMethodName *kUnaryCallMethod; - (void)setUp { // This method isn't implemented by the remote server. - kInexistentMethod = [[GRPCMethodName alloc] initWithPackage:kPackage + kInexistentMethod = [[ProtoMethod alloc] initWithPackage:kPackage interface:kService method:@"Inexistent"]; - kEmptyCallMethod = [[GRPCMethodName alloc] initWithPackage:kPackage + kEmptyCallMethod = [[ProtoMethod alloc] initWithPackage:kPackage interface:kService method:@"EmptyCall"]; - kUnaryCallMethod = [[GRPCMethodName alloc] initWithPackage:kPackage + kUnaryCallMethod = [[ProtoMethod alloc] initWithPackage:kPackage interface:kService method:@"UnaryCall"]; } diff --git a/src/objective-c/tests/LocalClearTextTests.m b/src/objective-c/tests/LocalClearTextTests.m index 05cc10410a1..ace100847fe 100644 --- a/src/objective-c/tests/LocalClearTextTests.m +++ b/src/objective-c/tests/LocalClearTextTests.m @@ -35,7 +35,7 @@ #import #import -#import +#import #import #import #import @@ -87,7 +87,7 @@ static NSString * const kService = @"RouteGuide"; __weak XCTestExpectation *response = [self expectationWithDescription:@"Empty response received."]; __weak XCTestExpectation *completion = [self expectationWithDescription:@"Empty RPC completed."]; - GRPCMethodName *method = [[GRPCMethodName alloc] initWithPackage:kPackage + ProtoMethod *method = [[ProtoMethod alloc] initWithPackage:kPackage interface:kService method:@"RecordRoute"]; @@ -115,7 +115,7 @@ static NSString * const kService = @"RouteGuide"; __weak XCTestExpectation *response = [self expectationWithDescription:@"Response received."]; __weak XCTestExpectation *completion = [self expectationWithDescription:@"RPC completed."]; - GRPCMethodName *method = [[GRPCMethodName alloc] initWithPackage:kPackage + ProtoMethod *method = [[ProtoMethod alloc] initWithPackage:kPackage interface:kService method:@"GetFeature"];