Search in sources :

Example 1 with MethodWithMultipleArrayParametersReturned

use of joynr.interlanguagetest.TestInterfaceSync.MethodWithMultipleArrayParametersReturned in project joynr by bmwcarit.

the class IltConsumerSyncMethodTest method callMethodWithMultipleArrayParameters.

@Test
public void callMethodWithMultipleArrayParameters() {
    LOG.info(name.getMethodName() + "");
    try {
        String[] arg1 = IltUtil.createStringArray();
        Byte[] arg2 = IltUtil.createByteArray();
        ExtendedInterfaceEnumerationInTypeCollection[] arg3 = IltUtil.createExtendedInterfaceEnumerationInTypeCollectionArray();
        StructWithStringArray[] arg4 = IltUtil.createStructWithStringArrayArray();
        MethodWithMultipleArrayParametersReturned result;
        result = testInterfaceProxy.methodWithMultipleArrayParameters(arg1, arg2, arg3, arg4);
        if (result == null) {
            fail(name.getMethodName() + " - FAILED - got no result");
            return;
        }
        if (!IltUtil.checkUInt64Array(result.uInt64ArrayOut)) {
            fail(name.getMethodName() + " - FAILED - got invalid result - stringArrayArg");
            return;
        }
        if (result.structWithStringArrayArrayOut.length != 2) {
            fail(name.getMethodName() + " - FAILED - got invalid result - structWithStringArrayArrayOut");
            return;
        }
        if (!IltUtil.checkStructWithStringArray(result.structWithStringArrayArrayOut[0])) {
            fail(name.getMethodName() + " - FAILED - got invalid result - structWithStringArrayArrayOut[0]");
            return;
        }
        if (!IltUtil.checkStructWithStringArray(result.structWithStringArrayArrayOut[1])) {
            fail(name.getMethodName() + " - FAILED - got invalid result - structWithStringArrayArrayOut[1]");
            return;
        }
    } catch (Exception e) {
        fail(name.getMethodName() + " - FAILED - caught unexpected exception: " + e.getMessage());
        return;
    }
    LOG.info(name.getMethodName() + " - OK");
}
Also used : ExtendedInterfaceEnumerationInTypeCollection(joynr.interlanguagetest.namedTypeCollection2.ExtendedInterfaceEnumerationInTypeCollection) MethodWithMultipleArrayParametersReturned(joynr.interlanguagetest.TestInterfaceSync.MethodWithMultipleArrayParametersReturned) MapStringString(joynr.interlanguagetest.namedTypeCollection2.MapStringString) StructWithStringArray(joynr.interlanguagetest.namedTypeCollection1.StructWithStringArray) ApplicationException(joynr.exceptions.ApplicationException) ProviderRuntimeException(joynr.exceptions.ProviderRuntimeException) Test(org.junit.Test)

Example 2 with MethodWithMultipleArrayParametersReturned

use of joynr.interlanguagetest.TestInterfaceSync.MethodWithMultipleArrayParametersReturned in project joynr by bmwcarit.

the class IltConsumerSyncMethodTest method callMethodWithMultipleArrayParameters.

@Test
public void callMethodWithMultipleArrayParameters() {
    LOG.info(name.getMethodName() + "");
    try {
        String[] arg1 = IltUtil.createStringArray();
        Byte[] arg2 = IltUtil.createByteArray();
        ExtendedInterfaceEnumerationInTypeCollection[] arg3 = IltUtil.createExtendedInterfaceEnumerationInTypeCollectionArray();
        StructWithStringArray[] arg4 = IltUtil.createStructWithStringArrayArray();
        MethodWithMultipleArrayParametersReturned result;
        result = testInterfaceProxy.methodWithMultipleArrayParameters(arg1, arg2, arg3, arg4);
        if (result == null) {
            fail(name.getMethodName() + " - FAILED - got no result");
            return;
        }
        if (!IltUtil.checkUInt64Array(result.uInt64ArrayOut)) {
            fail(name.getMethodName() + " - FAILED - got invalid result - stringArrayArg");
            return;
        }
        if (result.structWithStringArrayArrayOut.length != 2) {
            fail(name.getMethodName() + " - FAILED - got invalid result - structWithStringArrayArrayOut");
            return;
        }
        if (!IltUtil.checkStructWithStringArray(result.structWithStringArrayArrayOut[0])) {
            fail(name.getMethodName() + " - FAILED - got invalid result - structWithStringArrayArrayOut[0]");
            return;
        }
        if (!IltUtil.checkStructWithStringArray(result.structWithStringArrayArrayOut[1])) {
            fail(name.getMethodName() + " - FAILED - got invalid result - structWithStringArrayArrayOut[1]");
            return;
        }
    } catch (Exception e) {
        fail(name.getMethodName() + " - FAILED - caught unexpected exception: " + e.getMessage());
        return;
    }
    LOG.info(name.getMethodName() + " - OK");
}
Also used : ExtendedInterfaceEnumerationInTypeCollection(joynr.interlanguagetest.namedTypeCollection2.ExtendedInterfaceEnumerationInTypeCollection) MethodWithMultipleArrayParametersReturned(joynr.interlanguagetest.TestInterfaceSync.MethodWithMultipleArrayParametersReturned) MapStringString(joynr.interlanguagetest.namedTypeCollection2.MapStringString) StructWithStringArray(joynr.interlanguagetest.namedTypeCollection1.StructWithStringArray) ApplicationException(joynr.exceptions.ApplicationException) ProviderRuntimeException(joynr.exceptions.ProviderRuntimeException) Test(org.junit.Test)

Aggregations

ApplicationException (joynr.exceptions.ApplicationException)2 ProviderRuntimeException (joynr.exceptions.ProviderRuntimeException)2 MethodWithMultipleArrayParametersReturned (joynr.interlanguagetest.TestInterfaceSync.MethodWithMultipleArrayParametersReturned)2 StructWithStringArray (joynr.interlanguagetest.namedTypeCollection1.StructWithStringArray)2 ExtendedInterfaceEnumerationInTypeCollection (joynr.interlanguagetest.namedTypeCollection2.ExtendedInterfaceEnumerationInTypeCollection)2 MapStringString (joynr.interlanguagetest.namedTypeCollection2.MapStringString)2 Test (org.junit.Test)2