From 8ffcfca8f94ace12ed4893d785766d2484632244 Mon Sep 17 00:00:00 2001 From: Andres Canal Date: Mon, 11 Jul 2016 15:57:49 -0300 Subject: [PATCH] added Token Based Reconnection and everything is tested --- .../XMPPStream+XMPPTBRAuthentication.h | 17 +++ .../XMPPStream+XMPPTBRAuthentication.m | 53 +++++++++ .../XMPPTBRAuthentication.h | 17 +++ .../XMPPTBRAuthentication.m | 71 ++++++++++++ .../XMPPTBReconnection.h | 21 ++++ .../XMPPTBReconnection.m | 81 +++++++++++++ Xcode/Testing-Shared/XMPPMockStream.h | 2 +- Xcode/Testing-Shared/XMPPMockStream.m | 11 ++ .../XMPPTBRAuthenticationTests.m | 77 +++++++++++++ .../Testing-Shared/XMPPTBReconnectionTests.m | 109 ++++++++++++++++++ .../project.pbxproj | 24 ++++ .../project.pbxproj | 24 ++++ 12 files changed, 506 insertions(+), 1 deletion(-) create mode 100644 Authentication/Token-Based-Reconnection/XMPPStream+XMPPTBRAuthentication.h create mode 100644 Authentication/Token-Based-Reconnection/XMPPStream+XMPPTBRAuthentication.m create mode 100644 Authentication/Token-Based-Reconnection/XMPPTBRAuthentication.h create mode 100644 Authentication/Token-Based-Reconnection/XMPPTBRAuthentication.m create mode 100644 Authentication/Token-Based-Reconnection/XMPPTBReconnection.h create mode 100644 Authentication/Token-Based-Reconnection/XMPPTBReconnection.m mode change 100644 => 100755 Xcode/Testing-Shared/XMPPMockStream.h mode change 100644 => 100755 Xcode/Testing-Shared/XMPPMockStream.m create mode 100644 Xcode/Testing-Shared/XMPPTBRAuthenticationTests.m create mode 100644 Xcode/Testing-Shared/XMPPTBReconnectionTests.m diff --git a/Authentication/Token-Based-Reconnection/XMPPStream+XMPPTBRAuthentication.h b/Authentication/Token-Based-Reconnection/XMPPStream+XMPPTBRAuthentication.h new file mode 100644 index 0000000000..e8c8bde407 --- /dev/null +++ b/Authentication/Token-Based-Reconnection/XMPPStream+XMPPTBRAuthentication.h @@ -0,0 +1,17 @@ +// +// XMPPStream+XMPPTBRAuthentication.h +// XMPPFramework +// +// Created by Andres Canal on 7/6/16. +// Copyright © 2016 Inaka. All rights reserved. +// + +#import "XMPPFramework.h" +#import "XMPPStream.h" + +@interface XMPPStream (XMPPTBRAuthentication) + +- (BOOL)authenticateWithTBR:(NSString *)authToken error:(NSError **)errPtr; +- (BOOL)supportsTBRAuthentication; + +@end diff --git a/Authentication/Token-Based-Reconnection/XMPPStream+XMPPTBRAuthentication.m b/Authentication/Token-Based-Reconnection/XMPPStream+XMPPTBRAuthentication.m new file mode 100644 index 0000000000..899557f40f --- /dev/null +++ b/Authentication/Token-Based-Reconnection/XMPPStream+XMPPTBRAuthentication.m @@ -0,0 +1,53 @@ +// +// XMPPStream+XMPPTBRAuthentication.m +// XMPPFramework +// +// Created by Andres Canal on 7/6/16. +// Copyright © 2016 Inaka. All rights reserved. +// + +#import "XMPPStream+XMPPTBRAuthentication.h" +#import "XMPPTBRAuthentication.h" +#import "XMPPInternal.h" + +@implementation XMPPStream (TBRAuthentication) + +- (BOOL)supportsTBRAuthentication{ + return [self supportsAuthenticationMechanism:[XMPPTBRAuthentication mechanismName]]; +} + +- (BOOL)authenticateWithTBR:(nonnull NSString *)authToken error:(NSError **)errPtr { + + __block BOOL result = YES; + __block NSError *err = nil; + + dispatch_block_t block = ^{ @autoreleasepool { + + if ([self supportsTBRAuthentication]) { + + XMPPTBRAuthentication *tbrAuthentication = [[XMPPTBRAuthentication alloc] initWithStream:self + token:authToken]; + + result = [self authenticate:tbrAuthentication error:&err]; + } else { + NSString *errMsg = @"The server does not support Token-based reconnection."; + NSDictionary *info = @{NSLocalizedDescriptionKey : errMsg}; + + err = [NSError errorWithDomain:XMPPStreamErrorDomain code:XMPPStreamUnsupportedAction userInfo:info]; + + result = NO; + } + }}; + + if (dispatch_get_specific(self.xmppQueueTag)) + block(); + else + dispatch_sync(self.xmppQueue, block); + + if (errPtr) + *errPtr = err; + + return result; +} + +@end diff --git a/Authentication/Token-Based-Reconnection/XMPPTBRAuthentication.h b/Authentication/Token-Based-Reconnection/XMPPTBRAuthentication.h new file mode 100644 index 0000000000..c1d6673a00 --- /dev/null +++ b/Authentication/Token-Based-Reconnection/XMPPTBRAuthentication.h @@ -0,0 +1,17 @@ +// +// XMPPTBRAuthentication.h +// XMPPFramework +// +// Created by Andres Canal on 7/6/16. +// Copyright © 2016 Inaka. All rights reserved. +// + +#import +#import "XMPPSASLAuthentication.h" +#import "XMPPStream.h" + +@interface XMPPTBRAuthentication : NSObject + +- (nonnull instancetype)initWithStream:(nonnull XMPPStream *)stream token:(nonnull NSString *)aToken; + +@end diff --git a/Authentication/Token-Based-Reconnection/XMPPTBRAuthentication.m b/Authentication/Token-Based-Reconnection/XMPPTBRAuthentication.m new file mode 100644 index 0000000000..4893605efb --- /dev/null +++ b/Authentication/Token-Based-Reconnection/XMPPTBRAuthentication.m @@ -0,0 +1,71 @@ +// +// XMPPTBRAuthentication.m +// XMPPFramework +// +// Created by Andres Canal on 7/6/16. +// Copyright © 2016 Inaka. All rights reserved. +// + +#import "XMPPTBRAuthentication.h" +#import "XMPPInternal.h" +#import "NSXMLElement+XMPP.h" + +@implementation XMPPTBRAuthentication { + #if __has_feature(objc_arc_weak) + __weak XMPPStream *xmppStream; + #else + __unsafe_unretained XMPPStream *xmppStream; + #endif + NSString *authToken; +} + ++ (NSString *)mechanismName { + return @"X-OAUTH"; +} + +- (id)initWithStream:(nonnull XMPPStream *)stream password:(nonnull NSString *)password { + return [super init]; +} + +- (id)initWithStream:(nonnull XMPPStream *)stream token:(nonnull NSString *)aToken { + if( self = [super init]) { + xmppStream = stream; + authToken = aToken; + } + + return self; +} + +- (BOOL)start:(NSError **)errPtr { + + if(!authToken) { + NSString *errMsg = @"Missing auth token."; + NSDictionary *info = @{NSLocalizedDescriptionKey : errMsg}; + + NSError *err = [NSError errorWithDomain:XMPPStreamErrorDomain code:XMPPStreamInvalidParameter userInfo:info]; + + if (errPtr) *errPtr = err; + return NO; + } + + // auth_token + + NSXMLElement *auth = [NSXMLElement elementWithName:@"auth" xmlns:@"urn:ietf:params:xml:ns:xmpp-sasl"]; + [auth addAttributeWithName:@"mechanism" stringValue:@"X-OAUTH"]; + auth.stringValue = authToken; + + [xmppStream sendAuthElement:auth]; + + return true; +} + +- (XMPPHandleAuthResponse)handleAuth:(NSXMLElement *)auth { + + if ([[auth name] isEqualToString:@"success"]) { + return XMPP_AUTH_SUCCESS; + } + + return XMPP_AUTH_FAIL; +} + +@end diff --git a/Authentication/Token-Based-Reconnection/XMPPTBReconnection.h b/Authentication/Token-Based-Reconnection/XMPPTBReconnection.h new file mode 100644 index 0000000000..ceb866fa42 --- /dev/null +++ b/Authentication/Token-Based-Reconnection/XMPPTBReconnection.h @@ -0,0 +1,21 @@ +// +// XMPPTBReconnection.h +// XMPPFramework +// +// Created by Andres Canal on 7/5/16. +// Copyright © 2016 Inaka. All rights reserved. +// + +#import "XMPPFramework.h" +#import "XMPPIDTracker.h" + +@interface XMPPTBReconnection : XMPPModule { + XMPPIDTracker *responseTracker; +} +- (void) getAuthToken; +@end + +@protocol XMPPTBReconnectionDelegate +- (void)xmppTBReconnection:(nonnull XMPPTBReconnection *)sender didReceiveToken:(nonnull NSDictionary *) token; +- (void)xmppTBReconnection:(nonnull XMPPTBReconnection *)sender didFailToReceiveToken:(nonnull XMPPIQ *)iq; +@end diff --git a/Authentication/Token-Based-Reconnection/XMPPTBReconnection.m b/Authentication/Token-Based-Reconnection/XMPPTBReconnection.m new file mode 100644 index 0000000000..0b8ac61409 --- /dev/null +++ b/Authentication/Token-Based-Reconnection/XMPPTBReconnection.m @@ -0,0 +1,81 @@ +// +// XMPPTBReconnection.m +// XMPPFramework +// +// Created by Andres Canal on 7/5/16. +// Copyright © 2016 Inaka. All rights reserved. +// + +#import "XMPPTBReconnection.h" +#import "XMPPFramework.h" +#import "XMPPIQ.h" + +@implementation XMPPTBReconnection + +- (void) getAuthToken { + // + // + // + + dispatch_block_t block = ^{ @autoreleasepool { + + NSString *iqID = [XMPPStream generateUUID]; + NSXMLElement *iq = [NSXMLElement elementWithName:@"iq"]; + [iq addAttributeWithName:@"id" stringValue:iqID]; + [iq addAttributeWithName:@"to" stringValue:self.xmppStream.myJID.full]; + [iq addAttributeWithName:@"type" stringValue:@"get"]; + + NSXMLElement *query = [NSXMLElement elementWithName:@"query" xmlns:@"erlang-solutions.com:xmpp:token-auth:0"]; + [iq addChild:query]; + + [responseTracker addID:iqID + target:self + selector:@selector(handleGetAuthToken:withInfo:) + timeout:60.0]; + + [xmppStream sendElement:iq]; + }}; + + if (dispatch_get_specific(moduleQueueTag)) + block(); + else + dispatch_async(moduleQueue, block); +} + +- (void)handleGetAuthToken:(XMPPIQ *)iq withInfo:(id )info { + if ([[iq type] isEqualToString:@"result"]){ + NSXMLElement *items = [iq elementForName:@"items"]; + + NSMutableDictionary *tokensDictionary = [[NSMutableDictionary alloc] init]; + for (NSXMLElement *element in items.children) { + tokensDictionary[element.name] = element.stringValue; + } + [multicastDelegate xmppTBReconnection:self didReceiveToken:tokensDictionary]; + }else{ + [multicastDelegate xmppTBReconnection:self didFailToReceiveToken:iq]; + } +} + +- (BOOL)activate:(XMPPStream *)aXmppStream { + if ([super activate:aXmppStream]){ + responseTracker = [[XMPPIDTracker alloc] initWithDispatchQueue:moduleQueue]; + + return YES; + } + return NO; +} + +- (BOOL)xmppStream:(XMPPStream *)sender didReceiveIQ:(XMPPIQ *)iq { + NSString *type = [iq type]; + if ([type isEqualToString:@"result"] || [type isEqualToString:@"error"]){ + return [responseTracker invokeForID:[iq elementID] withObject:iq]; + } + + return NO; +} + + +@end diff --git a/Xcode/Testing-Shared/XMPPMockStream.h b/Xcode/Testing-Shared/XMPPMockStream.h old mode 100644 new mode 100755 index 6fa7fce14f..97f03a1028 --- a/Xcode/Testing-Shared/XMPPMockStream.h +++ b/Xcode/Testing-Shared/XMPPMockStream.h @@ -13,6 +13,6 @@ - (void)fakeIQResponse:(XMPPIQ *) iq; - (void)fakeMessageResponse:(XMPPMessage *) message; +@property BOOL supportsTBR; @property (nonatomic, copy) void (^elementReceived)(XMPPElement *element); - @end diff --git a/Xcode/Testing-Shared/XMPPMockStream.m b/Xcode/Testing-Shared/XMPPMockStream.m old mode 100644 new mode 100755 index 0e5114c5cf..42c80f667c --- a/Xcode/Testing-Shared/XMPPMockStream.m +++ b/Xcode/Testing-Shared/XMPPMockStream.m @@ -22,6 +22,10 @@ - (BOOL) isAuthenticated { return YES; } +- (BOOL)supportsTBRAuthentication{ + return self.supportsTBR; +} + - (void)fakeMessageResponse:(XMPPMessage *) message { [self injectElement:message]; } @@ -37,4 +41,11 @@ - (void)sendElement:(XMPPElement *)element { } } +- (void)sendAuthElement:(XMPPElement *)element { + [super sendAuthElement:element]; + if(self.elementReceived) { + self.elementReceived(element); + } +} + @end \ No newline at end of file diff --git a/Xcode/Testing-Shared/XMPPTBRAuthenticationTests.m b/Xcode/Testing-Shared/XMPPTBRAuthenticationTests.m new file mode 100644 index 0000000000..450cba8219 --- /dev/null +++ b/Xcode/Testing-Shared/XMPPTBRAuthenticationTests.m @@ -0,0 +1,77 @@ +// +// XMPPTBRAuthenticationTests.m +// XMPPFrameworkTests +// +// Created by Andres Canal on 7/6/16. +// +// + +#import +#import "XMPPMockStream.h" +#import "XMPPTBReconnection.h" +#import "XMPPTBRAuthentication.h" +#import "XMPPJID.h" +#import "XMPPStream+XMPPTBRAuthentication.h" + +@interface XMPPTBRAuthenticationTests : XCTestCase +@property (nonatomic, strong) XCTestExpectation *delegateExpectation; +@end + +@implementation XMPPTBRAuthenticationTests + +- (void)testTBRNotSupported { + NSError *error; + + XMPPMockStream *streamTest = [[XMPPMockStream alloc] init]; + streamTest.supportsTBR = NO; + [streamTest authenticateWithTBR:@"token-token-token" error:&error]; + + XCTAssertEqualObjects(error.domain, XMPPStreamErrorDomain); + XCTAssertEqual(error.code, XMPPStreamUnsupportedAction); + XCTAssertEqualObjects(error.userInfo[NSLocalizedDescriptionKey], @"The server does not support Token-based reconnection."); +} + +- (void)testSuccessTBR { + self.delegateExpectation = [self expectationWithDescription:@"TBR expectation"]; + + XMPPMockStream *streamTest = [[XMPPMockStream alloc] init]; + streamTest.supportsTBR = YES; + streamTest.myJID = [XMPPJID jidWithString:@"andres@test.com"]; + + streamTest.elementReceived = ^void(NSXMLElement *element) { + XCTAssertEqualObjects(element.name, @"auth"); + XCTAssertEqualObjects([element attributeForName:@"mechanism"].stringValue, @"X-OAUTH"); + XCTAssertEqualObjects(element.stringValue, @"token-token-token"); + + [self.delegateExpectation fulfill]; + }; + + [streamTest authenticateWithTBR:@"token-token-token" error:nil]; + + [self waitForExpectationsWithTimeout:5 handler:^(NSError * _Nullable error) { + if(error){ + XCTFail(@"Expectation Failed with error: %@", error); + } + }]; +} + +- (void)testFailureHandleAuth { + XMPPMockStream *streamTest = [[XMPPMockStream alloc] init]; + XMPPTBRAuthentication *auth = [[XMPPTBRAuthentication alloc] initWithStream:streamTest token:@"test"]; + + NSXMLElement *failureElement = [NSXMLElement elementWithName:@"failure" xmlns:@"urn:ietf:params:xml:ns:xmpp-sasl"]; + NSXMLElement *notAuthorized = [NSXMLElement elementWithName:@"not-authorized"]; + [failureElement addChild:notAuthorized]; + + XCTAssertEqual([auth handleAuth:failureElement], XMPP_AUTH_FAIL); +} + +- (void)testSuccessHandleAuth { + XMPPMockStream *streamTest = [[XMPPMockStream alloc] init]; + XMPPTBRAuthentication *auth = [[XMPPTBRAuthentication alloc] initWithStream:streamTest token:@"test"]; + + NSXMLElement *successElement = [NSXMLElement elementWithName:@"success" xmlns:@"urn:ietf:params:xml:ns:xmpp-sasl"]; + XCTAssertEqual([auth handleAuth:successElement], XMPP_AUTH_SUCCESS); +} + +@end diff --git a/Xcode/Testing-Shared/XMPPTBReconnectionTests.m b/Xcode/Testing-Shared/XMPPTBReconnectionTests.m new file mode 100644 index 0000000000..ad98f77f0a --- /dev/null +++ b/Xcode/Testing-Shared/XMPPTBReconnectionTests.m @@ -0,0 +1,109 @@ +// +// XMPPTBReconnectionTests.m +// XMPPFrameworkTests +// +// Created by Andres Canal on 7/5/16. +// +// + +#import +#import "XMPPMockStream.h" +#import "XMPPTBReconnection.h" +#import "XMPPJID.h" + +@interface XMPPTBReconnectionTests : XCTestCase +@property (nonatomic, strong) XCTestExpectation *delegateResponseExpectation; +@end + +@implementation XMPPTBReconnectionTests + +- (void)testGetAuthToken { + self.delegateResponseExpectation = [self expectationWithDescription:@"receive message"]; + + XMPPMockStream *streamTest = [[XMPPMockStream alloc] init]; + XMPPTBReconnection *xmppTBRReconnection = [[XMPPTBReconnection alloc] init]; + [xmppTBRReconnection activate:streamTest]; + [xmppTBRReconnection addDelegate:self delegateQueue:dispatch_get_main_queue()]; + + __weak typeof(XMPPMockStream) *weakStreamTest = streamTest; + streamTest.elementReceived = ^void(NSXMLElement *element) { + NSXMLElement *query = [element elementForName:@"query"]; + XCTAssertEqualObjects(query.xmlns, @"erlang-solutions.com:xmpp:token-auth:0"); + XCTAssertEqualObjects([element attributeForName:@"type"].stringValue, @"get"); + + NSString *elementID = [element attributeForName:@"id"].stringValue; + [weakStreamTest fakeIQResponse:[self fakeIQWithID:elementID]]; + }; + [xmppTBRReconnection getAuthToken]; + + [self waitForExpectationsWithTimeout:2 handler:^(NSError * _Nullable error) { + if(error){ + XCTFail(@"Expectation Failed with error: %@", error); + } + }]; +} + +- (void)xmppTBReconnection:(XMPPTBReconnection *)sender didReceiveToken:(NSDictionary *)token { + XCTAssertEqualObjects(token[@"access_token"], @"ACCESS_TOKEN"); + XCTAssertEqualObjects(token[@"refresh_token"], @"REFRESH_TOKEN"); + [self.delegateResponseExpectation fulfill]; +} + +- (void)testGetAuthTokenWithError { + self.delegateResponseExpectation = [self expectationWithDescription:@"receive message"]; + + XMPPMockStream *streamTest = [[XMPPMockStream alloc] init]; + XMPPTBReconnection *xmppTBRReconnection = [[XMPPTBReconnection alloc] init]; + [xmppTBRReconnection activate:streamTest]; + [xmppTBRReconnection addDelegate:self delegateQueue:dispatch_get_main_queue()]; + + __weak typeof(XMPPMockStream) *weakStreamTest = streamTest; + streamTest.elementReceived = ^void(NSXMLElement *element) { + NSString *elementID = [element attributeForName:@"id"].stringValue; + [weakStreamTest fakeIQResponse:[self fakeIQWithError:elementID]]; + }; + [xmppTBRReconnection getAuthToken]; + + [self waitForExpectationsWithTimeout:2 handler:^(NSError * _Nullable error) { + if(error){ + XCTFail(@"Expectation Failed with error: %@", error); + } + }]; +} + +- (void)xmppTBReconnection:(XMPPTBReconnection *)sender didFailToReceiveToken:(XMPPIQ *)iq { + [self.delegateResponseExpectation fulfill]; +} + +- (XMPPIQ *)fakeIQWithError:(NSString *) elementID { + NSMutableString *s = [NSMutableString string]; + [s appendString: @""]; + [s appendString: @""]; + + NSError *error; + NSXMLDocument *doc = [[NSXMLDocument alloc] initWithXMLString:s options:0 error:&error]; + XMPPIQ *iq = [XMPPIQ iqFromElement:[doc rootElement]]; + [iq addAttributeWithName:@"id" stringValue:elementID]; + + return iq; +} + + +- (XMPPIQ *)fakeIQWithID:(NSString *) elementID { + NSMutableString *s = [NSMutableString string]; + [s appendString: @""]; + [s appendString: @" "]; + [s appendString: @" ACCESS_TOKEN"]; + [s appendString: @" REFRESH_TOKEN"]; + [s appendString: @" "]; + [s appendString: @""]; + + NSError *error; + NSXMLDocument *doc = [[NSXMLDocument alloc] initWithXMLString:s options:0 error:&error]; + XMPPIQ *iq = [XMPPIQ iqFromElement:[doc rootElement]]; + [iq addAttributeWithName:@"id" stringValue:elementID]; + + return iq; +} + +@end diff --git a/Xcode/Testing-iOS/XMPPFrameworkTests.xcodeproj/project.pbxproj b/Xcode/Testing-iOS/XMPPFrameworkTests.xcodeproj/project.pbxproj index a9edf5d839..791b5a653d 100644 --- a/Xcode/Testing-iOS/XMPPFrameworkTests.xcodeproj/project.pbxproj +++ b/Xcode/Testing-iOS/XMPPFrameworkTests.xcodeproj/project.pbxproj @@ -20,6 +20,8 @@ D973A0861D2F18040096F3ED /* XMPPURITests.m in Sources */ = {isa = PBXBuildFile; fileRef = D973A07A1D2F18040096F3ED /* XMPPURITests.m */; }; D973A0871D2F18040096F3ED /* XMPPvCardTests.m in Sources */ = {isa = PBXBuildFile; fileRef = D973A07B1D2F18040096F3ED /* XMPPvCardTests.m */; }; D973A0891D2F18310096F3ED /* XMPPSwift.swift in Sources */ = {isa = PBXBuildFile; fileRef = D973A0881D2F18310096F3ED /* XMPPSwift.swift */; }; + E0B3E9261D341EA200EAD41B /* XMPPTBRAuthenticationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E0B3E9241D341EA200EAD41B /* XMPPTBRAuthenticationTests.m */; }; + E0B3E9271D341EA200EAD41B /* XMPPTBReconnectionTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E0B3E9251D341EA200EAD41B /* XMPPTBReconnectionTests.m */; }; FDD2AB232C05507F2045FFFC /* Pods_XMPPFrameworkTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5CD0B17267211A912DE2098E /* Pods_XMPPFrameworkTests.framework */; }; /* End PBXBuildFile section */ @@ -44,6 +46,8 @@ D973A07A1D2F18040096F3ED /* XMPPURITests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = XMPPURITests.m; path = "../../Testing-Shared/XMPPURITests.m"; sourceTree = ""; }; D973A07B1D2F18040096F3ED /* XMPPvCardTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = XMPPvCardTests.m; path = "../../Testing-Shared/XMPPvCardTests.m"; sourceTree = ""; }; D973A0881D2F18310096F3ED /* XMPPSwift.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = XMPPSwift.swift; path = "../../Testing-Shared/XMPPSwift.swift"; sourceTree = ""; }; + E0B3E9241D341EA200EAD41B /* XMPPTBRAuthenticationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = XMPPTBRAuthenticationTests.m; path = "../../Testing-Shared/XMPPTBRAuthenticationTests.m"; sourceTree = ""; }; + E0B3E9251D341EA200EAD41B /* XMPPTBReconnectionTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = XMPPTBReconnectionTests.m; path = "../../Testing-Shared/XMPPTBReconnectionTests.m"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -91,6 +95,8 @@ D973A0791D2F18040096F3ED /* XMPPStorageHintTests.m */, D973A07A1D2F18040096F3ED /* XMPPURITests.m */, D973A07B1D2F18040096F3ED /* XMPPvCardTests.m */, + E0B3E9241D341EA200EAD41B /* XMPPTBRAuthenticationTests.m */, + E0B3E9251D341EA200EAD41B /* XMPPTBReconnectionTests.m */, 63F50D971C60208200CA0201 /* Info.plist */, D973A06E1D2F18030096F3ED /* XMPPFrameworkTests-Bridging-Header.h */, ); @@ -129,6 +135,7 @@ 63F50D901C60208100CA0201 /* Resources */, CCA1BE22B534ECFCFCF57023 /* [CP] Embed Pods Frameworks */, 72947C0BCD2C8A092200B05D /* [CP] Copy Pods Resources */, + 3D7644AE01223CFF7A270CB5 /* Embed Pods Frameworks */, ); buildRules = ( ); @@ -195,6 +202,21 @@ shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; showEnvVarsInLog = 0; }; + 3D7644AE01223CFF7A270CB5 /* Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Embed Pods Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-XMPPFrameworkTests/Pods-XMPPFrameworkTests-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; 72947C0BCD2C8A092200B05D /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -232,6 +254,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + E0B3E9271D341EA200EAD41B /* XMPPTBReconnectionTests.m in Sources */, D973A07C1D2F18040096F3ED /* CapabilitiesHashingTest.m in Sources */, D973A0811D2F18040096F3ED /* XMPPMUCLightTests.m in Sources */, D973A07D1D2F18040096F3ED /* EncodeDecodeTest.m in Sources */, @@ -241,6 +264,7 @@ D973A0861D2F18040096F3ED /* XMPPURITests.m in Sources */, D973A07F1D2F18040096F3ED /* XMPPMessageArchiveManagementTests.m in Sources */, D973A07E1D2F18040096F3ED /* XMPPHTTPFileUploadTests.m in Sources */, + E0B3E9261D341EA200EAD41B /* XMPPTBRAuthenticationTests.m in Sources */, D973A0821D2F18040096F3ED /* XMPPPushTests.swift in Sources */, D973A0851D2F18040096F3ED /* XMPPStorageHintTests.m in Sources */, D973A0891D2F18310096F3ED /* XMPPSwift.swift in Sources */, diff --git a/Xcode/Testing-macOS/XMPPFrameworkTests.xcodeproj/project.pbxproj b/Xcode/Testing-macOS/XMPPFrameworkTests.xcodeproj/project.pbxproj index ac6e688c7d..7ed6d20002 100644 --- a/Xcode/Testing-macOS/XMPPFrameworkTests.xcodeproj/project.pbxproj +++ b/Xcode/Testing-macOS/XMPPFrameworkTests.xcodeproj/project.pbxproj @@ -21,6 +21,8 @@ D973A0AE1D2F1EF60096F3ED /* XMPPSwift.swift in Sources */ = {isa = PBXBuildFile; fileRef = D973A0A11D2F1EF60096F3ED /* XMPPSwift.swift */; }; D973A0AF1D2F1EF60096F3ED /* XMPPURITests.m in Sources */ = {isa = PBXBuildFile; fileRef = D973A0A21D2F1EF60096F3ED /* XMPPURITests.m */; }; D973A0B01D2F1EF60096F3ED /* XMPPvCardTests.m in Sources */ = {isa = PBXBuildFile; fileRef = D973A0A31D2F1EF60096F3ED /* XMPPvCardTests.m */; }; + E0B3E92E1D34219100EAD41B /* XMPPTBRAuthenticationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E0B3E92C1D34219100EAD41B /* XMPPTBRAuthenticationTests.m */; }; + E0B3E92F1D34219100EAD41B /* XMPPTBReconnectionTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E0B3E92D1D34219100EAD41B /* XMPPTBReconnectionTests.m */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -43,6 +45,8 @@ D973A0A11D2F1EF60096F3ED /* XMPPSwift.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = XMPPSwift.swift; path = "../../Testing-Shared/XMPPSwift.swift"; sourceTree = ""; }; D973A0A21D2F1EF60096F3ED /* XMPPURITests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = XMPPURITests.m; path = "../../Testing-Shared/XMPPURITests.m"; sourceTree = ""; }; D973A0A31D2F1EF60096F3ED /* XMPPvCardTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = XMPPvCardTests.m; path = "../../Testing-Shared/XMPPvCardTests.m"; sourceTree = ""; }; + E0B3E92C1D34219100EAD41B /* XMPPTBRAuthenticationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = XMPPTBRAuthenticationTests.m; path = "../../Testing-Shared/XMPPTBRAuthenticationTests.m"; sourceTree = ""; }; + E0B3E92D1D34219100EAD41B /* XMPPTBReconnectionTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = XMPPTBReconnectionTests.m; path = "../../Testing-Shared/XMPPTBReconnectionTests.m"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -79,6 +83,8 @@ D973A08F1D2F1EB10096F3ED /* XMPPFrameworkTests */ = { isa = PBXGroup; children = ( + E0B3E92C1D34219100EAD41B /* XMPPTBRAuthenticationTests.m */, + E0B3E92D1D34219100EAD41B /* XMPPTBReconnectionTests.m */, D973A0961D2F1EF60096F3ED /* CapabilitiesHashingTest.m */, D973A0971D2F1EF60096F3ED /* EncodeDecodeTest.m */, D973A0981D2F1EF60096F3ED /* XMPPHTTPFileUploadTests.m */, @@ -119,6 +125,7 @@ D973A08C1D2F1EB10096F3ED /* Resources */, 2EA6C37B1D758323ECB52066 /* [CP] Embed Pods Frameworks */, 641866745039D77DBEB0D018 /* [CP] Copy Pods Resources */, + 85BCC75C994B829C73C56A4A /* Embed Pods Frameworks */, ); buildRules = ( ); @@ -215,6 +222,21 @@ shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-XMPPFrameworkTests/Pods-XMPPFrameworkTests-resources.sh\"\n"; showEnvVarsInLog = 0; }; + 85BCC75C994B829C73C56A4A /* Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Embed Pods Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-XMPPFrameworkTests/Pods-XMPPFrameworkTests-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -222,6 +244,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + E0B3E92F1D34219100EAD41B /* XMPPTBReconnectionTests.m in Sources */, D973A0A41D2F1EF60096F3ED /* CapabilitiesHashingTest.m in Sources */, D973A0A91D2F1EF60096F3ED /* XMPPMUCLightTests.m in Sources */, D973A0A51D2F1EF60096F3ED /* EncodeDecodeTest.m in Sources */, @@ -231,6 +254,7 @@ D973A0A81D2F1EF60096F3ED /* XMPPMockStream.m in Sources */, D973A0AC1D2F1EF60096F3ED /* XMPPRoomLightTests.m in Sources */, D973A0B01D2F1EF60096F3ED /* XMPPvCardTests.m in Sources */, + E0B3E92E1D34219100EAD41B /* XMPPTBRAuthenticationTests.m in Sources */, D973A0A71D2F1EF60096F3ED /* XMPPMessageArchiveManagementTests.m in Sources */, D973A0A61D2F1EF60096F3ED /* XMPPHTTPFileUploadTests.m in Sources */, D973A0AA1D2F1EF60096F3ED /* XMPPPushTests.swift in Sources */,