Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename NoSerialiser to NoPersister #341

Merged
merged 1 commit into from
Jun 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Tests/SwiftQueueTests/BackgroundTasksTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class BackgroundTasksTest {

let creator = TestCreator([type: job])

let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoSerializer.shared).build()
let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoPersister.shared).build()
JobBuilder(type: type)
.periodic(executor: .background)
.internet(atLeast: .wifi)
Expand Down
2 changes: 1 addition & 1 deletion Tests/SwiftQueueTests/ConstraintTest+Charging.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class ConstraintTestCharging: XCTestCase {

let creator = TestCreator([type: job])

let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoSerializer.shared).build()
let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoPersister.shared).build()
JobBuilder(type: type)
.requireCharging()
.schedule(manager: manager)
Expand Down
6 changes: 3 additions & 3 deletions Tests/SwiftQueueTests/ConstraintTest+Deadline.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class ConstraintTestDeadline: XCTestCase {

let creator = TestCreator([type: job])

let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoSerializer.shared).build()
let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoPersister.shared).build()
JobBuilder(type: type)
.deadline(date: Date(timeIntervalSinceNow: TimeInterval(-10)))
.schedule(manager: manager)
Expand All @@ -45,7 +45,7 @@ class ConstraintTestDeadline: XCTestCase {
let (type2, job2) = (UUID().uuidString, TestJob())

let creator = TestCreator([type1: job1, type2: job2])
let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoSerializer.shared).build()
let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoPersister.shared).build()

JobBuilder(type: type1)
.delay(time: Double.leastNonzeroMagnitude)
Expand Down Expand Up @@ -97,7 +97,7 @@ class ConstraintTestDeadline: XCTestCase {

let creator = TestCreator([type: job])

let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoSerializer.shared).build()
let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoPersister.shared).build()
JobBuilder(type: type)
.delay(time: 60)
.deadline(date: Date(timeIntervalSinceNow: Double.leastNonzeroMagnitude))
Expand Down
2 changes: 1 addition & 1 deletion Tests/SwiftQueueTests/ConstraintTest+Delay.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class ConstraintTestDelay: XCTestCase {

let creator = TestCreator([type: job])

let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoSerializer.shared).build()
let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoPersister.shared).build()
JobBuilder(type: type)
.delay(time: 0.1)
.schedule(manager: manager)
Expand Down
4 changes: 2 additions & 2 deletions Tests/SwiftQueueTests/ConstraintTest+Network.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class ConstraintTestNetwork: XCTestCase {

let creator = TestCreator([type: job])

let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoSerializer.shared).build()
let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoPersister.shared).build()
JobBuilder(type: type)
.internet(atLeast: .cellular)
.schedule(manager: manager)
Expand All @@ -45,7 +45,7 @@ class ConstraintTestNetwork: XCTestCase {

let creator = TestCreator([type: job])

let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoSerializer.shared).build()
let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoPersister.shared).build()
JobBuilder(type: type)
.internet(atLeast: .wifi)
.schedule(manager: manager)
Expand Down
6 changes: 3 additions & 3 deletions Tests/SwiftQueueTests/ConstraintTest+Repeat.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class ConstraintTestRepeat: XCTestCase {

let creator = TestCreator([type: job])

let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoSerializer.shared).build()
let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoPersister.shared).build()
JobBuilder(type: type)
.periodic(limit: .limited(5))
.schedule(manager: manager)
Expand Down Expand Up @@ -61,7 +61,7 @@ class ConstraintTestRepeat: XCTestCase {

let creator = TestCreator([type: job])

let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoSerializer.shared).build()
let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoPersister.shared).build()
JobBuilder(type: type)
.periodic(limit: .unlimited)
.schedule(manager: manager)
Expand All @@ -79,7 +79,7 @@ class ConstraintTestRepeat: XCTestCase {

let creator = TestCreator([type: job])

let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoSerializer.shared).build()
let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoPersister.shared).build()
JobBuilder(type: type)
.periodic(limit: .limited(2), interval: Double.leastNonzeroMagnitude)
.schedule(manager: manager)
Expand Down
14 changes: 7 additions & 7 deletions Tests/SwiftQueueTests/ConstraintTest+Retry.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class ConstraintTestRetry: XCTestCase {

let creator = TestCreator([type: job])

let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoSerializer.shared).build()
let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoPersister.shared).build()
JobBuilder(type: type)
.retry(limit: .unlimited)
.schedule(manager: manager)
Expand All @@ -63,7 +63,7 @@ class ConstraintTestRetry: XCTestCase {

let creator = TestCreator([type: job])

let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoSerializer.shared).build()
let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoPersister.shared).build()
JobBuilder(type: type)
.retry(limit: .limited(2))
.schedule(manager: manager)
Expand All @@ -82,7 +82,7 @@ class ConstraintTestRetry: XCTestCase {

let creator = TestCreator([type: job])

let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoSerializer.shared).build()
let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoPersister.shared).build()
JobBuilder(type: type)
.retry(limit: .limited(2))
.schedule(manager: manager)
Expand All @@ -101,7 +101,7 @@ class ConstraintTestRetry: XCTestCase {

let creator = TestCreator([type: job])

let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoSerializer.shared).build()
let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoPersister.shared).build()
JobBuilder(type: type)
.retry(limit: .limited(2))
.schedule(manager: manager)
Expand All @@ -120,7 +120,7 @@ class ConstraintTestRetry: XCTestCase {

let creator = TestCreator([type: job])

let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoSerializer.shared).build()
let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoPersister.shared).build()
JobBuilder(type: type)
.retry(limit: .limited(1))
.periodic()
Expand All @@ -139,7 +139,7 @@ class ConstraintTestRetry: XCTestCase {

let creator = TestCreator([type: job])

let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoSerializer.shared).build()
let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoPersister.shared).build()
JobBuilder(type: type)
.retry(limit: .limited(2))
.schedule(manager: manager)
Expand All @@ -158,7 +158,7 @@ class ConstraintTestRetry: XCTestCase {

let creator = TestCreator([type: job])

let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoSerializer.shared).build()
let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoPersister.shared).build()
JobBuilder(type: type)
.retry(limit: .limited(2))
.schedule(manager: manager)
Expand Down
2 changes: 1 addition & 1 deletion Tests/SwiftQueueTests/ConstraintTest+Tag.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class ConstraintTestTag: XCTestCase {

let creator = TestCreator([type: job])

manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoSerializer.shared).build()
manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoPersister.shared).build()

