Search in sources :

Example 21 with MulticastSubscriptionQos

use of joynr.MulticastSubscriptionQos in project joynr by bmwcarit.

the class AbstractBroadcastEnd2EndTest method subscribeToBroadcastMultipleOutputs.

@Ignore
@Test(timeout = CONST_DEFAULT_TEST_TIMEOUT)
public void subscribeToBroadcastMultipleOutputs() throws InterruptedException {
    final Semaphore broadcastReceived = new Semaphore(0);
    proxy.subscribeToLocationUpdateWithSpeedBroadcast(new testBroadcastInterface.LocationUpdateWithSpeedBroadcastAdapter() {

        @Override
        public void onReceive(GpsLocation location, Float speed) {
            assertEquals(expectedLocation, location);
            assertEquals(expectedSpeed, speed);
            broadcastReceived.release();
        }
    }, new MulticastSubscriptionQos());
    Thread.sleep(300);
    provider.fireLocationUpdateWithSpeed(expectedLocation, expectedSpeed);
    broadcastReceived.acquire();
}
Also used : GpsLocation(joynr.types.Localisation.GpsLocation) Semaphore(java.util.concurrent.Semaphore) joynr.tests.testBroadcastInterface(joynr.tests.testBroadcastInterface) MulticastSubscriptionQos(joynr.MulticastSubscriptionQos) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 22 with MulticastSubscriptionQos

use of joynr.MulticastSubscriptionQos in project joynr by bmwcarit.

the class AbstractBroadcastEnd2EndTest method subscribeToBroadcastWithEnumOutput.

@Ignore
@Test(timeout = CONST_DEFAULT_TEST_TIMEOUT)
public void subscribeToBroadcastWithEnumOutput() throws InterruptedException {
    final Semaphore broadcastReceived = new Semaphore(0);
    final TestEnum expectedTestEnum = TestEnum.TWO;
    proxy.subscribeToBroadcastWithEnumOutputBroadcast(new testBroadcastInterface.BroadcastWithEnumOutputBroadcastAdapter() {

        @Override
        public void onReceive(TestEnum testEnum) {
            assertEquals(expectedTestEnum, testEnum);
            broadcastReceived.release();
        }

        @Override
        public void onError(SubscriptionException error) {
            fail("Error subscribing to broadcast");
        }
    }, new MulticastSubscriptionQos());
    Thread.sleep(300);
    provider.fireBroadcastWithEnumOutput(expectedTestEnum);
    broadcastReceived.acquire();
}
Also used : SubscriptionException(io.joynr.exceptions.SubscriptionException) TestEnum(joynr.tests.testTypes.TestEnum) Semaphore(java.util.concurrent.Semaphore) joynr.tests.testBroadcastInterface(joynr.tests.testBroadcastInterface) MulticastSubscriptionQos(joynr.MulticastSubscriptionQos) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

MulticastSubscriptionQos (joynr.MulticastSubscriptionQos)22 Test (org.junit.Test)19 Semaphore (java.util.concurrent.Semaphore)15 joynr.tests.testBroadcastInterface (joynr.tests.testBroadcastInterface)11 joynr.tests.testProxy (joynr.tests.testProxy)7 Ignore (org.junit.Ignore)7 SubscriptionException (io.joynr.exceptions.SubscriptionException)5 ArrayList (java.util.ArrayList)4 GpsLocation (joynr.types.Localisation.GpsLocation)4 MulticastSubscribeInvocation (io.joynr.proxy.invocation.MulticastSubscribeInvocation)3 LocationUpdateBroadcastListener (joynr.vehicle.NavigationBroadcastInterface.LocationUpdateBroadcastListener)3 NavigationProxy (joynr.vehicle.NavigationProxy)3 JoynrRuntimeException (io.joynr.exceptions.JoynrRuntimeException)2 MessagingQos (io.joynr.messaging.MessagingQos)2 ApplicationException (joynr.exceptions.ApplicationException)2 Matchers.anyString (org.mockito.Matchers.anyString)2 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)1 SuppressWarnings (edu.umd.cs.findbugs.annotations.SuppressWarnings)1 LdacDomainRoleEntryChangedBroadcastListener (io.joynr.accesscontrol.broadcastlistener.LdacDomainRoleEntryChangedBroadcastListener)1 LdacMasterAccessControlEntryChangedBroadcastListener (io.joynr.accesscontrol.broadcastlistener.LdacMasterAccessControlEntryChangedBroadcastListener)1