Search in sources :

Example 1 with ExtendedBaseStruct

use of joynr.interlanguagetest.namedTypeCollection2.ExtendedBaseStruct 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)

Example 2 with ExtendedBaseStruct

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

the class IltProviderBean method methodWithSingleStructParameters.

/*
     * methodWithSingleStructParameters
     */
@Override
public ExtendedStructOfPrimitives methodWithSingleStructParameters(ExtendedBaseStruct extendedBaseStructArg) {
    logger.warn("*****************************************************");
    logger.warn("* IltProvider.methodWithSingleStructParameters called");
    logger.warn("*****************************************************");
    if (!IltUtil.checkExtendedBaseStruct(extendedBaseStructArg)) {
        logger.error("methodWithSingleStructParameters: invalid parameter extendedBaseStructArg");
        throw new ProviderRuntimeException("methodWithSingleStructParameters: invalid parameter extendedBaseStructArg");
    }
    // prepare output parameters
    ExtendedStructOfPrimitives extendedStructOfPrimitivesOut = IltUtil.createExtendedStructOfPrimitives();
    return extendedStructOfPrimitivesOut;
}
Also used : ExtendedStructOfPrimitives(joynr.interlanguagetest.namedTypeCollection2.ExtendedStructOfPrimitives) ProviderRuntimeException(joynr.exceptions.ProviderRuntimeException)

Example 3 with ExtendedBaseStruct

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

the class IltProvider method overloadedMethod.

/*
     * overloadedMethod (3)
     */
@Override
public Promise<OverloadedMethod2Deferred> overloadedMethod(ExtendedExtendedEnumeration[] enumArrayArg, Long int64Arg, BaseStruct baseStructArg, Boolean booleanArg) {
    logger.warn("*****************************************");
    logger.warn("* IltProvider.overloadedMethod called (3)");
    logger.warn("*****************************************");
    OverloadedMethod2Deferred deferred = new OverloadedMethod2Deferred();
    // check input parameter
    if (int64Arg != 1L || booleanArg != false) {
        logger.warn("overloadedMethod_3: invalid argument int64Arg or booleanArg");
        deferred.reject(new ProviderRuntimeException("overloadedMethod_3: invalid parameter int64Arg or booleanArg"));
        return new Promise<OverloadedMethod2Deferred>(deferred);
    }
    // check enumArrayArg
    if (!IltUtil.checkExtendedExtendedEnumerationArray(enumArrayArg)) {
        deferred.reject(new ProviderRuntimeException("overloadedMethod_3: invalid parameter enumArrayArg"));
        return new Promise<OverloadedMethod2Deferred>(deferred);
    }
    // check baseStructArg
    if (!IltUtil.checkBaseStruct(baseStructArg)) {
        logger.warn("overloadedMethod_3: invalid argument baseStructArg");
        deferred.reject(new ProviderRuntimeException("overloadedMethod_3: invalid parameter baseStructArg"));
        return new Promise<OverloadedMethod2Deferred>(deferred);
    }
    // setup output parameter
    Double doubleOut = 0d;
    String[] stringArrayOut = IltUtil.createStringArray();
    ExtendedBaseStruct extendedBaseStructOut = IltUtil.createExtendedBaseStruct();
    deferred.resolve(doubleOut, stringArrayOut, extendedBaseStructOut);
    return new Promise<OverloadedMethod2Deferred>(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)

Example 4 with ExtendedBaseStruct

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

the class IltProvider method methodWithSingleStructParameters.

/*
     * methodWithSingleStructParameters
     */
@Override
public Promise<MethodWithSingleStructParametersDeferred> methodWithSingleStructParameters(ExtendedBaseStruct extendedBaseStructArg) {
    logger.warn("*****************************************************");
    logger.warn("* IltProvider.methodWithSingleStructParameters called");
    logger.warn("*****************************************************");
    MethodWithSingleStructParametersDeferred deferred = new MethodWithSingleStructParametersDeferred();
    if (!IltUtil.checkExtendedBaseStruct(extendedBaseStructArg)) {
        logger.error("methodWithSingleStructParameters: invalid parameter extendedBaseStructArg");
        deferred.reject(new ProviderRuntimeException("methodWithSingleStructParameters: invalid parameter extendedBaseStructArg"));
        return new Promise<MethodWithSingleStructParametersDeferred>(deferred);
    }
    // prepare output parameters
    ExtendedStructOfPrimitives extendedStructOfPrimitivesOut = IltUtil.createExtendedStructOfPrimitives();
    deferred.resolve(extendedStructOfPrimitivesOut);
    return new Promise<MethodWithSingleStructParametersDeferred>(deferred);
}
Also used : Promise(io.joynr.provider.Promise) ExtendedStructOfPrimitives(joynr.interlanguagetest.namedTypeCollection2.ExtendedStructOfPrimitives) ProviderRuntimeException(joynr.exceptions.ProviderRuntimeException)

Example 5 with ExtendedBaseStruct

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

the class IltConsumerSyncMethodTest method callMethodWithSingleStructParameters.

@Test
public void callMethodWithSingleStructParameters() {
    LOG.info(name.getMethodName() + "");
    try {
        ExtendedBaseStruct arg = IltUtil.createExtendedBaseStruct();
        ExtendedStructOfPrimitives result;
        result = testInterfaceProxy.methodWithSingleStructParameters(arg);
        if (result == null) {
            fail(name.getMethodName() + " - FAILED - got no result");
            return;
        }
        if (!IltUtil.checkExtendedStructOfPrimitives(result)) {
            fail(name.getMethodName() + " - FAILED - got invalid result - extendedStructOfPrimitives");
            return;
        }
    } catch (Exception e) {
        fail(name.getMethodName() + " - FAILED - caught unexpected exception: " + e.getMessage());
        return;
    }
    LOG.info(name.getMethodName() + " - OK");
}
Also used : ExtendedStructOfPrimitives(joynr.interlanguagetest.namedTypeCollection2.ExtendedStructOfPrimitives) ExtendedBaseStruct(joynr.interlanguagetest.namedTypeCollection2.ExtendedBaseStruct) ApplicationException(joynr.exceptions.ApplicationException) ProviderRuntimeException(joynr.exceptions.ProviderRuntimeException) Test(org.junit.Test)

Aggregations

ProviderRuntimeException (joynr.exceptions.ProviderRuntimeException)8 ExtendedBaseStruct (joynr.interlanguagetest.namedTypeCollection2.ExtendedBaseStruct)8 ExtendedExtendedBaseStruct (joynr.interlanguagetest.namedTypeCollection2.ExtendedExtendedBaseStruct)6 ExtendedStructOfPrimitives (joynr.interlanguagetest.namedTypeCollection2.ExtendedStructOfPrimitives)4 MapStringString (joynr.interlanguagetest.namedTypeCollection2.MapStringString)4 Promise (io.joynr.provider.Promise)3 ApplicationException (joynr.exceptions.ApplicationException)2 Test (org.junit.Test)2