use of joynr.SubscriptionRequest in project joynr by bmwcarit.
the class PublicationManagerTest method addPublicationWithoutExpiryDate.
@SuppressWarnings("unchecked")
@Test(timeout = 3000)
public void addPublicationWithoutExpiryDate() throws Exception {
int period = 200;
PeriodicSubscriptionQos qos = new PeriodicSubscriptionQos();
qos.setPeriodMs(period).setValidityMs(SubscriptionQos.IGNORE_VALUE);
qos.setAlertAfterIntervalMs(500).setPublicationTtlMs(1000);
SubscriptionRequest subscriptionRequest = new SubscriptionRequest(SUBSCRIPTION_ID, "location", qos);
when(providerDirectory.get(eq(PROVIDER_PARTICIPANT_ID))).thenReturn(providerContainer);
when(providerDirectory.contains(eq(PROVIDER_PARTICIPANT_ID))).thenReturn(true);
publicationManager.addSubscriptionRequest(PROXY_PARTICIPANT_ID, PROVIDER_PARTICIPANT_ID, subscriptionRequest);
verify(dispatcher, timeout(period * 5).times(6)).sendSubscriptionPublication(eq(PROVIDER_PARTICIPANT_ID), (Set<String>) argThat(contains(PROXY_PARTICIPANT_ID)), any(SubscriptionPublication.class), any(MessagingQos.class));
reset(dispatcher);
publicationManager.stopPublication(SUBSCRIPTION_ID);
verify(dispatcher, timeout(300).times(0)).sendSubscriptionPublication(eq(PROVIDER_PARTICIPANT_ID), (Set<String>) argThat(contains(PROXY_PARTICIPANT_ID)), any(SubscriptionPublication.class), any(MessagingQos.class));
}
use of joynr.SubscriptionRequest in project joynr by bmwcarit.
the class PushingPublicationTest method setupMixedQos.
void setupMixedQos() {
OnChangeWithKeepAliveSubscriptionQos qos = new OnChangeWithKeepAliveSubscriptionQos();
qos.setMinIntervalMs(10);
// TODO Also write this test with -1
qos.setMaxIntervalMs(3000);
qos.setValidityMs(19000);
qos.setAlertAfterIntervalMs(500);
qos.setPublicationTtlMs(1000);
subscriptionRequest = new SubscriptionRequest(subscriptionId, attributeName, qos);
}
Aggregations