Skip to content

Commit 4d4a826

Browse files
committed
ADAP-102 added unit test for Window.reload
1 parent 26af64d commit 4d4a826

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/test/java/com/openfin/desktop/WindowTest.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -794,4 +794,27 @@ public void onSuccess(Double zLevel) {
794794

795795
TestUtils.closeApplication(application);
796796
}
797+
798+
@Test
799+
public void reload() throws Exception {
800+
ApplicationOptions options = TestUtils.getAppOptions(null);
801+
Application application = TestUtils.runApplication(options, desktopConnection);
802+
Window window = application.getWindow();
803+
CountDownLatch latch = new CountDownLatch(1);
804+
805+
window.reload(true, new AckListener() {
806+
807+
@Override
808+
public void onSuccess(Ack ack) {
809+
latch.countDown();
810+
}
811+
812+
@Override
813+
public void onError(Ack ack) {
814+
logger.error("error reloading window, reason: {}", ack.getReason());
815+
}
816+
});
817+
latch.await(10, TimeUnit.SECONDS);
818+
assertEquals("reload test timeout", 0, latch.getCount());
819+
}
797820
}

0 commit comments

Comments
 (0)