manager?.enqueue(info: JobBuilder(type: type).addTag(tag: tag).build())

Expand Down
2 changes: 1 addition & 1 deletion Tests/SwiftQueueTests/ConstraintTest+Timeout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class ConstraintTestTimeout: XCTestCase {

let creator = TestCreator([type: job])

let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoSerializer.shared).build()
let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoPersister.shared).build()

JobBuilder(type: type)
.timeout(value: 0)
Expand Down
4 changes: 2 additions & 2 deletions Tests/SwiftQueueTests/ConstraintTest+UniqueUUID.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class ConstraintTestUniqueUUID: XCTestCase {

let creator = TestCreator([type1: job1, type2: job2])

let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoSerializer.shared).build()
let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoPersister.shared).build()
JobBuilder(type: type1)
.singleInstance(forId: id)
.delay(time: 3600)
Expand All @@ -57,7 +57,7 @@ class ConstraintTestUniqueUUID: XCTestCase {

let creator = TestCreator([type1: job1, type2: job2])

let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoSerializer.shared).build()
let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoPersister.shared).build()
JobBuilder(type: type1)
.singleInstance(forId: id)
.delay(time: 3600)
Expand Down
2 changes: 1 addition & 1 deletion Tests/SwiftQueueTests/LoggerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class LoggerTests: XCTestCase {

let creator = TestCreator([type: job])

let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoSerializer.shared).set(logger: debugLogger).build()
let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoPersister.shared).set(logger: debugLogger).build()
JobBuilder(type: type)
.singleInstance(forId: id)
.schedule(manager: manager)
Expand Down
4 changes: 2 additions & 2 deletions Tests/SwiftQueueTests/StartStopTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class StartStopTests: XCTestCase {
let creator = TestCreator([type: job])

let manager = SwiftQueueManagerBuilder(creator: creator)
.set(persister: NoSerializer.shared)
.set(persister: NoPersister.shared)
.set(isSuspended: true)
.build()

Expand All @@ -51,7 +51,7 @@ class StartStopTests: XCTestCase {

let creator = TestCreator([type: job])

let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoSerializer.shared).build()
let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoPersister.shared).build()

manager.isSuspended = true

Expand Down
2 changes: 1 addition & 1 deletion Tests/SwiftQueueTests/SwiftQueueBuilderTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class SwiftQueueBuilderTests: XCTestCase {

let creator = TestCreator([type: TestJob()])
let manager = SwiftQueueManagerBuilder(creator: creator)
.set(persister: NoSerializer.shared)
.set(persister: NoPersister.shared)
.build()

// No assert expected
Expand Down
10 changes: 5 additions & 5 deletions Tests/SwiftQueueTests/SwiftQueueManagerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class SwiftQueueManagerTests: XCTestCase {

let creator = TestCreator([type: job])

let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoSerializer.shared).build()
let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoPersister.shared).build()
JobBuilder(type: type)
.priority(priority: .veryHigh)
.service(quality: .background)
Expand All @@ -48,7 +48,7 @@ class SwiftQueueManagerTests: XCTestCase {
let listener = JobListenerTest()

let manager = SwiftQueueManagerBuilder(creator: creator)
.set(persister: NoSerializer.shared)
.set(persister: NoPersister.shared)
.set(isSuspended: true)
.set(listener: listener)
.build()
Expand Down Expand Up @@ -172,7 +172,7 @@ class SwiftQueueManagerTests: XCTestCase {
let params = SqManagerParams(
jobCreator: TestCreator([:]),
queueCreator: BasicQueueCreator(),
persister: UserDefaultsPersister(),
persister: NoPersister.shared,
serializer: DecodableSerializer(),
logger: NoLogger.shared,
listener: nil,
Expand Down Expand Up @@ -216,7 +216,7 @@ class SwiftQueueManagerTests: XCTestCase {

public func testGetAll() {
let creator = TestCreator([:])
let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoSerializer.shared).build()
let manager = SwiftQueueManagerBuilder(creator: creator).set(persister: NoPersister.shared).build()

XCTAssertEqual(0, manager.getAll().count)
}
Expand All @@ -232,7 +232,7 @@ class SwiftQueueManagerTests: XCTestCase {
let creator = TestCreator([type: job])

manager = SwiftQueueManagerBuilder(creator: creator)
.set(persister: NoSerializer.shared)
.set(persister: NoPersister.shared)
.set(dispatchQueue: DispatchQueue.main)
.build()

Expand Down
4 changes: 2 additions & 2 deletions Tests/SwiftQueueTests/TestUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,9 @@ extension SqOperation {

}

class NoSerializer: JobPersister {
class NoPersister: JobPersister {

public static let shared = NoSerializer()
public static let shared = NoPersister()

private init() {}

Expand Down