Smoke test that things still work after “closeOpenConnections”

pull/6378/head
Jorge Canizales 9 years ago
parent 454432542a
commit fa70dacf95
  1. 22
      src/objective-c/tests/InteropTests.m

@ -35,6 +35,7 @@
#include <grpc/status.h>
#import <GRPCClient/GRPCCall+ChannelArg.h>
#import <GRPCClient/GRPCCall+Tests.h>
#import <ProtoRPC/ProtoRPC.h>
#import <RemoteTest/Empty.pbobjc.h>
@ -312,4 +313,25 @@
[self waitForExpectationsWithTimeout:8 handler:nil];
}
- (void)testRPCAfterClosingOpenConnections {
XCTAssertNotNil(self.class.host);
__weak XCTestExpectation *expectation =
[self expectationWithDescription:@"RPC after closing connection"];
RMTEmpty *request = [RMTEmpty message];
[_service emptyCallWithRequest:request handler:^(RMTEmpty *response, NSError *error) {
XCTAssertNil(error, @"First RPC finished with unexpected error: %@", error);
[GRPCCall closeOpenConnections];
[_service emptyCallWithRequest:request handler:^(RMTEmpty *response, NSError *error) {
XCTAssertNil(error, @"Second RPC finished with unexpected error: %@", error);
[expectation fulfill];
}];
}];
[self waitForExpectationsWithTimeout:4 handler:nil];
}
@end

Loading…
Cancel
Save