-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added VaultFormatIntegrationsTests for box, improved README's and int…
…egrate developer token.
- Loading branch information
Showing
9 changed files
with
301 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
129 changes: 129 additions & 0 deletions
129
CryptomatorCloudAccess.xcodeproj/xcshareddata/xcschemes/BoxIntegrationTests.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Scheme | ||
LastUpgradeVersion = "1500" | ||
version = "1.3"> | ||
<BuildAction | ||
parallelizeBuildables = "YES" | ||
buildImplicitDependencies = "YES"> | ||
</BuildAction> | ||
<TestAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
shouldUseLaunchSchemeArgsEnv = "YES"> | ||
<Testables> | ||
<TestableReference | ||
skipped = "NO"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "4ACA638D2615FDFF00D19304" | ||
BuildableName = "CryptomatorCloudAccessIntegrationTests.xctest" | ||
BlueprintName = "CryptomatorCloudAccessIntegrationTests" | ||
ReferencedContainer = "container:CryptomatorCloudAccess.xcodeproj"> | ||
</BuildableReference> | ||
<SkippedTests> | ||
<Test | ||
Identifier = "CloudAccessIntegrationTest"> | ||
</Test> | ||
<Test | ||
Identifier = "CloudAccessIntegrationTestWithAuthentication"> | ||
</Test> | ||
<Test | ||
Identifier = "CloudProvider_CreateIntermediateFolderTests"> | ||
</Test> | ||
<Test | ||
Identifier = "DropboxCloudProviderIntegrationTests"> | ||
</Test> | ||
<Test | ||
Identifier = "GoogleDriveAuthenticatorMockTests"> | ||
</Test> | ||
<Test | ||
Identifier = "GoogleDriveCloudProviderIntegrationTests"> | ||
</Test> | ||
<Test | ||
Identifier = "LocalFileSystemProviderIntegrationTests"> | ||
</Test> | ||
<Test | ||
Identifier = "OneDriveCloudProviderIntegrationTests"> | ||
</Test> | ||
<Test | ||
Identifier = "PCloudCloudProviderIntegrationTests"> | ||
</Test> | ||
<Test | ||
Identifier = "S3CloudProviderIntegrationTests"> | ||
</Test> | ||
<Test | ||
Identifier = "VaultFormat6DropboxIntegrationTests"> | ||
</Test> | ||
<Test | ||
Identifier = "VaultFormat6GoogleDriveIntegrationTests"> | ||
</Test> | ||
<Test | ||
Identifier = "VaultFormat6LocalFileSystemIntegrationTests"> | ||
</Test> | ||
<Test | ||
Identifier = "VaultFormat6OneDriveIntegrationTests"> | ||
</Test> | ||
<Test | ||
Identifier = "VaultFormat6PCloudIntegrationTests"> | ||
</Test> | ||
<Test | ||
Identifier = "VaultFormat6S3IntegrationTests"> | ||
</Test> | ||
<Test | ||
Identifier = "VaultFormat6WebDAVIntegrationTests"> | ||
</Test> | ||
<Test | ||
Identifier = "VaultFormat7DropboxIntegrationTests"> | ||
</Test> | ||
<Test | ||
Identifier = "VaultFormat7GoogleDriveIntegrationTests"> | ||
</Test> | ||
<Test | ||
Identifier = "VaultFormat7LocalFileSystemIntegrationTests"> | ||
</Test> | ||
<Test | ||
Identifier = "VaultFormat7OneDriveIntegrationTests"> | ||
</Test> | ||
<Test | ||
Identifier = "VaultFormat7PCloudIntegrationTests"> | ||
</Test> | ||
<Test | ||
Identifier = "VaultFormat7S3IntegrationTests"> | ||
</Test> | ||
<Test | ||
Identifier = "VaultFormat7WebDAVIntegrationTests"> | ||
</Test> | ||
<Test | ||
Identifier = "WebDAVCloudProviderIntegrationTests"> | ||
</Test> | ||
</SkippedTests> | ||
</TestableReference> | ||
</Testables> | ||
</TestAction> | ||
<LaunchAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
launchStyle = "0" | ||
useCustomWorkingDirectory = "NO" | ||
ignoresPersistentStateOnLaunch = "NO" | ||
debugDocumentVersioning = "YES" | ||
debugServiceExtension = "internal" | ||
allowLocationSimulation = "YES"> | ||
</LaunchAction> | ||
<ProfileAction | ||
buildConfiguration = "Release" | ||
shouldUseLaunchSchemeArgsEnv = "YES" | ||
savedToolIdentifier = "" | ||
useCustomWorkingDirectory = "NO" | ||
debugDocumentVersioning = "YES"> | ||
</ProfileAction> | ||
<AnalyzeAction | ||
buildConfiguration = "Debug"> | ||
</AnalyzeAction> | ||
<ArchiveAction | ||
buildConfiguration = "Release" | ||
revealArchiveInOrganizer = "YES"> | ||
</ArchiveAction> | ||
</Scheme> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
Tests/CryptomatorCloudAccessIntegrationTests/Box/BoxAuthenticatorMock.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// | ||
// BoxAuthenticatorMock.swift | ||
// CryptomatorCloudAccessIntegrationTests | ||
// | ||
// Created by Majid Achhoud on 25.04.24. | ||
// Copyright © 2024 Skymatic GmbH. All rights reserved. | ||
// | ||
|
||
import Foundation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
...AccessIntegrationTests/CryptoDecorator/VaultFormat6/VaultFormat6BoxIntegrationTests.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
// | ||
// VaultFormat6BoxIntegrationTests.swift | ||
// CryptomatorCloudAccessIntegrationTests | ||
// | ||
// Created by Majid Achhoud on 29.04.24. | ||
// Copyright © 2024 Skymatic GmbH. All rights reserved. | ||
// | ||
|
||
import XCTest | ||
#if canImport(CryptomatorCloudAccessCore) | ||
@testable import CryptomatorCloudAccessCore | ||
#else | ||
@testable import CryptomatorCloudAccess | ||
#endif | ||
@testable import Promises | ||
|
||
class VaultFormat6BoxIntegrationTests: CloudAccessIntegrationTest { | ||
override class var defaultTestSuite: XCTestSuite { | ||
return XCTestSuite(forTestCaseClass: VaultFormat6BoxIntegrationTests.self) | ||
} | ||
|
||
private static let credential = BoxCredentialMock() | ||
// swiftlint:disable:next force_try | ||
private static let cloudProvider = try! BoxCloudProvider(credential: credential) | ||
private static let vaultPath = CloudPath("/iOS-IntegrationTests-VaultFormat6") | ||
|
||
override class func setUp() { | ||
integrationTestParentCloudPath = CloudPath("/") | ||
let setUpPromise = cloudProvider.deleteFolderIfExisting(at: vaultPath).then { | ||
DecoratorFactory.createNewVaultFormat6(delegate: cloudProvider, vaultPath: vaultPath, password: "IntegrationTest") | ||
}.then { decorator in | ||
setUpProvider = decorator | ||
} | ||
guard waitForPromises(timeout: 60.0) else { | ||
classSetUpError = IntegrationTestError.oneTimeSetUpTimeout | ||
return | ||
} | ||
if let error = setUpPromise.error { | ||
classSetUpError = error | ||
return | ||
} | ||
super.setUp() | ||
} | ||
|
||
override func setUpWithError() throws { | ||
try super.setUpWithError() | ||
let credential = BoxCredentialMock() | ||
let cloudProvider = try BoxCloudProvider(credential: credential) | ||
let setUpPromise = DecoratorFactory.createFromExistingVaultFormat6(delegate: cloudProvider, vaultPath: VaultFormat6BoxIntegrationTests.vaultPath, password: "IntegrationTest").then { decorator in | ||
self.provider = decorator | ||
} | ||
guard waitForPromises(timeout: 60.0) else { | ||
if let error = setUpPromise.error { | ||
throw error | ||
} | ||
throw IntegrationTestError.setUpTimeout | ||
} | ||
} | ||
|
||
override func createLimitedCloudProvider() throws -> CloudProvider { | ||
let credential = BoxCredentialMock() | ||
let limitedDelegate = try BoxCloudProvider(credential: credential, maxPageSize: maxPageSizeForLimitedCloudProvider) | ||
let setUpPromise = DecoratorFactory.createFromExistingVaultFormat6(delegate: limitedDelegate, vaultPath: VaultFormat6BoxIntegrationTests.vaultPath, password: "IntegrationTest").then { decorator in | ||
self.provider = decorator | ||
} | ||
guard waitForPromises(timeout: 60.0) else { | ||
if let error = setUpPromise.error { | ||
throw error | ||
} | ||
throw IntegrationTestError.setUpTimeout | ||
} | ||
return try XCTUnwrap(setUpPromise.value) | ||
} | ||
} |
74 changes: 74 additions & 0 deletions
74
...AccessIntegrationTests/CryptoDecorator/VaultFormat7/VaultFormat7BoxIntegrationTests.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
// | ||
// VaultFormat7BoxIntegrationTests.swift | ||
// CryptomatorCloudAccessIntegrationTests | ||
// | ||
// Created by Majid Achhoud on 29.04.24. | ||
// Copyright © 2024 Skymatic GmbH. All rights reserved. | ||
// | ||
|
||
import XCTest | ||
#if canImport(CryptomatorCloudAccessCore) | ||
@testable import CryptomatorCloudAccessCore | ||
#else | ||
@testable import CryptomatorCloudAccess | ||
#endif | ||
@testable import Promises | ||
|
||
class VaultFormat7BoxIntegrationTests: CloudAccessIntegrationTest { | ||
override class var defaultTestSuite: XCTestSuite { | ||
return XCTestSuite(forTestCaseClass: VaultFormat7BoxIntegrationTests.self) | ||
} | ||
|
||
private static let credential = BoxCredentialMock() | ||
// swiftlint:disable:next force_try | ||
private static let cloudProvider = try! BoxCloudProvider(credential: credential) | ||
private static let vaultPath = CloudPath("/iOS-IntegrationTests-VaultFormat7") | ||
|
||
override class func setUp() { | ||
integrationTestParentCloudPath = CloudPath("/") | ||
let setUpPromise = cloudProvider.deleteFolderIfExisting(at: vaultPath).then { | ||
DecoratorFactory.createNewVaultFormat7(delegate: cloudProvider, vaultPath: vaultPath, password: "IntegrationTest") | ||
}.then { decorator in | ||
setUpProvider = decorator | ||
} | ||
guard waitForPromises(timeout: 60.0) else { | ||
classSetUpError = IntegrationTestError.oneTimeSetUpTimeout | ||
return | ||
} | ||
if let error = setUpPromise.error { | ||
classSetUpError = error | ||
return | ||
} | ||
super.setUp() | ||
} | ||
|
||
override func setUpWithError() throws { | ||
try super.setUpWithError() | ||
let credential = BoxCredentialMock() | ||
let cloudProvider = try BoxCloudProvider(credential: credential) | ||
let setUpPromise = DecoratorFactory.createFromExistingVaultFormat7(delegate: cloudProvider, vaultPath: VaultFormat7BoxIntegrationTests.vaultPath, password: "IntegrationTest").then { decorator in | ||
self.provider = decorator | ||
} | ||
guard waitForPromises(timeout: 60.0) else { | ||
if let error = setUpPromise.error { | ||
throw error | ||
} | ||
throw IntegrationTestError.setUpTimeout | ||
} | ||
} | ||
|
||
override func createLimitedCloudProvider() throws -> CloudProvider { | ||
let credential = BoxCredentialMock() | ||
let limitedDelegate = try BoxCloudProvider(credential: credential, maxPageSize: maxPageSizeForLimitedCloudProvider) | ||
let setUpPromise = DecoratorFactory.createFromExistingVaultFormat7(delegate: limitedDelegate, vaultPath: VaultFormat7BoxIntegrationTests.vaultPath, password: "IntegrationTest").then { decorator in | ||
self.provider = decorator | ||
} | ||
guard waitForPromises(timeout: 60.0) else { | ||
if let error = setUpPromise.error { | ||
throw error | ||
} | ||
throw IntegrationTestError.setUpTimeout | ||
} | ||
return try XCTUnwrap(setUpPromise.value) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters