Search in sources :

Example 1 with BaseStruct

use of joynr.interlanguagetest.namedTypeCollection2.BaseStruct in project joynr by bmwcarit.

the class IltConsumerGetterSetterTest method callGetAttributeBaseStruct.

// no setter for attributeExtendedEnumerationReadonly
@Test
public void callGetAttributeBaseStruct() {
    LOG.info(name.getMethodName() + "");
    try {
        BaseStruct result;
        // must set the value before it can be retrieved again
        BaseStruct baseStructArg = IltUtil.createBaseStruct();
        testInterfaceProxy.setAttributeBaseStruct(baseStructArg);
        result = testInterfaceProxy.getAttributeBaseStruct();
        if (result == null) {
            fail(name.getMethodName() + " - FAILED - got no result");
            return;
        }
        if (!IltUtil.checkBaseStruct(result)) {
            fail(name.getMethodName() + " - FAILED - got invalid result");
            return;
        }
    } catch (Exception e) {
        fail(name.getMethodName() + " - FAILED - caught unexpected exception: " + e.getMessage());
        return;
    }
    LOG.info(name.getMethodName() + " - OK");
}
Also used : BaseStruct(joynr.interlanguagetest.namedTypeCollection2.BaseStruct) ExtendedExtendedBaseStruct(joynr.interlanguagetest.namedTypeCollection2.ExtendedExtendedBaseStruct) ProviderRuntimeException(joynr.exceptions.ProviderRuntimeException) Test(org.junit.Test)

Example 2 with BaseStruct

use of joynr.interlanguagetest.namedTypeCollection2.BaseStruct in project joynr by bmwcarit.

the class IltConsumerSyncMethodTest method callOverloadedMethod_3.

@Test
public void callOverloadedMethod_3() {
    LOG.info(name.getMethodName() + "");
    try {
        OverloadedMethodOverloadedMethod1Returned result;
        ExtendedExtendedEnumeration[] enumArrayArg = IltUtil.createExtendedExtendedEnumerationArray();
        Long int64Arg = 1L;
        BaseStruct baseStructArg = IltUtil.createBaseStruct();
        Boolean booleanArg = false;
        result = testInterfaceProxy.overloadedMethod(enumArrayArg, int64Arg, baseStructArg, booleanArg);
        if (result == null) {
            fail(name.getMethodName() + " - FAILED - got no result");
            return;
        }
        if (result.doubleOut != 0d || !IltUtil.checkStringArray(result.stringArrayOut)) {
            fail(name.getMethodName() + " - FAILED - got invalid result - doubleOut");
            return;
        }
        if (!IltUtil.checkExtendedBaseStruct(result.extendedBaseStructOut)) {
            fail(name.getMethodName() + " - FAILED - got invalid result - extendedBaseStructOut");
            return;
        }
    } catch (Exception e) {
        fail(name.getMethodName() + " - FAILED - caught unexpected exception: " + e.getMessage());
        return;
    }
    LOG.info(name.getMethodName() + " - OK");
}
Also used : ExtendedBaseStruct(joynr.interlanguagetest.namedTypeCollection2.ExtendedBaseStruct) BaseStruct(joynr.interlanguagetest.namedTypeCollection2.BaseStruct) OverloadedMethodOverloadedMethod1Returned(joynr.interlanguagetest.TestInterfaceSync.OverloadedMethodOverloadedMethod1Returned) ExtendedExtendedEnumeration(joynr.interlanguagetest.namedTypeCollection2.ExtendedExtendedEnumeration) ApplicationException(joynr.exceptions.ApplicationException) ProviderRuntimeException(joynr.exceptions.ProviderRuntimeException) Test(org.junit.Test)

Example 3 with BaseStruct

use of joynr.interlanguagetest.namedTypeCollection2.BaseStruct in project joynr by bmwcarit.

the class IltConsumerSyncMethodTest method callMethodWithMultipleStructParameters.

@Test
public void callMethodWithMultipleStructParameters() {
    LOG.info(name.getMethodName() + "");
    try {
        MethodWithMultipleStructParametersReturned result;
        // setup input parameters
        ExtendedStructOfPrimitives extendedStructOfPrimitivesOut = IltUtil.createExtendedStructOfPrimitives();
        BaseStruct baseStructOut = IltUtil.createBaseStruct();
        result = testInterfaceProxy.methodWithMultipleStructParameters(extendedStructOfPrimitivesOut, baseStructOut);
        if (result == null) {
            fail(name.getMethodName() + " - FAILED - got no result");
            return;
        }
        if (!IltUtil.checkBaseStructWithoutElements(result.baseStructWithoutElementsOut)) {
            fail(name.getMethodName() + " - FAILED - got invalid result - baseStructWithoutElementsOut");
            return;
        }
        if (!IltUtil.checkExtendedExtendedBaseStruct(result.extendedExtendedBaseStructOut)) {
            fail(name.getMethodName() + " - FAILED - got invalid result - extendedExtendedBaseStructOut");
            return;
        }
    } catch (Exception e) {
        fail(name.getMethodName() + " - FAILED - caught unexpected exception: " + e.getMessage());
        return;
    }
    LOG.info(name.getMethodName() + " - OK");
}
Also used : MethodWithMultipleStructParametersReturned(joynr.interlanguagetest.TestInterfaceSync.MethodWithMultipleStructParametersReturned) ExtendedBaseStruct(joynr.interlanguagetest.namedTypeCollection2.ExtendedBaseStruct) BaseStruct(joynr.interlanguagetest.namedTypeCollection2.BaseStruct) ExtendedStructOfPrimitives(joynr.interlanguagetest.namedTypeCollection2.ExtendedStructOfPrimitives) ApplicationException(joynr.exceptions.ApplicationException) ProviderRuntimeException(joynr.exceptions.ProviderRuntimeException) Test(org.junit.Test)

