use of io.joynr.provider.PromiseKeeper in project joynr by bmwcarit.
the class CapabilitiesDirectoryTest method registerMultipleCapabilitiesAsArray.
@Test
public void registerMultipleCapabilitiesAsArray() throws InterruptedException {
GlobalDiscoveryEntry[] interfaces2And3 = { discoveryEntry2, dicoveryEntry3 };
capabilitiesDirectory.add(interfaces2And3);
PromiseKeeper lookupCapInfo2 = new PromiseKeeper();
capabilitiesDirectory.lookup(new String[] { domain }, interface2).then(lookupCapInfo2);
assertDiscoveryEntriesEqual(new GlobalDiscoveryEntry[] { discoveryEntry2 }, (GlobalDiscoveryEntry[]) lookupCapInfo2.getValues()[0]);
PromiseKeeper lookupCapInfo3 = new PromiseKeeper();
capabilitiesDirectory.lookup(new String[] { domain }, interface3).then(lookupCapInfo3);
GlobalDiscoveryEntry[] passedDiscoveryEntries = (GlobalDiscoveryEntry[]) lookupCapInfo3.getValues()[0];
assertDiscoveryEntriesEqual(new GlobalDiscoveryEntry[] { dicoveryEntry3 }, passedDiscoveryEntries);
}
use of io.joynr.provider.PromiseKeeper in project joynr by bmwcarit.
the class CapabilitiesDirectoryTest method registerProviderAndRequestChannels.
@Test
public void registerProviderAndRequestChannels() throws Exception {
capabilitiesDirectory.add(disoveryEntry1);
PromiseKeeper lookupCapInfo1 = new PromiseKeeper();
capabilitiesDirectory.lookup(new String[] { domain }, interface1).then(lookupCapInfo1);
lookupCapInfo1.waitForSettlement();
assertDiscoveryEntriesEqual(new GlobalDiscoveryEntry[] { disoveryEntry1 }, (GlobalDiscoveryEntry[]) lookupCapInfo1.getValues()[0]);
}
Aggregations