use of joynr.Reply in project joynr by bmwcarit.
the class SerializationTest method serializeReplyWithJoynrWaitExpiredException.
@Test
public void serializeReplyWithJoynrWaitExpiredException() throws IOException {
JoynrWaitExpiredException error = new JoynrWaitExpiredException();
Reply reply = new Reply(UUID.randomUUID().toString(), error);
String writeValueAsString = objectMapper.writeValueAsString(reply);
Reply receivedReply = objectMapper.readValue(writeValueAsString, Reply.class);
Assert.assertEquals(reply, receivedReply);
}
use of joynr.Reply in project joynr by bmwcarit.
the class SerializationTest method serializeReplyWithJoynrRuntimeExceptionWithCause.
@Test
public void serializeReplyWithJoynrRuntimeExceptionWithCause() throws IOException {
JoynrRuntimeException error = new JoynrRuntimeException("detail message: JoynrRuntimeExceptionWithCause", new IOException("cause message"));
System.out.println("error: " + error);
System.out.println("cause: " + ((Throwable) error).getCause());
Reply reply = new Reply(UUID.randomUUID().toString(), error);
String writeValueAsString = objectMapper.writeValueAsString(reply);
Reply receivedReply = objectMapper.readValue(writeValueAsString, Reply.class);
Assert.assertEquals(reply, receivedReply);
}
use of joynr.Reply in project joynr by bmwcarit.
the class SerializationTest method serializeReplyWithJoynrChannelNotAssignableException.
@Test
public void serializeReplyWithJoynrChannelNotAssignableException() throws IOException {
JoynrChannelNotAssignableException error = new JoynrChannelNotAssignableException("detail message: JoynrChannelNotAssignableException", "CCID");
Reply reply = new Reply(UUID.randomUUID().toString(), error);
String writeValueAsString = objectMapper.writeValueAsString(reply);
Reply receivedReply = objectMapper.readValue(writeValueAsString, Reply.class);
Assert.assertEquals(reply, receivedReply);
}
use of joynr.Reply in project joynr by bmwcarit.
the class SerializationTest method serializeAndDeserializeJsonReplyTest.
@Test
public void serializeAndDeserializeJsonReplyTest() throws Exception {
GpsLocation[] GpsLocations = { new GpsLocation(1.0d, 2.0d, 0d, GpsFixEnum.MODE2D, 0d, 0d, 0d, 0d, 0l, 0l, 0), new GpsLocation(3.0d, 4.0d, 0d, GpsFixEnum.MODE2D, 0d, 0d, 0d, 0d, 0l, 0l, 0), new GpsLocation(5.0d, 6.0d, 0d, GpsFixEnum.MODE2D, 0d, 0d, 0d, 0d, 0l, 0l, 0) };
Reply reply = new Reply(UUID.randomUUID().toString(), (Object) GpsLocations);
String valueAsString = objectMapper.writeValueAsString(reply);
System.out.println(valueAsString);
Reply reply2 = objectMapper.readValue(valueAsString, Reply.class);
assertEquals(reply, reply2);
}
use of joynr.Reply in project joynr by bmwcarit.
the class SerializationTest method serializeReplyWithMethodInvocationException.
@Test
public void serializeReplyWithMethodInvocationException() throws IOException {
MethodInvocationException error = new MethodInvocationException("detail message: MessageInvocationException");
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);
}
Aggregations