@@ -343,85 +343,85 @@ class PostgreSQLConnectionTests: XCTestCase {
343
343
_ = try categories. wait ( )
344
344
}
345
345
346
- func testNotifyAndListen( ) throws {
347
- let completionHandlerExpectation1 = expectation ( description: " first completion handler called " )
348
- let completionHandlerExpectation2 = expectation ( description: " final completion handler called " )
349
- let notifyConn = try PostgreSQLConnection . makeTest ( )
350
- let listenConn = try PostgreSQLConnection . makeTest ( )
351
- let channelName = " Fooze "
352
- let messageText = " Bar "
353
- let finalMessageText = " Baz "
354
-
355
- try listenConn. listen ( channelName) { text in
356
- if text == messageText {
357
- completionHandlerExpectation1. fulfill ( )
358
- } else if text == finalMessageText {
359
- completionHandlerExpectation2. fulfill ( )
360
- }
361
- } . catch ( { err in XCTFail ( " error \( err) " ) } )
362
-
363
- try notifyConn. notify ( channelName, message: messageText) . wait ( )
364
- try notifyConn. notify ( channelName, message: finalMessageText) . wait ( )
365
-
366
- waitForExpectations ( timeout: defaultTimeout)
367
- notifyConn. close ( )
368
- listenConn. close ( )
369
- }
370
-
371
- func testNotifyAndListenOnMultipleChannels( ) throws {
372
- let completionHandlerExpectation1 = expectation ( description: " first completion handler called " )
373
- let completionHandlerExpectation2 = expectation ( description: " final completion handler called " )
374
- let notifyConn = try PostgreSQLConnection . makeTest ( )
375
- let listenConn = try PostgreSQLConnection . makeTest ( )
376
- let channelName = " Fooze "
377
- let channelName2 = " Foozalz "
378
- let messageText = " Bar "
379
- let finalMessageText = " Baz "
380
-
381
- try listenConn. listen ( channelName) { text in
382
- if text == messageText {
383
- completionHandlerExpectation1. fulfill ( )
384
- }
385
- } . catch ( { err in XCTFail ( " error \( err) " ) } )
386
-
387
- try listenConn. listen ( channelName2) { text in
388
- if text == finalMessageText {
389
- completionHandlerExpectation2. fulfill ( )
390
- }
391
- } . catch ( { err in XCTFail ( " error \( err) " ) } )
392
-
393
- try notifyConn. notify ( channelName, message: messageText) . wait ( )
394
- try notifyConn. notify ( channelName2, message: finalMessageText) . wait ( )
395
-
396
- waitForExpectations ( timeout: defaultTimeout)
397
- notifyConn. close ( )
398
- listenConn. close ( )
399
- }
400
-
401
- func testUnlisten( ) throws {
402
- let unlistenHandlerExpectation = expectation ( description: " unlisten completion handler called " )
403
-
404
- let listenHandlerExpectation = expectation ( description: " listen completion handler called " )
405
-
406
- let notifyConn = try PostgreSQLConnection . makeTest ( )
407
- let listenConn = try PostgreSQLConnection . makeTest ( )
408
- let channelName = " Foozers "
409
- let messageText = " Bar "
410
-
411
- try listenConn. listen ( channelName) { text in
412
- if text == messageText {
413
- listenHandlerExpectation. fulfill ( )
414
- }
415
- } . catch ( { err in XCTFail ( " error \( err) " ) } )
416
-
417
- try notifyConn. notify ( channelName, message: messageText) . wait ( )
418
- try notifyConn. unlisten ( channelName, unlistenHandler: {
419
- unlistenHandlerExpectation. fulfill ( )
420
- } ) . wait ( )
421
- waitForExpectations ( timeout: defaultTimeout)
422
- notifyConn. close ( )
423
- listenConn. close ( )
424
- }
346
+ // func testNotifyAndListen() throws {
347
+ // let completionHandlerExpectation1 = expectation(description: "first completion handler called")
348
+ // let completionHandlerExpectation2 = expectation(description: "final completion handler called")
349
+ // let notifyConn = try PostgreSQLConnection.makeTest()
350
+ // let listenConn = try PostgreSQLConnection.makeTest()
351
+ // let channelName = "Fooze"
352
+ // let messageText = "Bar"
353
+ // let finalMessageText = "Baz"
354
+ //
355
+ // try listenConn.listen(channelName) { text in
356
+ // if text == messageText {
357
+ // completionHandlerExpectation1.fulfill()
358
+ // } else if text == finalMessageText {
359
+ // completionHandlerExpectation2.fulfill()
360
+ // }
361
+ // }.catch({ err in XCTFail("error \(err)") })
362
+ //
363
+ // try notifyConn.notify(channelName, message: messageText).wait()
364
+ // try notifyConn.notify(channelName, message: finalMessageText).wait()
365
+ //
366
+ // waitForExpectations(timeout: defaultTimeout)
367
+ // notifyConn.close()
368
+ // listenConn.close()
369
+ // }
370
+ //
371
+ // func testNotifyAndListenOnMultipleChannels() throws {
372
+ // let completionHandlerExpectation1 = expectation(description: "first completion handler called")
373
+ // let completionHandlerExpectation2 = expectation(description: "final completion handler called")
374
+ // let notifyConn = try PostgreSQLConnection.makeTest()
375
+ // let listenConn = try PostgreSQLConnection.makeTest()
376
+ // let channelName = "Fooze"
377
+ // let channelName2 = "Foozalz"
378
+ // let messageText = "Bar"
379
+ // let finalMessageText = "Baz"
380
+ //
381
+ // try listenConn.listen(channelName) { text in
382
+ // if text == messageText {
383
+ // completionHandlerExpectation1.fulfill()
384
+ // }
385
+ // }.catch({ err in XCTFail("error \(err)") })
386
+ //
387
+ // try listenConn.listen(channelName2) { text in
388
+ // if text == finalMessageText {
389
+ // completionHandlerExpectation2.fulfill()
390
+ // }
391
+ // }.catch({ err in XCTFail("error \(err)") })
392
+ //
393
+ // try notifyConn.notify(channelName, message: messageText).wait()
394
+ // try notifyConn.notify(channelName2, message: finalMessageText).wait()
395
+ //
396
+ // waitForExpectations(timeout: defaultTimeout)
397
+ // notifyConn.close()
398
+ // listenConn.close()
399
+ // }
400
+ //
401
+ // func testUnlisten() throws {
402
+ // let unlistenHandlerExpectation = expectation(description: "unlisten completion handler called")
403
+ //
404
+ // let listenHandlerExpectation = expectation(description: "listen completion handler called")
405
+ //
406
+ // let notifyConn = try PostgreSQLConnection.makeTest()
407
+ // let listenConn = try PostgreSQLConnection.makeTest()
408
+ // let channelName = "Foozers"
409
+ // let messageText = "Bar"
410
+ //
411
+ // try listenConn.listen(channelName) { text in
412
+ // if text == messageText {
413
+ // listenHandlerExpectation.fulfill()
414
+ // }
415
+ // }.catch({ err in XCTFail("error \(err)") })
416
+ //
417
+ // try notifyConn.notify(channelName, message: messageText).wait()
418
+ // try notifyConn.unlisten(channelName, unlistenHandler: {
419
+ // unlistenHandlerExpectation.fulfill()
420
+ // }).wait()
421
+ // waitForExpectations(timeout: defaultTimeout)
422
+ // notifyConn.close()
423
+ // listenConn.close()
424
+ // }
425
425
426
426
func testURLParsing( ) throws {
427
427
let databaseURL = " postgres://username:password@hostname.com:5432/database "
@@ -442,9 +442,9 @@ class PostgreSQLConnectionTests: XCTestCase {
442
442
( " testStruct " , testStruct) ,
443
443
( " testNull " , testNull) ,
444
444
( " testGH24 " , testGH24) ,
445
- ( " testNotifyAndListen " , testNotifyAndListen) ,
446
- ( " testNotifyAndListenOnMultipleChannels " , testNotifyAndListenOnMultipleChannels) ,
447
- ( " testUnlisten " , testUnlisten) ,
445
+ // ("testNotifyAndListen", testNotifyAndListen),
446
+ // ("testNotifyAndListenOnMultipleChannels", testNotifyAndListenOnMultipleChannels),
447
+ // ("testUnlisten", testUnlisten),
448
448
( " testURLParsing " , testURLParsing) ,
449
449
]
450
450
}
0 commit comments