Search in sources :

Example 1 with ComplexTestType2

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);
}
Also used : joynr.tests.testProxy(joynr.tests.testProxy) ComplexTestType2(joynr.tests.testTypes.ComplexTestType2) ComplexTestType(joynr.tests.testTypes.ComplexTestType) Test(org.junit.Test)

Example 2 with ComplexTestType2

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);
}
Also used : joynr.tests.testProxy(joynr.tests.testProxy) ComplexTestType2(joynr.tests.testTypes.ComplexTestType2) ComplexTestType(joynr.tests.testTypes.ComplexTestType) Test(org.junit.Test)

Example 3 with ComplexTestType2

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);
}
Also used : Version(joynr.types.Version) GlobalDiscoveryEntry(joynr.types.GlobalDiscoveryEntry) ArrayList(java.util.ArrayList) Reply(joynr.Reply) ComplexTestType2(joynr.tests.testTypes.ComplexTestType2) ProviderQos(joynr.types.ProviderQos) Test(org.junit.Test)

Aggregations

ComplexTestType2 (joynr.tests.testTypes.ComplexTestType2)3 Test (org.junit.Test)3 joynr.tests.testProxy (joynr.tests.testProxy)2 ComplexTestType (joynr.tests.testTypes.ComplexTestType)2 ArrayList (java.util.ArrayList)1 Reply (joynr.Reply)1 GlobalDiscoveryEntry (joynr.types.GlobalDiscoveryEntry)1 ProviderQos (joynr.types.ProviderQos)1 Version (joynr.types.Version)1