@@ -701,87 +701,6 @@ - (void)testLargeUnaryRPCWithV2API {
701
701
[self waitForExpectationsWithTimeout: TEST_TIMEOUT handler: nil ];
702
702
}
703
703
704
- - (void )testUnaryRPCWithV2APIFlowControl {
705
- XCTAssertNotNil ([[self class ] host ]);
706
- __weak XCTestExpectation *expectReceive =
707
- [self expectationWithDescription: @" LargeUnaryWithV2API received message" ];
708
- __weak XCTestExpectation *expectComplete =
709
- [self expectationWithDescription: @" LargeUnaryWithV2API received complete" ];
710
-
711
- const int responseSize = 123 ;
712
- RMTSimpleRequest *request = [RMTSimpleRequest message ];
713
- request.responseType = RMTPayloadType_Compressable;
714
- request.responseSize = responseSize;
715
- request.payload .body = [NSMutableData dataWithLength: 456 ];
716
-
717
- GRPCMutableCallOptions *options = [[GRPCMutableCallOptions alloc ] init ];
718
- // For backwards compatibility
719
- options.transportType = [[self class ] transportType ];
720
- options.transport = [[self class ] transport ];
721
- options.PEMRootCertificates = [[self class ] PEMRootCertificates ];
722
- options.hostNameOverride = [[self class ] hostNameOverride ];
723
- options.flowControlEnabled = YES ;
724
-
725
- GRPCUnaryProtoCall *call = [_service
726
- unaryCallWithMessage: request
727
- responseHandler: [[InteropTestsBlockCallbacks alloc ] initWithInitialMetadataCallback: nil
728
- messageCallback: ^(id message) {
729
- XCTAssertNotNil (message);
730
- if (message) {
731
- RMTSimpleResponse *expectedResponse =
732
- [RMTSimpleResponse message ];
733
- expectedResponse.payload .type = RMTPayloadType_Compressable;
734
- expectedResponse.payload .body =
735
- [NSMutableData dataWithLength: responseSize];
736
- XCTAssertEqualObjects (message, expectedResponse);
737
- [expectReceive fulfill ];
738
- [call finish ];
739
- }
740
- }
741
- closeCallback: ^(NSDictionary *trailingMetadata, NSError *error) {
742
- XCTAssertNil (error, @" Unexpected error: %@ " , error);
743
- [expectComplete fulfill ];
744
- }]
745
- callOptions: options];
746
- [call start ];
747
- [call receiveNextMessage ];
748
- [self waitForExpectationsWithTimeout: TEST_TIMEOUT handler: nil ];
749
- }
750
-
751
- - (void )testUnaryRPCWithV2APIFlowControlNotReceivingMessage {
752
- XCTAssertNotNil ([[self class ] host ]);
753
-
754
- __weak XCTestExpectation *expectTimeout =
755
- [self expectationWithDescription:
756
- @" testUnaryRPCWithV2APIFlowControlNotReceivingMessage received timeout" ];
757
-
758
- RMTSimpleRequest *request = [RMTSimpleRequest message ];
759
- request.responseType = RMTPayloadType_Compressable;
760
- request.responseSize = 123 ;
761
- request.payload .body = [NSMutableData dataWithLength: 456 ];
762
-
763
- GRPCMutableCallOptions *options = [[GRPCMutableCallOptions alloc ] init ];
764
- // For backwards compatibility
765
- options.transportType = [[self class ] transportType ];
766
- options.transport = [[self class ] transport ];
767
- options.PEMRootCertificates = [[self class ] PEMRootCertificates ];
768
- options.hostNameOverride = [[self class ] hostNameOverride ];
769
- options.flowControlEnabled = YES ;
770
-
771
- GRPCUnaryProtoCall *call = [_service
772
- unaryCallWithMessage: request
773
- responseHandler: [[InteropTestsBlockCallbacks alloc ]
774
- initWithInitialMetadataCallback: nil
775
- messageCallback: ^(id message) {
776
- XCTFail (" Not expected to receive message" );
777
- }
778
- closeCallback: nil ]
779
- callOptions: options];
780
- [call start ];
781
- XCTWaiterResult result = [XCTWaiter waitForExpectations: @[ expectTimeout ] timeout: 5 ];
782
- XCTAssertEqual (XCTWaiterResultTimedOut, result, @" Unexpected waiter result %@ " , @(result));
783
- }
784
-
785
704
- (void )testConcurrentRPCsWithErrorsWithV2API {
786
705
NSMutableArray *completeExpectations = [NSMutableArray array ];
787
706
NSMutableArray *calls = [NSMutableArray array ];
@@ -1159,72 +1078,9 @@ - (void)testPingPongRPCWithV2API {
1159
1078
[self waitForExpectationsWithTimeout: STREAMING_CALL_TEST_TIMEOUT handler: nil ];
1160
1079
}
1161
1080
1162
- - (void )testPingPongUnaryRPCWithFlowControl {
1081
+ - (void )testPingPongRPCWithFlowControl {
1163
1082
XCTAssertNotNil ([[self class ] host ]);
1164
- __weak XCTestExpectation *expectation =
1165
- [self expectationWithDescription: @" UnaryPingPongWithV2API" ];
1166
-
1167
- NSNumber *requestSize = @321 ;
1168
- NSArray *responseSizes = @[ @123 , @234 ];
1169
-
1170
- RMTStreamingOutputCallRequest *request = [RMTStreamingOutputCallRequest message ];
1171
- request.payload .body = [NSMutableData dataWithLength: requestSize.unsignedIntegerValue];
1172
- for (NSNumber *responseSize in responseSizes) {
1173
- RMTResponseParameters *parameters = [RMTResponseParameters message ];
1174
- parameters.size = responseSize.intValue ;
1175
- [request.responseParametersArray addObject: parameters];
1176
- }
1177
-
1178
- GRPCMutableCallOptions *options = [[GRPCMutableCallOptions alloc ] init ];
1179
- // For backwards compatibility
1180
- options.transportType = [[self class ] transportType ];
1181
- options.transport = [[self class ] transport ];
1182
- options.PEMRootCertificates = [[self class ] PEMRootCertificates ];
1183
- options.hostNameOverride = [[self class ] hostNameOverride ];
1184
- options.flowControlEnabled = YES ;
1185
-
1186
- __block GRPCUnaryProtoCall *call = nil ;
1187
- __block int receivedMessageCount = 0 ;
1188
-
1189
- id messageHandler = ^(id message) {
1190
- NSLog (@" received message %@ " , @(receivedMessageCount));
1191
- XCTAssertLessThan (receivedMessageCount, responseSizes.count ,
1192
- " More than expected messages received" );
1193
- id expected =
1194
- [RMTStreamingOutputCallResponse messageWithPayloadSize: responseSizes[receivedMessageCount]];
1195
- XCTAssertEqualObjects (message, expected);
1196
-
1197
- receivedMessageCount += 1 ;
1198
- if (receivedMessageCount < responseSizes.count ) {
1199
- [call receiveNextMessage ];
1200
- } else {
1201
- [call finish ];
1202
- }
1203
- };
1204
-
1205
- id closeHandler = ^(NSDictionary *trailingMetadata, NSError *error) {
1206
- XCTAssertNil (error, @" Finished with unexpected error: %@ " , error);
1207
- [expectation fulfill ];
1208
- };
1209
-
1210
- InteropTestsBlockCallbacks *handler =
1211
- [[InteropTestsBlockCallbacks alloc ] initWithInitialMetadataCallback: nil
1212
- messageCallback: messageHandler
1213
- closeCallback: closeHandler
1214
- writeMessageCallback: nil ];
1215
-
1216
- call = [_service streamingOutputCallWithMessage: request
1217
- responseHandler: handler
1218
- callOptions: options];
1219
- [call start ];
1220
- [call receiveNextMessage ];
1221
- [self waitForExpectationsWithTimeout: STREAMING_CALL_TEST_TIMEOUT handler: nil ];
1222
- }
1223
-
1224
- - (void )testPingPongStreamingRPCWithFlowControl {
1225
- XCTAssertNotNil ([[self class ] host ]);
1226
- __weak XCTestExpectation *expectation =
1227
- [self expectationWithDescription: @" StreamingPingPongWithV2API" ];
1083
+ __weak XCTestExpectation *expectation = [self expectationWithDescription: @" PingPongWithV2API" ];
1228
1084
1229
1085
NSArray *requests = @[ @27182 , @8 , @1828 , @45904 ];
1230
1086
NSArray *responses = @[ @31415 , @9 , @2653 , @58979 ];
0 commit comments