use of joynr.tests.testTypes.ComplexTestType2 in project joynr by bmwcarit.
the class AbstractProviderProxyEnd2EndTest method syncMethodCallWithArrayParameter.
@Test(timeout = CONST_DEFAULT_TEST_TIMEOUT)
public void syncMethodCallWithArrayParameter() {
ProxyBuilder<testProxy> proxyBuilder = consumerRuntime.getProxyBuilder(domain, testProxy.class);
testProxy proxy = proxyBuilder.setMessagingQos(messagingQos).setDiscoveryQos(discoveryQos).build();
ComplexTestType customParam = new ComplexTestType(1, 2);
ComplexTestType2[] customListParam = { new ComplexTestType2(3, 4), new ComplexTestType2(5, 6) };
proxy.methodCustomCustomListParameters(customParam, customListParam);
}
use of joynr.tests.testTypes.ComplexTestType2 in project joynr by bmwcarit.
the class AbstractProviderProxyEnd2EndTest method overloadedMethodWithDifferentReturnTypes.
@Test(timeout = CONST_DEFAULT_TEST_TIMEOUT)
public void overloadedMethodWithDifferentReturnTypes() throws DiscoveryException, JoynrIllegalStateException, InterruptedException {
ProxyBuilder<testProxy> proxyBuilder = consumerRuntime.getProxyBuilder(domain, testProxy.class);
testProxy proxy = proxyBuilder.setMessagingQos(messagingQos).setDiscoveryQos(discoveryQos).build();
ComplexTestType expectedResult1 = new ComplexTestType(42, 42);
ComplexTestType2 expectedResult2 = new ComplexTestType2(43, 44);
ComplexTestType result1 = proxy.overloadedOperation("42");
ComplexTestType2 result2 = proxy.overloadedOperation("43", "44");
assertEquals(expectedResult1, result1);
assertEquals(expectedResult2, result2);
}
use of joynr.tests.testTypes.ComplexTestType2 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);
}
Aggregations