Search in sources :

Example 1 with BroadcastWithMapParametersBroadcastAdapter

use of joynr.tests.testBroadcastInterface.BroadcastWithMapParametersBroadcastAdapter in project joynr by bmwcarit.

the class AbstractProviderProxyEnd2EndTest method testBroadcastWithMapParameter.

@Ignore
@Test(timeout = CONST_DEFAULT_TEST_TIMEOUT)
public void testBroadcastWithMapParameter() throws DiscoveryException, JoynrIllegalStateException, InterruptedException {
    final Semaphore broadcastReceived = new Semaphore(0);
    ProxyBuilder<testProxy> proxyBuilder = consumerRuntime.getProxyBuilder(domain, testProxy.class);
    testProxy proxy = proxyBuilder.setMessagingQos(messagingQos).setDiscoveryQos(discoveryQos).build();
    final TStringKeyMap mapParam = new TStringKeyMap();
    mapParam.put("key", "value");
    proxy.subscribeToBroadcastWithMapParametersBroadcast(new BroadcastWithMapParametersBroadcastAdapter() {

        @Override
        public void onReceive(TStringKeyMap receivedMapParam) {
            assertEquals(mapParam, receivedMapParam);
            broadcastReceived.release();
        }
    }, new MulticastSubscriptionQos());
    // wait to allow the subscription request to arrive at the provider
    getSubscriptionTestsPublisher().waitForBroadcastSubscription();
    provider.fireBroadcastWithMapParameters(mapParam);
    broadcastReceived.acquire();
}
Also used : TStringKeyMap(joynr.types.TestTypes.TStringKeyMap) BroadcastWithMapParametersBroadcastAdapter(joynr.tests.testBroadcastInterface.BroadcastWithMapParametersBroadcastAdapter) joynr.tests.testProxy(joynr.tests.testProxy) Semaphore(java.util.concurrent.Semaphore) MulticastSubscriptionQos(joynr.MulticastSubscriptionQos) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

Semaphore (java.util.concurrent.Semaphore)1 MulticastSubscriptionQos (joynr.MulticastSubscriptionQos)1 BroadcastWithMapParametersBroadcastAdapter (joynr.tests.testBroadcastInterface.BroadcastWithMapParametersBroadcastAdapter)1 joynr.tests.testProxy (joynr.tests.testProxy)1 TStringKeyMap (joynr.types.TestTypes.TStringKeyMap)1 Ignore (org.junit.Ignore)1 Test (org.junit.Test)1