use of joynr.Reply in project joynr by bmwcarit.
the class SerializationTest method serializeReplyWithJoynrCommunicationExceptionWithoutMessage.
@Test
public void serializeReplyWithJoynrCommunicationExceptionWithoutMessage() throws IOException {
JoynrCommunicationException error = new JoynrCommunicationException();
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 serializeReplyWithJoynrShutdownException.
@Test
public void serializeReplyWithJoynrShutdownException() throws IOException {
JoynrShutdownException error = new JoynrShutdownException("detail message: JoynrShutdownException");
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 serializeReplyWithCapabilityInfoArray.
@Test
public void serializeReplyWithCapabilityInfoArray() throws JsonGenerationException, JsonMappingException, IOException {
Object response = new GlobalDiscoveryEntry[] { new GlobalDiscoveryEntry(new Version(47, 11), "domain", "interface", "participantId", new ProviderQos(), System.currentTimeMillis(), expiryDateMs, publicKeyId, "channelId") };
Reply reply = new Reply(UUID.randomUUID().toString(), response);
String writeValueAsString = objectMapper.writeValueAsString(reply);
Reply receivedReply = objectMapper.readValue(writeValueAsString, Reply.class);
GlobalDiscoveryEntry[] convertValue = objectMapper.convertValue(receivedReply.getResponse()[0], GlobalDiscoveryEntry[].class);
Assert.assertArrayEquals((GlobalDiscoveryEntry[]) reply.getResponse()[0], convertValue);
ComplexTestType2[] complexTestType2Array = { new ComplexTestType2(3, 4), new ComplexTestType2(5, 6) };
ArrayList<ComplexTestType2> customListParam2List = new ArrayList<ComplexTestType2>();
customListParam2List.add(new ComplexTestType2(3, 4));
customListParam2List.add(new ComplexTestType2(5, 6));
ComplexTestType2[] convertValue2 = objectMapper.convertValue(customListParam2List, ComplexTestType2[].class);
Assert.assertArrayEquals(complexTestType2Array, convertValue2);
}
use of joynr.Reply in project joynr by bmwcarit.
the class SerializationTest method serializeReplyWithJoynrRuntimeExceptionWithoutMessage.
@Test
public void serializeReplyWithJoynrRuntimeExceptionWithoutMessage() throws IOException {
JoynrRuntimeException error = new JoynrRuntimeException();
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 serializeReplyWithJoynrIllegalStateException.
@Test
public void serializeReplyWithJoynrIllegalStateException() throws IOException {
JoynrIllegalStateException error = new JoynrIllegalStateException("detail message: JoynrIllegalStateException");
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