-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Device and Platforms tests #65
Changes from 3 commits
aa4e74f
e05cfa8
4c71ac9
99c69c5
2e1d0a8
0c75fb3
3299e1b
ae60ab4
3c6056a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,21 +10,55 @@ import Foundation | |
|
||
public class Device : XcodeServerEntity { | ||
|
||
public let name: String | ||
public let simulator: Bool | ||
public let osVersion: String | ||
public let deviceType: String | ||
public let connected: Bool | ||
public let simulator: Bool | ||
public let modelCode: String // Enum? | ||
public let deviceType: String // Enum? | ||
public let modelName: String | ||
public let deviceECID: String? | ||
public let modelUTI: String | ||
public let activeProxiedDevice: Device? | ||
public let docType: String | ||
public let trusted: Bool | ||
public let name: String | ||
public let supported: Bool | ||
public let processor: String? | ||
public let identifier: String | ||
public let enabledForDevelopment: Bool | ||
public let serialNumber: String? | ||
public let platform: DevicePlatform.PlatformType | ||
public let architecture: String // Enum? | ||
public let isServer: Bool | ||
public let retina: Bool | ||
|
||
public required init(json: NSDictionary) { | ||
|
||
self.name = json.stringForKey("name") | ||
self.simulator = json.boolForKey("simulator") | ||
self.osVersion = json.stringForKey("osVersion") | ||
self.deviceType = json.stringForKey("deviceType") | ||
self.connected = json.boolForKey("connected") | ||
self.simulator = json.boolForKey("simulator") | ||
self.modelCode = json.stringForKey("modelCode") | ||
self.deviceType = json.stringForKey("deviceType") | ||
self.modelName = json.stringForKey("modelName") | ||
self.deviceECID = json.optionalStringForKey("deviceECID") | ||
self.modelUTI = json.stringForKey("modelUTI") | ||
if let proxyDevice: NSDictionary = json.optionalForKey("activeProxiedDevice") { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can just use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My mistake. Earlier I was trying to achieve this other wa around and this is a small artifact... |
||
self.activeProxiedDevice = Device(json: proxyDevice) | ||
} else { | ||
self.activeProxiedDevice = nil | ||
} | ||
self.docType = json.stringForKey("doc_type") | ||
self.trusted = json.boolForKey("trusted") | ||
self.name = json.stringForKey("name") | ||
self.supported = json.boolForKey("supported") | ||
self.processor = json.optionalStringForKey("processor") | ||
self.identifier = json.stringForKey("identifier") | ||
self.enabledForDevelopment = json.boolForKey("enabledForDevelopment") | ||
self.serialNumber = json.optionalStringForKey("serialNumber") | ||
self.platform = DevicePlatform.PlatformType(rawValue: json.stringForKey("platformIdentifier")) ?? .Unknown | ||
self.architecture = json.stringForKey("architecture") | ||
self.isServer = json.boolForKey("isServer") | ||
self.retina = json.boolForKey("retina") | ||
|
||
super.init(json: json) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docType
is an internal Xcode Server key used in CouchDB to identify the... surprise surprise... document type. If you want to add it, it should be added toXcodeServerEntity
instead, because it's also present in entities like bots and integrations.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I've noticed that later and I'll move it to
XcodeServerEntity
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
馃憤