WIP: the great renaming

This commit is contained in:
John Rommel Estropia
2016-07-21 23:12:24 +09:00
parent 872e69ddc6
commit 2f39f9188b
14 changed files with 68 additions and 60 deletions

View File

@@ -30,7 +30,7 @@ class BaseTestDataTestCase: BaseTestCase {
@nonobjc
func prepareTestDataForStack(_ stack: DataStack, configurations: [String?] = [nil]) {
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
for (configurationIndex, configuration) in configurations.enumerated() {

View File

@@ -73,7 +73,7 @@ final class FetchTests: BaseTestDataTestCase {
let fetchExpectation = self.expectation(withDescription: "fetch")
var existing1: TestEntity1?
_ = _ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
existing1 = transaction.fetchExisting(object)
XCTAssertNotNil(existing1)
@@ -166,7 +166,7 @@ final class FetchTests: BaseTestDataTestCase {
let fetchExpectation = self.expectation(withDescription: "fetch")
var existing1 = [TestEntity1]()
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
existing1 = transaction.fetchExisting(objects)
XCTAssertEqual(
@@ -1724,7 +1724,7 @@ final class FetchTests: BaseTestDataTestCase {
self.prepareTestDataForStack(stack, configurations: configurations)
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
let from = From<TestEntity1>()
do {
@@ -1768,7 +1768,7 @@ final class FetchTests: BaseTestDataTestCase {
XCTAssertNil(objectID)
}
}
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
let from = From<TestEntity1>(nil)
do {
@@ -1812,7 +1812,7 @@ final class FetchTests: BaseTestDataTestCase {
XCTAssertNil(objectID)
}
}
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
let from = From<TestEntity1>("Config1")
do {
@@ -1863,7 +1863,7 @@ final class FetchTests: BaseTestDataTestCase {
self.prepareTestDataForStack(stack, configurations: configurations)
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
let from = From<TestEntity1>()
do {
@@ -1907,7 +1907,7 @@ final class FetchTests: BaseTestDataTestCase {
XCTAssertNil(objectID)
}
}
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
let from = From<TestEntity1>(nil)
do {
@@ -1951,7 +1951,7 @@ final class FetchTests: BaseTestDataTestCase {
XCTAssertNil(objectID)
}
}
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
let from = From<TestEntity1>("Config1")
do {
@@ -1995,7 +1995,7 @@ final class FetchTests: BaseTestDataTestCase {
XCTAssertNil(objectID)
}
}
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
let from = From<TestEntity1>("Config2")
do {
@@ -2046,7 +2046,7 @@ final class FetchTests: BaseTestDataTestCase {
self.prepareTestDataForStack(stack, configurations: configurations)
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
let from = From<TestEntity1>(nil, "Config1")
do {
@@ -2090,7 +2090,7 @@ final class FetchTests: BaseTestDataTestCase {
XCTAssertNil(objectID)
}
}
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
let from = From<TestEntity1>(nil, "Config2")
do {
@@ -2134,7 +2134,7 @@ final class FetchTests: BaseTestDataTestCase {
XCTAssertNil(objectID)
}
}
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
let from = From<TestEntity1>("Config1", "Config2")
do {
@@ -2189,7 +2189,7 @@ final class FetchTests: BaseTestDataTestCase {
self.prepareTestDataForStack(stack, configurations: configurations)
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
let from = From<TestEntity1>()
do {
@@ -2259,7 +2259,7 @@ final class FetchTests: BaseTestDataTestCase {
XCTAssertEqual(objectIDs?.count, 0)
}
}
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
let from = From<TestEntity1>(nil)
do {
@@ -2329,7 +2329,7 @@ final class FetchTests: BaseTestDataTestCase {
XCTAssertEqual(objectIDs?.count, 0)
}
}
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
let from = From<TestEntity1>("Config1")
do {
@@ -2380,7 +2380,7 @@ final class FetchTests: BaseTestDataTestCase {
self.prepareTestDataForStack(stack, configurations: configurations)
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
let from = From<TestEntity1>()
do {
@@ -2444,7 +2444,7 @@ final class FetchTests: BaseTestDataTestCase {
XCTAssertEqual(objectIDs?.count, 0)
}
}
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
let from = From<TestEntity1>(nil)
do {
@@ -2512,7 +2512,7 @@ final class FetchTests: BaseTestDataTestCase {
XCTAssertEqual(objectIDs?.count, 0)
}
}
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
let from = From<TestEntity1>("Config1")
do {
@@ -2580,7 +2580,7 @@ final class FetchTests: BaseTestDataTestCase {
XCTAssertEqual(objectIDs?.count, 0)
}
}
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
let from = From<TestEntity1>("Config2")
do {
@@ -2629,7 +2629,7 @@ final class FetchTests: BaseTestDataTestCase {
self.prepareTestDataForStack(stack, configurations: configurations)
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
let from = From<TestEntity1>(nil, "Config1")
do {
@@ -2693,7 +2693,7 @@ final class FetchTests: BaseTestDataTestCase {
XCTAssertEqual(objectIDs?.count, 0)
}
}
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
let from = From<TestEntity1>(nil, "Config2")
do {
@@ -2761,7 +2761,7 @@ final class FetchTests: BaseTestDataTestCase {
XCTAssertEqual(objectIDs?.count, 0)
}
}
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
let from = From<TestEntity1>("Config1", "Config2")
do {
@@ -2840,7 +2840,7 @@ final class FetchTests: BaseTestDataTestCase {
self.prepareTestDataForStack(stack, configurations: configurations)
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
let from = From<TestEntity1>()
do {
@@ -2876,7 +2876,7 @@ final class FetchTests: BaseTestDataTestCase {
XCTAssertEqual(count, 0)
}
}
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
let from = From<TestEntity1>(nil)
do {
@@ -2912,7 +2912,7 @@ final class FetchTests: BaseTestDataTestCase {
XCTAssertEqual(count, 0)
}
}
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
let from = From<TestEntity1>("Config1")
do {
@@ -2951,7 +2951,7 @@ final class FetchTests: BaseTestDataTestCase {
self.prepareTestDataForStack(stack, configurations: configurations)
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
let from = From<TestEntity1>()
do {
@@ -2987,7 +2987,7 @@ final class FetchTests: BaseTestDataTestCase {
XCTAssertEqual(count, 0)
}
}
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
let from = From<TestEntity1>(nil)
do {
@@ -3023,7 +3023,7 @@ final class FetchTests: BaseTestDataTestCase {
XCTAssertEqual(count, 0)
}
}
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
let from = From<TestEntity1>("Config1")
do {
@@ -3059,7 +3059,7 @@ final class FetchTests: BaseTestDataTestCase {
XCTAssertEqual(count, 0)
}
}
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
let from = From<TestEntity1>("Config2")
do {
@@ -3098,7 +3098,7 @@ final class FetchTests: BaseTestDataTestCase {
self.prepareTestDataForStack(stack, configurations: configurations)
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
let from = From<TestEntity1>(nil, "Config1")
do {
@@ -3134,7 +3134,7 @@ final class FetchTests: BaseTestDataTestCase {
XCTAssertEqual(count, 0)
}
}
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
let from = From<TestEntity1>(nil, "Config2")
do {
@@ -3170,7 +3170,7 @@ final class FetchTests: BaseTestDataTestCase {
XCTAssertEqual(count, 0)
}
}
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
let from = From<TestEntity1>("Config1", "Config2")
do {

View File

@@ -38,7 +38,7 @@ class ImportTests: BaseTestDataTestCase {
self.prepareStack { (stack) in
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
do {
@@ -70,7 +70,7 @@ class ImportTests: BaseTestDataTestCase {
self.prepareStack { (stack) in
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
let errorExpectation = self.expectation(withDescription: "error")
do {
@@ -119,7 +119,7 @@ class ImportTests: BaseTestDataTestCase {
self.prepareStack { (stack) in
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
do {
@@ -178,7 +178,7 @@ class ImportTests: BaseTestDataTestCase {
self.prepareStack { (stack) in
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
do {
@@ -232,7 +232,7 @@ class ImportTests: BaseTestDataTestCase {
self.prepareStack { (stack) in
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
let errorExpectation = self.expectation(withDescription: "error")
do {
@@ -292,7 +292,7 @@ class ImportTests: BaseTestDataTestCase {
self.prepareStack { (stack) in
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
do {
@@ -351,7 +351,7 @@ class ImportTests: BaseTestDataTestCase {
self.prepareTestDataForStack(stack)
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
do {
@@ -421,7 +421,7 @@ class ImportTests: BaseTestDataTestCase {
self.prepareTestDataForStack(stack)
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
do {
@@ -521,7 +521,7 @@ class ImportTests: BaseTestDataTestCase {
self.prepareTestDataForStack(stack)
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
do {
@@ -600,7 +600,7 @@ class ImportTests: BaseTestDataTestCase {
self.prepareTestDataForStack(stack)
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
do {
@@ -658,7 +658,7 @@ class ImportTests: BaseTestDataTestCase {
self.prepareTestDataForStack(stack)
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
let errorExpectation = self.expectation(withDescription: "error")
do {
@@ -705,7 +705,7 @@ class ImportTests: BaseTestDataTestCase {
self.checkExpectationsImmediately()
transaction.context.reset()
}
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
let errorExpectation = self.expectation(withDescription: "error")
do {
@@ -758,7 +758,7 @@ class ImportTests: BaseTestDataTestCase {
self.checkExpectationsImmediately()
transaction.context.reset()
}
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
let errorExpectation = self.expectation(withDescription: "error")
do {
@@ -820,7 +820,7 @@ class ImportTests: BaseTestDataTestCase {
self.prepareTestDataForStack(stack)
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
do {

View File

@@ -43,7 +43,7 @@ final class TransactionTests: BaseTestCase {
do {
let createExpectation = self.expectation(withDescription: "create")
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
let object = transaction.create(Into<TestEntity1>())
object.testEntityID = NSNumber(value: 1)
@@ -75,7 +75,7 @@ final class TransactionTests: BaseTestCase {
do {
let updateExpectation = self.expectation(withDescription: "update")
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
guard let object = transaction.fetchOne(From<TestEntity1>()) else {
@@ -110,7 +110,7 @@ final class TransactionTests: BaseTestCase {
do {
let deleteExpectation = self.expectation(withDescription: "delete")
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
let object = transaction.fetchOne(From<TestEntity1>())
transaction.delete(object)
@@ -144,7 +144,7 @@ final class TransactionTests: BaseTestCase {
do {
let createExpectation = self.expectation(withDescription: "create")
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
let object = transaction.create(Into<TestEntity1>("Config1"))
object.testEntityID = NSNumber(value: 1)
@@ -177,7 +177,7 @@ final class TransactionTests: BaseTestCase {
do {
let updateExpectation = self.expectation(withDescription: "update")
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
guard let object = transaction.fetchOne(From<TestEntity1>("Config1")) else {
@@ -213,7 +213,7 @@ final class TransactionTests: BaseTestCase {
do {
let deleteExpectation = self.expectation(withDescription: "delete")
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
let object = transaction.fetchOne(From<TestEntity1>("Config1"))
transaction.delete(object)
@@ -245,7 +245,7 @@ final class TransactionTests: BaseTestCase {
let createDiscardExpectation = self.expectation(withDescription: "create-discard")
let loggerExpectations = self.prepareLoggerExpectations([.logWarning])
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
let object = transaction.create(Into<TestEntity1>())
object.testEntityID = NSNumber(value: 1)
@@ -267,7 +267,7 @@ final class TransactionTests: BaseTestCase {
do {
let createExpectation = self.expectation(withDescription: "create")
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
let object = transaction.create(Into<TestEntity1>())
object.testEntityID = NSNumber(value: 1)
@@ -290,7 +290,7 @@ final class TransactionTests: BaseTestCase {
let updateDiscardExpectation = self.expectation(withDescription: "update-discard")
let loggerExpectations = self.prepareLoggerExpectations([.logWarning])
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
guard let object = transaction.fetchOne(From<TestEntity1>()) else {
@@ -319,7 +319,7 @@ final class TransactionTests: BaseTestCase {
let deleteDiscardExpectation = self.expectation(withDescription: "delete-discard")
let loggerExpectations = self.prepareLoggerExpectations([.logWarning])
_ = stack.beginSynchronous { (transaction) in
stack.beginSynchronous { (transaction) in
guard let object = transaction.fetchOne(From<TestEntity1>()) else {

View File

@@ -76,7 +76,7 @@ internal final class FetchedResultsControllerDelegate<EntityType: NSManagedObjec
// MARK: NSFetchedResultsControllerDelegate
@objc
dynamic func controllerWillChangeContent(_ controller: NSFetchedResultsController<NSFetchRequestResult>) {
dynamic func controllerWillChangeContent(_ controller: NSFetchedResultsController<NSFetchRequestResult>) {
guard self.enabled else {

View File

@@ -58,6 +58,7 @@ public final class CSAsynchronousDataTransaction: CSBaseDataTransaction {
- returns: a `CSSaveResult` value indicating success or failure, or `nil` if the transaction was not comitted synchronously
*/
@objc
@discardableResult
public func beginSynchronous(_ closure: (transaction: CSSynchronousDataTransaction) -> Void) -> CSSaveResult? {
return bridge {

View File

@@ -51,6 +51,7 @@ public extension CSCoreStore {
- returns: a `CSSaveResult` value indicating success or failure, or `nil` if the transaction was not comitted synchronously
*/
@objc
@discardableResult
public static func beginSynchronous(_ closure: (transaction: CSSynchronousDataTransaction) -> Void) -> CSSaveResult? {
return bridge {

View File

@@ -51,6 +51,7 @@ public extension CSDataStack {
- returns: a `CSSaveResult` value indicating success or failure, or `nil` if the transaction was not comitted synchronously
*/
@objc
@discardableResult
public func beginSynchronous(_ closure: (transaction: CSSynchronousDataTransaction) -> Void) -> CSSaveResult? {
return bridge {

View File

@@ -58,6 +58,7 @@ public final class CSSynchronousDataTransaction: CSBaseDataTransaction {
- returns: a `CSSaveResult` value indicating success or failure, or `nil` if the transaction was not comitted synchronously
*/
@objc
@discardableResult
public func beginSynchronous(_ closure: (transaction: CSSynchronousDataTransaction) -> Void) -> CSSaveResult? {
return bridge {

View File

@@ -367,8 +367,8 @@ extension ObjectMonitor: FetchedResultsControllerHandler {
private extension Notification.Name {
private static let objectMonitorWillChangeObject = Notification.Name(rawValue: "objectMonitorWillChangeObject")
private static let objectMonitorDidDeleteObject = Notification.Name(rawValue: "objectMonitorWillChangeObject")
private static let objectMonitorDidUpdateObject = Notification.Name(rawValue: "objectMonitorWillChangeObject")
private static let objectMonitorDidDeleteObject = Notification.Name(rawValue: "objectMonitorDidDeleteObject")
private static let objectMonitorDidUpdateObject = Notification.Name(rawValue: "objectMonitorDidUpdateObject")
}
#endif

View File

@@ -71,6 +71,7 @@ public final class AsynchronousDataTransaction: BaseDataTransaction {
- parameter closure: the block where creates, updates, and deletes can be made to the transaction. Transaction blocks are executed serially in a background queue, and all changes are made from a concurrent `NSManagedObjectContext`.
- returns: a `SaveResult` value indicating success or failure, or `nil` if the transaction was not comitted synchronously
*/
@discardableResult
public func beginSynchronous(_ closure: (transaction: SynchronousDataTransaction) -> Void) -> SaveResult? {
CoreStore.assert(

View File

@@ -46,6 +46,7 @@ public extension CoreStore {
- parameter closure: the block where creates, updates, and deletes can be made to the transaction. Transaction blocks are executed serially in a background queue, and all changes are made from a concurrent `NSManagedObjectContext`.
- returns: a `SaveResult` value indicating success or failure, or `nil` if the transaction was not comitted synchronously
*/
@discardableResult
public static func beginSynchronous(_ closure: (transaction: SynchronousDataTransaction) -> Void) -> SaveResult? {
return self.defaultStack.beginSynchronous(closure)

View File

@@ -53,6 +53,7 @@ public extension DataStack {
- parameter closure: the block where creates, updates, and deletes can be made to the transaction. Transaction blocks are executed serially in a background queue, and all changes are made from a concurrent `NSManagedObjectContext`.
- returns: a `SaveResult` value indicating success or failure, or `nil` if the transaction was not comitted synchronously
*/
@discardableResult
public func beginSynchronous(_ closure: (transaction: SynchronousDataTransaction) -> Void) -> SaveResult? {
return SynchronousDataTransaction(

View File

@@ -66,6 +66,7 @@ public final class SynchronousDataTransaction: BaseDataTransaction {
- parameter closure: the block where creates, updates, and deletes can be made to the transaction. Transaction blocks are executed serially in a background queue, and all changes are made from a concurrent `NSManagedObjectContext`.
- returns: a `SaveResult` value indicating success or failure, or `nil` if the transaction was not comitted synchronously
*/
@discardableResult
public func beginSynchronous(_ closure: (transaction: SynchronousDataTransaction) -> Void) -> SaveResult? {
CoreStore.assert(