use of joynr.Reply in project joynr by bmwcarit.
the class SerializationTest method serializeReplyWithJoynrRuntimeException.
@Test
public void serializeReplyWithJoynrRuntimeException() throws IOException {
JoynrRuntimeException error = new JoynrRuntimeException("detail message: JoynrRuntimeException");
Reply reply = new Reply(UUID.randomUUID().toString(), error);
String writeValueAsString = objectMapper.writeValueAsString(reply);
System.out.println(writeValueAsString);
Reply receivedReply = objectMapper.readValue(writeValueAsString, Reply.class);
Assert.assertEquals(reply, receivedReply);
}
use of joynr.Reply in project joynr by bmwcarit.
the class SerializationTest method serializeReplyWithJoynrRequestInterruptedException.
@Test
public void serializeReplyWithJoynrRequestInterruptedException() throws IOException {
JoynrRequestInterruptedException error = new JoynrRequestInterruptedException("detail message: JoynrRequestInterruptedException");
Reply reply = new Reply(UUID.randomUUID().toString(), error);
String writeValueAsString = objectMapper.writeValueAsString(reply);
System.out.println(writeValueAsString);
Reply receivedReply = objectMapper.readValue(writeValueAsString, Reply.class);
Assert.assertEquals(reply, receivedReply);
}
use of joynr.Reply in project joynr by bmwcarit.
the class SerializationTest method serializeReplyWithJoynrApplicationExceptionWithoutMessage.
@Test
public void serializeReplyWithJoynrApplicationExceptionWithoutMessage() throws IOException {
ApplicationException error = new ApplicationException(TestEnum.TWO);
Reply reply = new Reply(UUID.randomUUID().toString(), error);
String writeValueAsString = objectMapper.writeValueAsString(reply);
System.out.println(writeValueAsString);
Reply receivedReply = objectMapper.readValue(writeValueAsString, Reply.class);
Assert.assertEquals(reply, receivedReply);
}
use of joynr.Reply in project joynr by bmwcarit.
the class TtlUpliftTest method testTtlUpliftMs_Reply_noUplift.
@Test
public void testTtlUpliftMs_Reply_noUplift() {
Reply reply = new Reply();
expiryDate = DispatcherUtils.convertTtlToExpirationDate(messagingQos.getRoundTripTtl_ms());
MutableMessage message = messageFactoryWithTtlUplift.createReply(fromParticipantId, toParticipantId, reply, messagingQos);
long expiryDateValue = expiryDate.getValue();
MutableMessageFactoryTest.assertExpiryDateEquals(expiryDateValue, message);
}
use of joynr.Reply in project joynr by bmwcarit.
the class RequestReplyManagerTest method requestReplyMessagesRemoveCallBackByTtl.
@Test
public void requestReplyMessagesRemoveCallBackByTtl() throws Exception {
TestProvider testResponder = new TestProvider(1);
ExpiryDate ttlReplyCaller = ExpiryDate.fromRelativeTtl(1000L);
final ReplyCaller replyCaller = mock(ReplyCaller.class);
replyCallerDirectory.addReplyCaller(request1.getRequestReplyId(), replyCaller, ttlReplyCaller);
Thread.sleep(ttlReplyCaller.getRelativeTtl() + 100);
requestReplyManager.handleReply(new Reply(request1.getRequestReplyId(), testResponder.getSentPayloadFor(request1)));
verify(replyCaller, never()).messageCallBack(any(Reply.class));
}
Aggregations