Search in sources :

Example 21 with Reply

use of joynr.Reply in project joynr by bmwcarit.

the class SerializationTest method serializeReplyWithJoynrApplicationException.

@Test
public void serializeReplyWithJoynrApplicationException() throws IOException {
    ApplicationException error = new ApplicationException(TestEnum.ONE, "detail message");
    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);
}
Also used : ApplicationException(joynr.exceptions.ApplicationException) Reply(joynr.Reply) Test(org.junit.Test)

Example 22 with Reply

use of joynr.Reply in project joynr by bmwcarit.

the class SerializationTest method serializeReplyWithJoynrHttpException.

@Test
public void serializeReplyWithJoynrHttpException() throws IOException {
    JoynrHttpException error = new JoynrHttpException(404, "detail message: JoynrHttpException");
    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);
}
Also used : JoynrHttpException(io.joynr.exceptions.JoynrHttpException) Reply(joynr.Reply) Test(org.junit.Test)

Example 23 with Reply

use of joynr.Reply in project joynr by bmwcarit.

the class SerializationTest method serializeReplyWithJoynrIllegalAccessException.

@Test
public void serializeReplyWithJoynrIllegalAccessException() throws IOException {
    IllegalAccessException error = new IllegalAccessException("detail message: JoynrIllegalAccessException");
    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);
}
Also used : Reply(joynr.Reply) IllegalAccessException(joynr.exceptions.IllegalAccessException) Test(org.junit.Test)

Example 24 with Reply

use of joynr.Reply in project joynr by bmwcarit.

the class SerializationTest method serializeReplyWithJoynrSendBufferFullException.

@Test
public void serializeReplyWithJoynrSendBufferFullException() throws IOException {
    JoynrSendBufferFullException error = new JoynrSendBufferFullException(new RejectedExecutionException("cause message"));
    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);
}
Also used : Reply(joynr.Reply) JoynrSendBufferFullException(io.joynr.exceptions.JoynrSendBufferFullException) RejectedExecutionException(java.util.concurrent.RejectedExecutionException) Test(org.junit.Test)

Example 25 with Reply

use of joynr.Reply in project joynr by bmwcarit.

the class SerializationTest method serializeReplyWithDiscoveryException.

@Test
public void serializeReplyWithDiscoveryException() throws IOException {
    DiscoveryException error = new DiscoveryException("detail message: DiscoveryException");
    Reply reply = new Reply(UUID.randomUUID().toString(), error);
    String writeValueAsString = objectMapper.writeValueAsString(reply);
    Reply receivedReply = objectMapper.readValue(writeValueAsString, Reply.class);
    Assert.assertEquals(reply, receivedReply);
}
Also used : Reply(joynr.Reply) DiscoveryException(io.joynr.exceptions.DiscoveryException) Test(org.junit.Test)

Aggregations

Reply (joynr.Reply)38 Test (org.junit.Test)33 Request (joynr.Request)6 SynchronizedReplyCaller (io.joynr.dispatching.rpc.SynchronizedReplyCaller)5 ApplicationException (joynr.exceptions.ApplicationException)5 Matchers.anyString (org.mockito.Matchers.anyString)5 ReplyCaller (io.joynr.dispatching.rpc.ReplyCaller)4 JoynrRuntimeException (io.joynr.exceptions.JoynrRuntimeException)4 MessagingQos (io.joynr.messaging.MessagingQos)4 IOException (java.io.IOException)4 MutableMessage (joynr.MutableMessage)4 OneWayRequest (joynr.OneWayRequest)4 InvocationOnMock (org.mockito.invocation.InvocationOnMock)4 JsonMappingException (com.fasterxml.jackson.databind.JsonMappingException)3 ImmutableMessage (joynr.ImmutableMessage)3 MulticastSubscriptionRequest (joynr.MulticastSubscriptionRequest)3 SubscriptionRequest (joynr.SubscriptionRequest)3 JsonParseException (com.fasterxml.jackson.core.JsonParseException)2 AbstractModule (com.google.inject.AbstractModule)2 TypeLiteral (com.google.inject.TypeLiteral)2