Skip to content

Commit c41320b

Browse files
weitehowenjunche
authored andcommitted
ADAP-181 unit test to verify getErrorStack method returns the stack trace if runtime error has it. (openfin#30)
1 parent 72137ab commit c41320b

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

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

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,4 +553,43 @@ public void onError(Ack ack) {
553553

554554
assertEquals(0, latch.getCount());
555555
}
556+
557+
@Test
558+
public void errorStack() throws Exception {
559+
Application application = TestUtils.runApplication(TestUtils.getAppOptions(null), desktopConnection);
560+
final CountDownLatch latch = new CountDownLatch(1);
561+
562+
application.close(true, new AckListener() {
563+
564+
@Override
565+
public void onSuccess(Ack ack) {
566+
application.getChildWindows(new AsyncCallback<List<Window>>() {
567+
568+
@Override
569+
public void onSuccess(List<Window> result) {
570+
}
571+
}, new AckListener() {
572+
573+
@Override
574+
public void onSuccess(Ack ack) {
575+
}
576+
577+
@Override
578+
public void onError(Ack ack) {
579+
if (ack.getErrorStack() != null) {
580+
latch.countDown();
581+
}
582+
}
583+
});
584+
}
585+
586+
@Override
587+
public void onError(Ack ack) {
588+
}
589+
});
590+
591+
latch.await(5, TimeUnit.SECONDS);
592+
593+
assertEquals(0, latch.getCount());
594+
}
556595
}

0 commit comments

Comments
 (0)