diff options
author | Jorge Canizales <jcanizales@google.com> | 2015-05-16 12:14:18 -0700 |
---|---|---|
committer | Jorge Canizales <jcanizales@google.com> | 2015-05-17 16:21:21 -0700 |
commit | 184e02bed030378af9451868d57b22a2e2a85470 (patch) | |
tree | e05c100d22c74e48411bfb3fe5dc2546740779c0 | |
parent | 2410f9916114b7ce6b78c7fb195e9c811b8b1454 (diff) |
Moves the RouteGuide local tests to proto3
-rw-r--r-- | src/objective-c/examples/Sample/SampleTests/SampleTests.m | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/objective-c/examples/Sample/SampleTests/SampleTests.m b/src/objective-c/examples/Sample/SampleTests/SampleTests.m index 6d6875c233..ebe09627ed 100644 --- a/src/objective-c/examples/Sample/SampleTests/SampleTests.m +++ b/src/objective-c/examples/Sample/SampleTests/SampleTests.m @@ -38,7 +38,7 @@ #import <gRPC/GRPCMethodName.h> #import <gRPC/GRXWriter+Immediate.h> #import <gRPC/GRXWriteable.h> -#import <Route_guide/Route_guide.pb.h> +#import <Route_guide/RouteGuide.pbobjc.h> @interface SampleTests : XCTestCase @end @@ -105,15 +105,15 @@ - (void)testSimpleProtoRPC { __weak XCTestExpectation *response = [self expectationWithDescription:@"Response received."]; - __weak XCTestExpectation *expectedResponse = - [self expectationWithDescription:@"Expected response."]; __weak XCTestExpectation *completion = [self expectationWithDescription:@"RPC completed."]; GRPCMethodName *method = [[GRPCMethodName alloc] initWithPackage:@"grpc.example.routeguide" interface:@"RouteGuide" method:@"GetFeature"]; - RGDPoint *point = [[[[[RGDPointBuilder alloc] init] setLatitude:28E7] setLongitude:-15E7] build]; + RGDPoint *point = [RGDPoint message]; + point.latitude = 28E7; + point.longitude = -15E7; id<GRXWriter> requestsWriter = [GRXWriter writerWithValue:[point data]]; GRPCCall *call = [[GRPCCall alloc] initWithHost:@"http://127.0.0.1:8980" @@ -122,11 +122,10 @@ id<GRXWriteable> responsesWriteable = [[GRXWriteable alloc] initWithValueHandler:^(NSData *value) { XCTAssertNotNil(value, @"nil value received as response."); - [response fulfill]; RGDFeature *feature = [RGDFeature parseFromData:value]; XCTAssertEqualObjects(point, feature.location); XCTAssertNotNil(feature.name, @"Response's name is nil."); - [expectedResponse fulfill]; + [response fulfill]; } completionHandler:^(NSError *errorOrNil) { XCTAssertNil(errorOrNil, @"Finished with unexpected error: %@", errorOrNil); [completion fulfill]; |