IOS-1518 Deprecate test util methods using MM-internals. IOS-1518
authorDirk Zimmermann <dz@pep.security>
Wed, 15 May 2019 16:35:25 +0200
branchIOS-1518
changeset 86317546a9fbf80e
parent 8630 56d4719116f7
child 8632 5d877367bbef
IOS-1518 Deprecate test util methods using MM-internals.
pEpForiOSTests/TestUtils/CdAccount+TestUtils.swift
pEpForiOSTests/TestUtils/CoreDataDrivenTestBase.swift
pEpForiOSTests/TestUtils/DecryptionAttemptCounterDelegate.swift
pEpForiOSTests/TestUtils/DecryptionUtil.swift
pEpForiOSTests/TestUtils/ImapUtil.swift
pEpForiOSTests/TestUtils/ReplicationServiceObserver.swift
pEpForiOSTests/TestUtils/TestUtil.swift
     1.1 --- a/pEpForiOSTests/TestUtils/CdAccount+TestUtils.swift	Wed May 15 16:35:25 2019 +0200
     1.2 +++ b/pEpForiOSTests/TestUtils/CdAccount+TestUtils.swift	Wed May 15 16:35:25 2019 +0200
     1.3 @@ -16,6 +16,7 @@
     1.4       - Note: The test for the `sendFrom` identity is very strict and will fail
     1.5       in cases like "two identities that 'only' differ in their username".
     1.6       */
     1.7 +    @available(*, deprecated, message: "777")
     1.8      public func allMessages(inFolderOfType type: FolderType,
     1.9                              sendFrom from: CdIdentity? = nil) -> [CdMessage] {
    1.10          guard let messages = CdMessage.all() as? [CdMessage] else {
     2.1 --- a/pEpForiOSTests/TestUtils/CoreDataDrivenTestBase.swift	Wed May 15 16:35:25 2019 +0200
     2.2 +++ b/pEpForiOSTests/TestUtils/CoreDataDrivenTestBase.swift	Wed May 15 16:35:25 2019 +0200
     2.3 @@ -58,6 +58,7 @@
     2.4  
     2.5      // MARK: - HELPER
     2.6  
     2.7 +    @available(*, deprecated, message: "777")
     2.8      func fetchMessages(parentName: String) {
     2.9          let expMailsFetched = expectation(description: "expMailsFetched")
    2.10  
     3.1 --- a/pEpForiOSTests/TestUtils/DecryptionAttemptCounterDelegate.swift	Wed May 15 16:35:25 2019 +0200
     3.2 +++ b/pEpForiOSTests/TestUtils/DecryptionAttemptCounterDelegate.swift	Wed May 15 16:35:25 2019 +0200
     3.3 @@ -12,6 +12,7 @@
     3.4  @testable import MessageModel //FIXME:
     3.5  import PEPObjCAdapterFramework
     3.6  
     3.7 +@available(*, deprecated, message: "777")
     3.8  class DecryptionAttemptCounterDelegate: DecryptMessagesOperationDelegateProtocol {
     3.9      var numberOfMessageDecryptAttempts = 0
    3.10  
     4.1 --- a/pEpForiOSTests/TestUtils/DecryptionUtil.swift	Wed May 15 16:35:25 2019 +0200
     4.2 +++ b/pEpForiOSTests/TestUtils/DecryptionUtil.swift	Wed May 15 16:35:25 2019 +0200
     4.3 @@ -12,6 +12,7 @@
     4.4  @testable import MessageModel
     4.5  
     4.6  class DecryptionUtil {
     4.7 +    @available(*, deprecated, message: "777")
     4.8      public static func decryptTheMessage(
     4.9          testCase: XCTestCase,
    4.10          backgroundQueue: OperationQueue,
     5.1 --- a/pEpForiOSTests/TestUtils/ImapUtil.swift	Wed May 15 16:35:25 2019 +0200
     5.2 +++ b/pEpForiOSTests/TestUtils/ImapUtil.swift	Wed May 15 16:35:25 2019 +0200
     5.3 @@ -14,6 +14,7 @@
     5.4  @testable import MessageModel
     5.5  
     5.6  extension XCTestCase {
     5.7 +    @available(*, deprecated, message: "777")
     5.8      public func loginIMAP(imapSyncData: ImapSyncData,
     5.9                            errorContainer: ServiceErrorProtocol,
    5.10                            queue: OperationQueue) {
    5.11 @@ -35,6 +36,7 @@
    5.12          })
    5.13      }
    5.14  
    5.15 +    @available(*, deprecated, message: "777")
    5.16      public func fetchFoldersIMAP(imapSyncData: ImapSyncData,
    5.17                                   queue: OperationQueue) {
    5.18          let expFoldersFetched = expectation(description: "expFoldersFetched")
    5.19 @@ -57,6 +59,7 @@
    5.20          })
    5.21      }
    5.22  
    5.23 +    @available(*, deprecated, message: "777")
    5.24      public func appendMailsIMAP(folder: CdFolder,
    5.25                                  imapSyncData: ImapSyncData,
    5.26                                  errorContainer: ServiceErrorProtocol,
    5.27 @@ -79,6 +82,7 @@
    5.28          })
    5.29      }
    5.30  
    5.31 +    @available(*, deprecated, message: "777")
    5.32      public func fetchNumberOfNewMails(errorContainer: ServiceErrorProtocol) -> Int? {
    5.33          let expNumMails = expectation(description: "expNumMails")
    5.34          var numMails: Int?
     6.1 --- a/pEpForiOSTests/TestUtils/ReplicationServiceObserver.swift	Wed May 15 16:35:25 2019 +0200
     6.2 +++ b/pEpForiOSTests/TestUtils/ReplicationServiceObserver.swift	Wed May 15 16:35:25 2019 +0200
     6.3 @@ -12,6 +12,7 @@
     6.4  @testable import MessageModel
     6.5  @testable import pEpForiOS
     6.6  
     6.7 +@available(*, deprecated, message: "777")
     6.8  class ReplicationServiceObserver: CustomDebugStringConvertible {
     6.9      let expAllSynced: XCTestExpectation?
    6.10      var expCanceled: XCTestExpectation?
     7.1 --- a/pEpForiOSTests/TestUtils/TestUtil.swift	Wed May 15 16:35:25 2019 +0200
     7.2 +++ b/pEpForiOSTests/TestUtils/TestUtil.swift	Wed May 15 16:35:25 2019 +0200
     7.3 @@ -228,6 +228,7 @@
     7.4  
     7.5      // MARK: - Sync Loop
     7.6  
     7.7 +    @available(*, deprecated, message: "777")
     7.8      static public func syncAndWait(numAccountsToSync: Int = 1, testCase: XCTestCase) {
     7.9          let replicationService = ReplicationService()
    7.10          replicationService.sleepTimeInSeconds = 0.1
    7.11 @@ -251,6 +252,8 @@
    7.12      }
    7.13  
    7.14      // MARK: - ReplicationService
    7.15 +
    7.16 +    @available(*, deprecated, message: "777")
    7.17      static public func cancelReplicationServiceAndWait(replicationService: ReplicationService, testCase: XCTestCase) {
    7.18          let del = ReplicationServiceObserver(
    7.19              expCanceled: testCase.expectation(description: "expCanceled"))
    7.20 @@ -567,6 +570,7 @@
    7.21  
    7.22      // MARK: - FOLDER
    7.23  
    7.24 +    @available(*, deprecated, message: "777")
    7.25      static func determineInterestingFolders(in cdAccount: CdAccount)
    7.26          -> [NetworkServiceWorker.FolderInfo] {
    7.27          let accountInfo = AccountConnectInfo(accountID: cdAccount.objectID)
    7.28 @@ -635,6 +639,7 @@
    7.29       After this function, you should have a self with generated key, and a partner ID
    7.30       you can do handshakes on.
    7.31       */
    7.32 +    @available(*, deprecated, message: "777")
    7.33      static func cdMessageAndSetUpPepFromMail(emailFilePath: String,
    7.34                                   decryptDelegate: DecryptMessagesOperationDelegateProtocol? = nil)
    7.35          -> (mySelf: CdIdentity, partner: CdIdentity, message: CdMessage)? {
    7.36 @@ -719,6 +724,7 @@
    7.37      /**
    7.38       Uses 'cdMessageAndSetUpPepFromMail', but returns the message as 'Message'.
    7.39       */
    7.40 +    @available(*, deprecated, message: "777")
    7.41      static func setUpPepFromMail(emailFilePath: String,
    7.42                                   decryptDelegate: DecryptMessagesOperationDelegateProtocol? = nil)
    7.43          -> (mySelf: Identity, partner: Identity, message: Message)? {