Skip to content

Commit 0ed5246

Browse files
weitehowenjunche
authored andcommitted
ADAP-180 added test case for getEntityInfo (openfin#29)
1 parent c41320b commit 0ed5246

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,4 +534,27 @@ public void duplicateConnectionUuid() throws Exception {
534534
Thread.sleep(5000);
535535
assertEquals("Duplicate connection UUID should not be allowed", setupFailed, true);
536536
}
537+
538+
@Test
539+
public void getEntityInfo() throws Exception {
540+
CountDownLatch latch = new CountDownLatch(1);
541+
runtime.getEntityInfo(DESKTOP_UUID, DESKTOP_UUID, new AckListener() {
542+
543+
@Override
544+
public void onSuccess(Ack ack) {
545+
JSONObject jsonData = (JSONObject) ack.getData();
546+
String uuid = jsonData.getString("uuid");
547+
String entityType = jsonData.getString("entityType");
548+
if (DESKTOP_UUID.equals(uuid) && "external connection".equals(entityType)) {
549+
latch.countDown();
550+
}
551+
}
552+
553+
@Override
554+
public void onError(Ack ack) {
555+
}
556+
});
557+
latch.await(5, TimeUnit.SECONDS);
558+
assertEquals("getEntityInfo timeout", latch.getCount(), 0);
559+
}
537560
}

0 commit comments

Comments
 (0)