Search in sources :

Example 1 with PromiseKeeper

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);
}
Also used : GlobalDiscoveryEntry(joynr.types.GlobalDiscoveryEntry) PromiseKeeper(io.joynr.provider.PromiseKeeper) Test(org.junit.Test)

Example 2 with PromiseKeeper

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]);
}
Also used : GlobalDiscoveryEntry(joynr.types.GlobalDiscoveryEntry) PromiseKeeper(io.joynr.provider.PromiseKeeper) Test(org.junit.Test)

Aggregations

PromiseKeeper (io.joynr.provider.PromiseKeeper)2 GlobalDiscoveryEntry (joynr.types.GlobalDiscoveryEntry)2 Test (org.junit.Test)2