Example 4 with BaseStruct

use of joynr.interlanguagetest.namedTypeCollection2.BaseStruct in project joynr by bmwcarit.

the class IltUtil method createBaseStruct.

public static BaseStruct createBaseStruct() {
    BaseStruct baseStruct = new BaseStruct();
    fillBaseStruct(baseStruct);
    return baseStruct;
}
Also used : ExtendedExtendedBaseStruct(joynr.interlanguagetest.namedTypeCollection2.ExtendedExtendedBaseStruct) ExtendedBaseStruct(joynr.interlanguagetest.namedTypeCollection2.ExtendedBaseStruct) BaseStruct(joynr.interlanguagetest.namedTypeCollection2.BaseStruct)

Example 5 with BaseStruct

use of joynr.interlanguagetest.namedTypeCollection2.BaseStruct in project joynr by bmwcarit.

the class IltProvider method overloadedMethodWithSelector.

/*
     * overloadedMethodWithSelector (3)
     */
@Override
public Promise<OverloadedMethodWithSelector2Deferred> overloadedMethodWithSelector(ExtendedExtendedEnumeration[] enumArrayArg, Long int64Arg, BaseStruct baseStructArg, Boolean booleanArg) {
    logger.warn("*************************************************");
    logger.warn("* IltProvider.overloadedMethodWithSelector called");
    logger.warn("*************************************************");
    OverloadedMethodWithSelector2Deferred deferred = new OverloadedMethodWithSelector2Deferred();
    /* check input */
    if (!IltUtil.checkExtendedExtendedEnumerationArray(enumArrayArg)) {
        deferred.reject(new ProviderRuntimeException("overloadedMethodWithSelector: failed to compare enumArrayArg"));
        return new Promise<OverloadedMethodWithSelector2Deferred>(deferred);
    }
    if (int64Arg != 1L) {
        deferred.reject(new ProviderRuntimeException("overloadedMethodWithSelector: failed to compare int64Arg"));
        return new Promise<OverloadedMethodWithSelector2Deferred>(deferred);
    }
    if (!IltUtil.checkBaseStruct(baseStructArg)) {
        deferred.reject(new ProviderRuntimeException("overloadedMethodWithSelector: failed to compare baseStructArg"));
        return new Promise<OverloadedMethodWithSelector2Deferred>(deferred);
    }
    if (booleanArg != false) {
        deferred.reject(new ProviderRuntimeException("overloadedMethodWithSelector: failed to compare booleanArg"));
        return new Promise<OverloadedMethodWithSelector2Deferred>(deferred);
    }
    /* prepare output */
    Double doubleOut = 1.1d;
    String[] stringArrayOut = IltUtil.createStringArray();
    ExtendedBaseStruct extendedBaseStructOut = IltUtil.createExtendedBaseStruct();
    deferred.resolve(doubleOut, stringArrayOut, extendedBaseStructOut);
    return new Promise<OverloadedMethodWithSelector2Deferred>(deferred);
}
Also used : Promise(io.joynr.provider.Promise) ExtendedExtendedBaseStruct(joynr.interlanguagetest.namedTypeCollection2.ExtendedExtendedBaseStruct) ExtendedBaseStruct(joynr.interlanguagetest.namedTypeCollection2.ExtendedBaseStruct) MapStringString(joynr.interlanguagetest.namedTypeCollection2.MapStringString) ProviderRuntimeException(joynr.exceptions.ProviderRuntimeException)

Aggregations

ProviderRuntimeException (joynr.exceptions.ProviderRuntimeException)17 BaseStruct (joynr.interlanguagetest.namedTypeCollection2.BaseStruct)13 ExtendedExtendedBaseStruct (joynr.interlanguagetest.namedTypeCollection2.ExtendedExtendedBaseStruct)13 ExtendedBaseStruct (joynr.interlanguagetest.namedTypeCollection2.ExtendedBaseStruct)12 Test (org.junit.Test)11 ApplicationException (joynr.exceptions.ApplicationException)7 ExtendedExtendedEnumeration (joynr.interlanguagetest.namedTypeCollection2.ExtendedExtendedEnumeration)4 MapStringString (joynr.interlanguagetest.namedTypeCollection2.MapStringString)4 Promise (io.joynr.provider.Promise)3 MethodWithMultipleStructParametersReturned (joynr.interlanguagetest.TestInterfaceSync.MethodWithMultipleStructParametersReturned)3 BaseStructWithoutElements (joynr.interlanguagetest.namedTypeCollection2.BaseStructWithoutElements)3 ExtendedStructOfPrimitives (joynr.interlanguagetest.namedTypeCollection2.ExtendedStructOfPrimitives)3 OverloadedMethodOverloadedMethod1Returned (joynr.interlanguagetest.TestInterfaceSync.OverloadedMethodOverloadedMethod1Returned)2 OverloadedMethodWithSelectorOverloadedMethodWithSelector1Returned (joynr.interlanguagetest.TestInterfaceSync.OverloadedMethodWithSelectorOverloadedMethodWithSelector1Returned)2 JoynrRuntimeException (io.joynr.exceptions.JoynrRuntimeException)1 MethodWithMultipleStructParametersCallback (joynr.interlanguagetest.TestInterfaceAsync.MethodWithMultipleStructParametersCallback)1 MethodWithMultipleStructParametersFuture (joynr.interlanguagetest.TestInterfaceAsync.MethodWithMultipleStructParametersFuture)1