Skip to content

Commit da67701

Browse files
committed
ADAP-51: fixed an issue in notificationEventListenersWork test case
1 parent f20042b commit da67701

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

257 Bytes
Binary file not shown.

src/main/java/com/openfin/desktop/demo/OpenFinWindowTest.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,17 @@ public void onError(Ack ack) {
441441

442442
@Test
443443
public void notificationEventListenersWork() throws Exception {
444+
// wait for Notification service to start up
445+
Window notificationService = Window.wrap("service:notifications", "queueCounter", desktopConnection);
446+
CountDownLatch notificationLatch = new CountDownLatch(1);
447+
notificationService.addEventListener("app-connected", actionEvent -> {
448+
if (actionEvent.getType().equals("app-connected")) {
449+
logger.info("notification center ready");
450+
notificationLatch.countDown();
451+
}
452+
}, null);
453+
notificationLatch.await(10, TimeUnit.SECONDS);
454+
444455
//record/wait for event
445456
CountDownLatch onCloseEventLatch = new CountDownLatch(1);
446457
AtomicReference<String> eventTypeRecieved = new AtomicReference<>();
@@ -482,7 +493,7 @@ public void onShow(Ack ack) {
482493
}, this.desktopConnection, null);
483494

484495
//wait for the onClose notification to arrive
485-
onCloseEventLatch.await(20, TimeUnit.SECONDS);
496+
onCloseEventLatch.await(20000, TimeUnit.SECONDS);
486497
assertEquals("onClose", eventTypeRecieved.get());
487498
}
488499

0 commit comments

Comments
 (0)