Rename GRPCMethodName->ProtoMethod

pull/2301/head
Jorge Canizales 10 years ago
parent 951cd18309
commit 469d4b6fde
  1. 4
      src/objective-c/GRPCClient/GRPCCall.h
  2. 4
      src/objective-c/GRPCClient/GRPCCall.m
  3. 2
      src/objective-c/GRPCClient/ProtoMethod.h
  4. 4
      src/objective-c/GRPCClient/ProtoMethod.m
  5. 4
      src/objective-c/GRPCClient/private/GRPCMethodName+HTTP2Encoding.h
  6. 2
      src/objective-c/GRPCClient/private/GRPCMethodName+HTTP2Encoding.m
  7. 2
      src/objective-c/ProtoRPC/ProtoRPC.h
  8. 4
      src/objective-c/ProtoRPC/ProtoRPC.m
  9. 4
      src/objective-c/ProtoRPC/ProtoService.m
  10. 14
      src/objective-c/tests/GRPCClientTests.m
  11. 6
      src/objective-c/tests/LocalClearTextTests.m

@ -48,7 +48,7 @@
#import <Foundation/Foundation.h>
#import <RxLibrary/GRXWriter.h>
@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<GRXWriter>)requestsWriter NS_DESIGNATED_INITIALIZER;
// Finishes the request side of this call, notifies the server that the RPC

@ -36,7 +36,7 @@
#include <grpc/grpc.h>
#include <grpc/support/time.h>
#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<GRXWriter>)requestWriter {
if (!host || !method) {
[NSException raise:NSInvalidArgumentException format:@"Neither host nor method can be nil."];

@ -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;

@ -31,9 +31,9 @@
*
*/
#import "GRPCMethodName.h"
#import "ProtoMethod.h"
@implementation GRPCMethodName
@implementation ProtoMethod
- (instancetype)initWithPackage:(NSString *)package
interface:(NSString *)interface
method:(NSString *)method {

@ -33,8 +33,8 @@
#import <Foundation/Foundation.h>
#import "GRPCClient/GRPCMethodName.h"
#import "GRPCClient/ProtoMethod.h"
@interface GRPCMethodName (HTTP2Encoding)
@interface ProtoMethod (HTTP2Encoding)
- (NSString *)HTTP2Path;
@end

@ -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];

@ -37,7 +37,7 @@
@interface ProtoRPC : GRPCCall
- (instancetype)initWithHost:(NSString *)host
method:(GRPCMethodName *)method
method:(ProtoMethod *)method
requestsWriter:(id<GRXWriter>)requestsWriter
responseClass:(Class)responseClass
responsesWriteable:(id<GRXWriteable>)responsesWriteable NS_DESIGNATED_INITIALIZER;

@ -43,7 +43,7 @@
}
- (instancetype)initWithHost:(NSString *)host
method:(GRPCMethodName *)method
method:(ProtoMethod *)method
requestsWriter:(id<GRXWriter>)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<GRXWriter>)requestsWriter
responseClass:(Class)responseClass
responsesWriteable:(id<GRXWriteable>)responsesWriteable {

@ -33,7 +33,7 @@
#import "ProtoService.h"
#import <GRPCClient/GRPCMethodName.h>
#import <GRPCClient/ProtoMethod.h>
#import <RxLibrary/GRXWriteable.h>
#import <RxLibrary/GRXWriter.h>
@ -69,7 +69,7 @@
requestsWriter:(id<GRXWriter>)requestsWriter
responseClass:(Class)responseClass
responsesWriteable:(id<GRXWriteable>)responsesWriteable {
GRPCMethodName *methodName = [[GRPCMethodName alloc] initWithPackage:_packageName
ProtoMethod *methodName = [[ProtoMethod alloc] initWithPackage:_packageName
interface:_serviceName
method:method];
return [[ProtoRPC alloc] initWithHost:_host

@ -35,7 +35,7 @@
#import <XCTest/XCTest.h>
#import <GRPCClient/GRPCCall.h>
#import <GRPCClient/GRPCMethodName.h>
#import <GRPCClient/ProtoMethod.h>
#import <RemoteTest/Messages.pbobjc.h>
#import <RxLibrary/GRXWriteable.h>
#import <RxLibrary/GRXWriter+Immediate.h>
@ -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"];
}

@ -35,7 +35,7 @@
#import <XCTest/XCTest.h>
#import <GRPCClient/GRPCCall.h>
#import <GRPCClient/GRPCMethodName.h>
#import <GRPCClient/ProtoMethod.h>
#import <RouteGuide/RouteGuide.pbobjc.h>
#import <RouteGuide/RouteGuide.pbrpc.h>
#import <RxLibrary/GRXWriteable.h>
@ -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"];

Loading…
Cancel
Save