Search in sources :

Example 1 with TestBroadcastListener

use of io.joynr.proxy.ConnectorTest.TestBroadcastInterface.TestBroadcastListener in project joynr by bmwcarit.

the class ConnectorTest method subscribeToMulticastCallCallsSubscriptionManagerWithCorrectArguments.

@Test
public void subscribeToMulticastCallCallsSubscriptionManagerWithCorrectArguments() {
    // TODO
    TestBroadcastListener listener = new TestBroadcastInterface.TestBroadcastAdapter();
    OnChangeSubscriptionQos subscriptionQos = new OnChangeSubscriptionQos();
    String[] partitions = new String[] { "partition1", "partition2", "partition3" };
    ConnectorInvocationHandler connector = createConnector();
    assertNotNull(connector);
    try {
        Method method = TestBroadcastInterface.class.getDeclaredMethod("subscribeToTestMulticast", TestBroadcastListener.class, OnChangeSubscriptionQos.class, String[].class);
        MulticastSubscribeInvocation invocation = new MulticastSubscribeInvocation(method, new Object[] { listener, subscriptionQos, partitions }, null);
        connector.executeSubscriptionMethod(invocation);
        verify(subscriptionManager, times(1)).registerMulticastSubscription(fromParticipantId, toDiscoveryEntries, invocation);
    } catch (Exception e) {
        fail("Unexpected exception from multicast subscribe call: " + e);
    }
}
Also used : OnChangeSubscriptionQos(joynr.OnChangeSubscriptionQos) TestBroadcastListener(io.joynr.proxy.ConnectorTest.TestBroadcastInterface.TestBroadcastListener) MulticastSubscribeInvocation(io.joynr.proxy.invocation.MulticastSubscribeInvocation) Method(java.lang.reflect.Method) SubscriptionException(io.joynr.exceptions.SubscriptionException) JsonMappingException(com.fasterxml.jackson.databind.JsonMappingException) JoynrIllegalStateException(io.joynr.exceptions.JoynrIllegalStateException) Test(org.junit.Test)

Example 2 with TestBroadcastListener

use of io.joynr.proxy.ConnectorTest.TestBroadcastInterface.TestBroadcastListener in project joynr by bmwcarit.

the class ConnectorTest method subscribeToBroadcastCallCallsSubscriptionManagerWithCorrectArguments.

@Test
public void subscribeToBroadcastCallCallsSubscriptionManagerWithCorrectArguments() {
    TestBroadcastListener listener = new TestBroadcastInterface.TestBroadcastAdapter();
    OnChangeSubscriptionQos subscriptionQos = new OnChangeSubscriptionQos();
    ConnectorInvocationHandler connector = createConnector();
    assertNotNull(connector);
    try {
        Method method = TestBroadcastInterface.class.getDeclaredMethod("subscribeToTestBroadcast", TestBroadcastListener.class, OnChangeSubscriptionQos.class, BroadcastFilterParameters.class);
        BroadcastSubscribeInvocation invocation = new BroadcastSubscribeInvocation(method, new Object[] { listener, subscriptionQos, new BroadcastFilterParameters() }, null);
        connector.executeSubscriptionMethod(invocation);
        verify(subscriptionManager, times(1)).registerBroadcastSubscription(fromParticipantId, toDiscoveryEntries, invocation);
    } catch (Exception e) {
        fail("Unexpected exception from broadcast subscribe call: " + e);
    }
}
Also used : BroadcastFilterParameters(joynr.BroadcastFilterParameters) BroadcastSubscribeInvocation(io.joynr.proxy.invocation.BroadcastSubscribeInvocation) OnChangeSubscriptionQos(joynr.OnChangeSubscriptionQos) TestBroadcastListener(io.joynr.proxy.ConnectorTest.TestBroadcastInterface.TestBroadcastListener) Method(java.lang.reflect.Method) SubscriptionException(io.joynr.exceptions.SubscriptionException) JsonMappingException(com.fasterxml.jackson.databind.JsonMappingException) JoynrIllegalStateException(io.joynr.exceptions.JoynrIllegalStateException) Test(org.junit.Test)

Aggregations

JsonMappingException (com.fasterxml.jackson.databind.JsonMappingException)2 JoynrIllegalStateException (io.joynr.exceptions.JoynrIllegalStateException)2 SubscriptionException (io.joynr.exceptions.SubscriptionException)2 TestBroadcastListener (io.joynr.proxy.ConnectorTest.TestBroadcastInterface.TestBroadcastListener)2 Method (java.lang.reflect.Method)2 OnChangeSubscriptionQos (joynr.OnChangeSubscriptionQos)2 Test (org.junit.Test)2 BroadcastSubscribeInvocation (io.joynr.proxy.invocation.BroadcastSubscribeInvocation)1 MulticastSubscribeInvocation (io.joynr.proxy.invocation.MulticastSubscribeInvocation)1 BroadcastFilterParameters (joynr.BroadcastFilterParameters)1