Skip to content

Commit d1c8749

Browse files
committed
RUN-1844: add test case for wildcard topic
1 parent d9742d1 commit d1c8749

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,4 +271,28 @@ public void unsubscribed(String uuid, String topic) {
271271

272272
TestUtils.closeApplication(application);
273273
}
274+
275+
@Test
276+
public void wildCardTopic() throws Exception {
277+
278+
CountDownLatch latch = new CountDownLatch(1);
279+
BusListener busListener = (sourceUuid, receivingTopic, payload) -> {
280+
logger.debug(String.format("Receiving %s", payload.toString()));
281+
// PubSubExample.html sends the following
282+
// fin.desktop.InterApplicationBus.publish('check-in', {name: 'Pub/Sub example app'});
283+
if (receivingTopic.equals("check-in")) {
284+
latch.countDown();
285+
}
286+
};
287+
subscribeToTopic("*", "*", busListener);
288+
289+
ApplicationOptions options = TestUtils.getAppOptions(openfin_app_url);
290+
Application application = TestUtils.createApplication(options, desktopConnection);
291+
TestUtils.runApplication(application, true);
292+
293+
latch.await(5, TimeUnit.SECONDS);
294+
assertEquals(latch.getCount(), 0);
295+
}
296+
297+
274298
}

0 commit comments

Comments
 (0)