Search in sources :

Example 21 with MutableMessage

use of joynr.MutableMessage in project joynr by bmwcarit.

the class TtlUpliftTest method testTtlUpliftMs_Publication.

@Test
public void testTtlUpliftMs_Publication() {
    SubscriptionPublication subscriptionPublication = new SubscriptionPublication();
    expiryDate = DispatcherUtils.convertTtlToExpirationDate(messagingQos.getRoundTripTtl_ms());
    MutableMessage message = messageFactoryWithTtlUplift.createPublication(fromParticipantId, toParticipantId, subscriptionPublication, messagingQos);
    long expiryDateValue = expiryDate.getValue() + TTL_UPLIFT_MS;
    MutableMessageFactoryTest.assertExpiryDateEquals(expiryDateValue, message);
}
Also used : MutableMessage(joynr.MutableMessage) SubscriptionPublication(joynr.SubscriptionPublication) Test(org.junit.Test)

Example 22 with MutableMessage

use of joynr.MutableMessage in project joynr by bmwcarit.

the class TtlUpliftTest method testTtlUpliftMs_OneWayRequest.

@Test
public void testTtlUpliftMs_OneWayRequest() {
    expiryDate = DispatcherUtils.convertTtlToExpirationDate(messagingQos.getRoundTripTtl_ms());
    MutableMessage message = messageFactoryWithTtlUplift.createOneWayRequest(fromParticipantId, toParticipantId, request, messagingQos);
    long expiryDateValue = expiryDate.getValue() + TTL_UPLIFT_MS;
    MutableMessageFactoryTest.assertExpiryDateEquals(expiryDateValue, message);
}
Also used : MutableMessage(joynr.MutableMessage) Test(org.junit.Test)

Example 23 with MutableMessage

use of joynr.MutableMessage in project joynr by bmwcarit.

the class TtlUpliftTest method testTtlUpliftMs_Request.

@Test
public void testTtlUpliftMs_Request() {
    expiryDate = DispatcherUtils.convertTtlToExpirationDate(messagingQos.getRoundTripTtl_ms());
    MutableMessage message = messageFactoryWithTtlUplift.createRequest(fromParticipantId, toParticipantId, request, messagingQos);
    long expiryDateValue = expiryDate.getValue() + TTL_UPLIFT_MS;
    MutableMessageFactoryTest.assertExpiryDateEquals(expiryDateValue, message);
}
Also used : MutableMessage(joynr.MutableMessage) Test(org.junit.Test)

Example 24 with MutableMessage

use of joynr.MutableMessage in project joynr by bmwcarit.

the class TtlUpliftTest method testTtlUpliftMsWithLargeTtl.

@Test
public void testTtlUpliftMsWithLargeTtl() {
    MessagingQos messagingQos = new MessagingQos(LARGE_EXPIRY_DATE_MS);
    MutableMessage message = messageFactoryWithTtlUplift.createRequest(fromParticipantId, toParticipantId, request, messagingQos);
    long expiryDateValue = LARGE_EXPIRY_DATE_MS;
    MutableMessageFactoryTest.assertExpiryDateEquals(expiryDateValue, message);
    messagingQos = new MessagingQos(LARGE_EXPIRY_DATE_MS - TTL_UPLIFT_MS);
    message = messageFactoryWithTtlUplift.createRequest(fromParticipantId, toParticipantId, request, messagingQos);
    MutableMessageFactoryTest.assertExpiryDateEquals(expiryDateValue, message);
    messagingQos = new MessagingQos(LARGE_EXPIRY_DATE_MS - TTL_UPLIFT_MS - System.currentTimeMillis());
    message = messageFactoryWithTtlUplift.createRequest(fromParticipantId, toParticipantId, request, messagingQos);
    MutableMessageFactoryTest.assertExpiryDateEquals(expiryDateValue, message);
    messagingQos = new MessagingQos(LARGE_EXPIRY_DATE_MS - TTL_UPLIFT_MS - System.currentTimeMillis() + 1);
    message = messageFactoryWithTtlUplift.createRequest(fromParticipantId, toParticipantId, request, messagingQos);
    MutableMessageFactoryTest.assertExpiryDateEquals(expiryDateValue, message);
}
Also used : MessagingQos(io.joynr.messaging.MessagingQos) MutableMessage(joynr.MutableMessage) Test(org.junit.Test)

Example 25 with MutableMessage

use of joynr.MutableMessage in project joynr by bmwcarit.

the class TtlUpliftTest method testTtlUpliftMs_Multicast.

@Test
public void testTtlUpliftMs_Multicast() {
    MulticastPublication multicastPublication = new MulticastPublication();
    expiryDate = DispatcherUtils.convertTtlToExpirationDate(messagingQos.getRoundTripTtl_ms());
    MutableMessage message = messageFactoryWithTtlUplift.createMulticast(fromParticipantId, multicastPublication, messagingQos);
    long expiryDateValue = expiryDate.getValue() + TTL_UPLIFT_MS;
    MutableMessageFactoryTest.assertExpiryDateEquals(expiryDateValue, message);
}
Also used : MulticastPublication(joynr.MulticastPublication) MutableMessage(joynr.MutableMessage) Test(org.junit.Test)

Aggregations

MutableMessage (joynr.MutableMessage)60 Test (org.junit.Test)35 MessagingQos (io.joynr.messaging.MessagingQos)15 ImmutableMessage (joynr.ImmutableMessage)9 MulticastSubscriptionRequest (joynr.MulticastSubscriptionRequest)7 SubscriptionRequest (joynr.SubscriptionRequest)6 Request (joynr.Request)5 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)4 Reply (joynr.Reply)4 Injector (com.google.inject.Injector)3 JoynrMessageProcessor (io.joynr.messaging.JoynrMessageProcessor)3 BroadcastSubscriptionRequest (joynr.BroadcastSubscriptionRequest)3 MulticastPublication (joynr.MulticastPublication)3 OneWayRequest (joynr.OneWayRequest)3 DiscoveryEntryWithMetaInfo (joynr.types.DiscoveryEntryWithMetaInfo)3 InvocationOnMock (org.mockito.invocation.InvocationOnMock)3 AbstractModule (com.google.inject.AbstractModule)2 TypeLiteral (com.google.inject.TypeLiteral)2 Multibinder (com.google.inject.multibindings.Multibinder)2 JoynrPropertiesModule (io.joynr.common.JoynrPropertiesModule)2