Skip to content

Commit cd43e08

Browse files
committed
ADAP-102 added test case for Application.getInfo
1 parent 3a5e3bd commit cd43e08

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import java.util.concurrent.TimeUnit;
88
import java.util.concurrent.atomic.AtomicInteger;
99

10+
import org.json.JSONObject;
1011
import org.junit.AfterClass;
1112
import org.junit.BeforeClass;
1213
import org.junit.Ignore;
@@ -409,4 +410,31 @@ public void onError(Ack ack) {
409410
assertEquals(0, latch.getCount());
410411
assertEquals(cnt, winCnt.get());
411412
}
413+
414+
@Test
415+
public void getInfo() throws Exception {
416+
Application application = TestUtils.runApplication(TestUtils.getAppOptions(null), desktopConnection);
417+
final CountDownLatch latch = new CountDownLatch(1);
418+
application.getInfo(
419+
new AsyncCallback<JSONObject>() {
420+
@Override
421+
public void onSuccess(JSONObject obj) {
422+
logger.info("getInfo: {}", obj.toString());
423+
latch.countDown();
424+
}
425+
}, new AckListener() {
426+
@Override
427+
public void onSuccess(Ack ack) {
428+
}
429+
430+
@Override
431+
public void onError(Ack ack) {
432+
logger.info("error getting application info: {}", ack.getReason());
433+
}
434+
});
435+
436+
latch.await(5, TimeUnit.SECONDS);
437+
438+
assertEquals(0, latch.getCount());
439+
}
412440
}

0 commit comments

Comments
 (0)