Search in sources :

Example 1 with MethodWithMultipleOutputParametersReturned

use of joynr.tests.testSync.MethodWithMultipleOutputParametersReturned in project joynr by bmwcarit.

the class AbstractProviderProxyEnd2EndTest method calledMethodReturnsMultipleOutputParameters.

@Test(timeout = CONST_DEFAULT_TEST_TIMEOUT)
public void calledMethodReturnsMultipleOutputParameters() throws Exception {
    ProxyBuilder<testProxy> proxyBuilder = consumerRuntime.getProxyBuilder(domain, testProxy.class);
    testProxy proxy = proxyBuilder.setMessagingQos(messagingQos).setDiscoveryQos(discoveryQos).build();
    MethodWithMultipleOutputParametersReturned result = proxy.methodWithMultipleOutputParameters();
    assertEquals(TEST_INTEGER, result.aNumber);
    assertEquals(TEST_STRING, result.aString);
    assertEquals(TEST_COMPLEXTYPE, result.aComplexDataType);
    assertEquals(TEST_ENUM, result.anEnumResult);
}
Also used : MethodWithMultipleOutputParametersReturned(joynr.tests.testSync.MethodWithMultipleOutputParametersReturned) joynr.tests.testProxy(joynr.tests.testProxy) Test(org.junit.Test)

Example 2 with MethodWithMultipleOutputParametersReturned

use of joynr.tests.testSync.MethodWithMultipleOutputParametersReturned in project joynr by bmwcarit.

the class AbstractProviderProxyEnd2EndTest method calledMethodReturnsMultipleOutputParametersAsyncFuture.

@Test(timeout = CONST_DEFAULT_TEST_TIMEOUT)
public void calledMethodReturnsMultipleOutputParametersAsyncFuture() throws Exception {
    ProxyBuilder<testProxy> proxyBuilder = consumerRuntime.getProxyBuilder(domain, testProxy.class);
    testProxy proxy = proxyBuilder.setMessagingQos(messagingQos).setDiscoveryQos(discoveryQos).build();
    Future<MethodWithMultipleOutputParametersReturned> future = proxy.methodWithMultipleOutputParameters(new MethodWithMultipleOutputParametersCallback() {

        @Override
        public void onFailure(JoynrRuntimeException error) {
            logger.error("error in calledMethodReturnsMultipleOutputParametersAsyncCallback", error);
        }

        @Override
        public void onSuccess(String aString, Integer aNumber, GpsLocation aComplexDataType, TestEnum anEnumResult) {
            assertEquals(TEST_INTEGER, aNumber);
            assertEquals(TEST_STRING, aString);
            assertEquals(TEST_COMPLEXTYPE, aComplexDataType);
            assertEquals(TEST_ENUM, anEnumResult);
        }
    });
    MethodWithMultipleOutputParametersReturned reply = future.get();
    assertEquals(TEST_INTEGER, reply.aNumber);
    assertEquals(TEST_STRING, reply.aString);
    assertEquals(TEST_COMPLEXTYPE, reply.aComplexDataType);
    assertEquals(TEST_ENUM, reply.anEnumResult);
}
Also used : MethodWithMultipleOutputParametersReturned(joynr.tests.testSync.MethodWithMultipleOutputParametersReturned) joynr.tests.testProxy(joynr.tests.testProxy) GpsLocation(joynr.types.Localisation.GpsLocation) TestEnum(joynr.tests.testTypes.TestEnum) MethodWithMultipleOutputParametersCallback(joynr.tests.testAsync.MethodWithMultipleOutputParametersCallback) JoynrRuntimeException(io.joynr.exceptions.JoynrRuntimeException) Test(org.junit.Test)

Aggregations

joynr.tests.testProxy (joynr.tests.testProxy)2 MethodWithMultipleOutputParametersReturned (joynr.tests.testSync.MethodWithMultipleOutputParametersReturned)2 Test (org.junit.Test)2 JoynrRuntimeException (io.joynr.exceptions.JoynrRuntimeException)1 MethodWithMultipleOutputParametersCallback (joynr.tests.testAsync.MethodWithMultipleOutputParametersCallback)1 TestEnum (joynr.tests.testTypes.TestEnum)1 GpsLocation (joynr.types.Localisation.GpsLocation)1