Skip to content

Commit

Permalink
Merge pull request #234 from DyKnow/feature-dev
Browse files Browse the repository at this point in the history
Add Support for AFNetworking 2.x latest
  • Loading branch information
Alex Billingsley committed Feb 2, 2016
2 parents 10d3ea0 + c133638 commit f1c0eb6
Show file tree
Hide file tree
Showing 28 changed files with 1,196 additions and 1,201 deletions.
20 changes: 10 additions & 10 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,33 @@ xcodeproj 'SignalR.Client.ObjC/SignalR.Client.ObjC'
workspace 'SignalR.Client.ObjC'

target :"SignalR.Client.iOS", :exclusive => true do
platform :ios, '6.0'
pod 'AFNetworking', '2.2.3'
pod 'SocketRocket', '0.4'
platform :ios, '7.0'
pod 'AFNetworking', '2.6.3'
pod 'SocketRocket', '0.4.2'
end

target :"SignalR.Client.OSX", :exclusive => true do
platform :osx, '10.8'
pod 'AFNetworking', '2.2.3'
pod 'SocketRocket', '0.4'
platform :osx, '10.9'
pod 'AFNetworking', '2.6.3'
pod 'SocketRocket', '0.4.2'
end

target :"SignalR.Client.Tests.OSX", :exclusive => true do
platform :osx, '10.8'
platform :osx, '10.9'
pod 'OCMock'
end

target :"SignalR.Client.Tests.iOS", :exclusive => true do
platform :ios, '6.0'
platform :ios, '7.0'
pod 'OCMock'
end


target :"SignalR.Samples.iOS", :exclusive => true do
platform :ios, '6.0'
platform :ios, '7.0'
end


target :"SignalR.Samples.OSX", :exclusive => true do
platform :osx, '10.8'
platform :osx, '10.9'
end
42 changes: 22 additions & 20 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,34 +1,36 @@
PODS:
- AFNetworking (2.2.3):
- AFNetworking/NSURLConnection (= 2.2.3)
- AFNetworking/NSURLSession (= 2.2.3)
- AFNetworking/Reachability (= 2.2.3)
- AFNetworking/Security (= 2.2.3)
- AFNetworking/Serialization (= 2.2.3)
- AFNetworking/UIKit (= 2.2.3)
- AFNetworking/NSURLConnection (2.2.3):
- AFNetworking (2.6.3):
- AFNetworking/NSURLConnection (= 2.6.3)
- AFNetworking/NSURLSession (= 2.6.3)
- AFNetworking/Reachability (= 2.6.3)
- AFNetworking/Security (= 2.6.3)
- AFNetworking/Serialization (= 2.6.3)
- AFNetworking/UIKit (= 2.6.3)
- AFNetworking/NSURLConnection (2.6.3):
- AFNetworking/Reachability
- AFNetworking/Security
- AFNetworking/Serialization
- AFNetworking/NSURLSession (2.2.3):
- AFNetworking/NSURLConnection
- AFNetworking/Reachability (2.2.3)
- AFNetworking/Security (2.2.3)
- AFNetworking/Serialization (2.2.3)
- AFNetworking/UIKit (2.2.3):
- AFNetworking/NSURLSession (2.6.3):
- AFNetworking/Reachability
- AFNetworking/Security
- AFNetworking/Serialization
- AFNetworking/Reachability (2.6.3)
- AFNetworking/Security (2.6.3)
- AFNetworking/Serialization (2.6.3)
- AFNetworking/UIKit (2.6.3):
- AFNetworking/NSURLConnection
- AFNetworking/NSURLSession
- OCMock (2.2.2)
- SocketRocket (0.4)
- SocketRocket (0.4.2)

DEPENDENCIES:
- AFNetworking (= 2.2.3)
- AFNetworking (= 2.6.3)
- OCMock
- SocketRocket (= 0.4)
- SocketRocket (= 0.4.2)

SPEC CHECKSUMS:
AFNetworking: fd6df10652c90fe082b188b5af0660f123423f80
AFNetworking: cb8d14a848e831097108418f5d49217339d4eb60
OCMock: c8b8928d457c8f1873d563537ab1cc31bef40b87
SocketRocket: 01443933b7bc362621325f4607b80b4286a99707
SocketRocket: ffe08119b00ef982f6c37052a4705a057c8494ad

