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);
}
}
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);
}
}
Aggregations