COCOAPODS: 0.38.2
COCOAPODS: 0.39.0
45 changes: 17 additions & 28 deletions SignalR.Client.ObjC/SRLongPollingTransportTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#import "SRConnectionInterface.h"
#import "SRNegotiationResponse.h"
#import "SRMockNetwork.h"
#import "SRMockClientTransport.h"

@interface SRLongPollingTransport ()
@property (strong, nonatomic, readwrite) NSOperationQueue *pollingOperationQueue;
Expand Down Expand Up @@ -108,20 +109,14 @@ - (void) testFailureStopsAndRestartLongPolling {
SRConnection* connection = [[SRConnection alloc] initWithURLString:@"http://localhost:0000"];
SRLongPollingTransport* lp = [[ SRLongPollingTransport alloc] init];

id pmock = [OCMockObject partialMockForObject: lp];
[[[pmock stub] andDo:^(NSInvocation *invocation) {
void (^ callbackOut)(SRNegotiationResponse * response, NSError *error);
__unsafe_unretained void (^successCallback)(SRNegotiationResponse *response, NSError *error) = nil;
[invocation getArgument: &successCallback atIndex: 4];
callbackOut = successCallback;
callbackOut([[SRNegotiationResponse alloc ]initWithDictionary:@{
@"ConnectionId": @"10101",
@"ConnectionToken": @"10101010101",
@"DisconnectTimeout": @30,
@"ProtocolVersion": @"1.3.0.0",
@"TransportConnectTimeout": @10
}], nil);
}] negotiate:[OCMArg any] connectionData:[OCMArg any] completionHandler:[OCMArg any]];
id json = @{
@"ConnectionId": @"10101",
@"ConnectionToken": @"10101010101",
@"DisconnectTimeout": @30,
@"ProtocolVersion": @"1.3.0.0",
@"TransportConnectTimeout": @10
};
[SRMockClientTransport negotiateForTransport:lp statusCode:@200 json:json];

id connect1 = [SRMockNetwork mockHttpRequestOperationForClass:[AFHTTPRequestOperation class]
statusCode:@500
Expand Down Expand Up @@ -149,20 +144,14 @@ - (void)testConnectionInitialNotCancelledPollsAgainAfterDelay {
SRConnection* connection = [[SRConnection alloc] initWithURLString:@"http://localhost:0000"];
SRLongPollingTransport* lp = [[ SRLongPollingTransport alloc] init];

id mockTransport = [OCMockObject partialMockForObject: lp];
[[[mockTransport stub] andDo:^(NSInvocation *invocation) {
void (^ callbackOut)(SRNegotiationResponse * response, NSError *error);
__unsafe_unretained void (^successCallback)(SRNegotiationResponse *response, NSError *error) = nil;
[invocation getArgument: &successCallback atIndex: 4];
callbackOut = successCallback;
callbackOut([[SRNegotiationResponse alloc ]initWithDictionary:@{
@"ConnectionId": @"10101",
@"ConnectionToken": @"10101010101",
@"DisconnectTimeout": @30,
@"ProtocolVersion": @"1.3.0.0",
@"TransportConnectTimeout": @10
}], nil);
}] negotiate:[OCMArg any] connectionData:[OCMArg any] completionHandler:[OCMArg any]];
id json = @{
@"ConnectionId": @"10101",
@"ConnectionToken": @"10101010101",
@"DisconnectTimeout": @30,
@"ProtocolVersion": @"1.3.0.0",
@"TransportConnectTimeout": @10
};
id mockTransport = [SRMockClientTransport negotiateForTransport:lp statusCode:@200 json:json];

[[[mockTransport stub] andForwardToRealObject] poll:[OCMArg any] connectionData:[OCMArg isNil] completionHandler:[OCMArg isNotNil]];
[[[mockTransport stub] andDo:^(NSInvocation * invocation) {
Expand Down
Loading

0 comments on commit f1c0eb6

Please sign in to comment.