Search in sources :

Example 1 with ExtendedEnumerationWithPartlyDefinedValues

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

the class IltConsumerGetterSetterTest method callGetAttributeExtendedEnumerationReadonly.

@Test
public void callGetAttributeExtendedEnumerationReadonly() {
    LOG.info(name.getMethodName() + "");
    try {
        ExtendedEnumerationWithPartlyDefinedValues result;
        // value is hardcoded on provider side since it is readonly
        result = testInterfaceProxy.getAttributeExtendedEnumerationReadonly();
        if (result == null) {
            fail(name.getMethodName() + " - FAILED - got no result");
            return;
        }
        if (result != ExtendedEnumerationWithPartlyDefinedValues.ENUM_2_VALUE_EXTENSION_FOR_ENUM_WITHOUT_DEFINED_VALUES) {
            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 : ExtendedEnumerationWithPartlyDefinedValues(joynr.interlanguagetest.namedTypeCollection2.ExtendedEnumerationWithPartlyDefinedValues) ProviderRuntimeException(joynr.exceptions.ProviderRuntimeException) Test(org.junit.Test)

Example 2 with ExtendedEnumerationWithPartlyDefinedValues

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

the class IltConsumerSyncMethodTest method callMethodWithSingleEnumParameters.

@Test
public void callMethodWithSingleEnumParameters() {
    LOG.info(name.getMethodName() + "");
    try {
        ExtendedEnumerationWithPartlyDefinedValues enumerationArg = ExtendedEnumerationWithPartlyDefinedValues.ENUM_2_VALUE_EXTENSION_FOR_ENUM_WITHOUT_DEFINED_VALUES;
        ExtendedTypeCollectionEnumerationInTypeCollection result;
        result = testInterfaceProxy.methodWithSingleEnumParameters(enumerationArg);
        if (result == null) {
            fail(name.getMethodName() + " - FAILED - got no result");
            return;
        }
        if (result != ExtendedTypeCollectionEnumerationInTypeCollection.ENUM_2_VALUE_EXTENSION_FOR_TYPECOLLECTION) {
            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 : ExtendedTypeCollectionEnumerationInTypeCollection(joynr.interlanguagetest.namedTypeCollection2.ExtendedTypeCollectionEnumerationInTypeCollection) ExtendedEnumerationWithPartlyDefinedValues(joynr.interlanguagetest.namedTypeCollection2.ExtendedEnumerationWithPartlyDefinedValues) ApplicationException(joynr.exceptions.ApplicationException) ProviderRuntimeException(joynr.exceptions.ProviderRuntimeException) Test(org.junit.Test)

Example 3 with ExtendedEnumerationWithPartlyDefinedValues

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

the class IltProviderBean method methodWithSingleEnumParameters.

/*
     * methodWithSingleEnumParameters
     *
     * return fixed value for now
     */
@Override
public ExtendedTypeCollectionEnumerationInTypeCollection methodWithSingleEnumParameters(ExtendedEnumerationWithPartlyDefinedValues enumerationArg) {
    logger.warn("***************************************************");
    logger.warn("* IltProvider.methodWithSingleEnumParameters called");
    logger.warn("***************************************************");
    // check input parameter
    if (enumerationArg != ExtendedEnumerationWithPartlyDefinedValues.ENUM_2_VALUE_EXTENSION_FOR_ENUM_WITHOUT_DEFINED_VALUES) {
        logger.warn("methodWithSingleEnumParameters: invalid argument enumerationArg");
        throw new ProviderRuntimeException("methodWithSingleEnumParameters: received wrong argument");
    }
    // prepare output parameter
    ExtendedTypeCollectionEnumerationInTypeCollection enumerationOut = ExtendedTypeCollectionEnumerationInTypeCollection.ENUM_2_VALUE_EXTENSION_FOR_TYPECOLLECTION;
    return enumerationOut;
}
Also used : ExtendedTypeCollectionEnumerationInTypeCollection(joynr.interlanguagetest.namedTypeCollection2.ExtendedTypeCollectionEnumerationInTypeCollection) ProviderRuntimeException(joynr.exceptions.ProviderRuntimeException)

Example 4 with ExtendedEnumerationWithPartlyDefinedValues

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

the class IltProviderBean method methodWithMultipleEnumParameters.

/*
     * methodWithMultipleEnumParameters
     *
     * return fixed values for now
     */
@Override
public MethodWithMultipleEnumParametersReturned methodWithMultipleEnumParameters(Enumeration enumerationArg, ExtendedTypeCollectionEnumerationInTypeCollection extendedEnumerationArg) {
    logger.warn("*****************************************************");
    logger.warn("* IltProvider.methodWithMultipleEnumParameters called");
    logger.warn("*****************************************************");
    // check input parameters
    if (enumerationArg != joynr.interlanguagetest.Enumeration.ENUM_0_VALUE_3 || extendedEnumerationArg != ExtendedTypeCollectionEnumerationInTypeCollection.ENUM_2_VALUE_EXTENSION_FOR_TYPECOLLECTION) {
        logger.warn("methodWithMultipleEnumParameters: invalid argument enumerationArg or extendedEnumerationArg");
        throw new ProviderRuntimeException("methodWithMultipleEnumParameters: received wrong argument");
    }
    // prepare output parameters
    ExtendedEnumerationWithPartlyDefinedValues extendedEnumerationOut = ExtendedEnumerationWithPartlyDefinedValues.ENUM_2_VALUE_EXTENSION_FOR_ENUM_WITHOUT_DEFINED_VALUES;
    Enumeration enumerationOut = Enumeration.ENUM_0_VALUE_1;
    return new MethodWithMultipleEnumParametersReturned(extendedEnumerationOut, enumerationOut);
}
Also used : Enumeration(joynr.interlanguagetest.Enumeration) ExtendedExtendedEnumeration(joynr.interlanguagetest.namedTypeCollection2.ExtendedExtendedEnumeration) ExtendedEnumerationWithPartlyDefinedValues(joynr.interlanguagetest.namedTypeCollection2.ExtendedEnumerationWithPartlyDefinedValues) ProviderRuntimeException(joynr.exceptions.ProviderRuntimeException)

Example 5 with ExtendedEnumerationWithPartlyDefinedValues

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

the class IltProvider method methodWithSingleEnumParameters.

/*
     * methodWithSingleEnumParameters
     *
     * return fixed value for now
     */
@Override
public Promise<MethodWithSingleEnumParametersDeferred> methodWithSingleEnumParameters(ExtendedEnumerationWithPartlyDefinedValues enumerationArg) {
    logger.warn("***************************************************");
    logger.warn("* IltProvider.methodWithSingleEnumParameters called");
    logger.warn("***************************************************");
    MethodWithSingleEnumParametersDeferred deferred = new MethodWithSingleEnumParametersDeferred();
    // check input parameter
    if (enumerationArg != ExtendedEnumerationWithPartlyDefinedValues.ENUM_2_VALUE_EXTENSION_FOR_ENUM_WITHOUT_DEFINED_VALUES) {
        logger.warn("methodWithSingleEnumParameters: invalid argument enumerationArg");
        deferred.reject(new ProviderRuntimeException("methodWithSingleEnumParameters: received wrong argument"));
        return new Promise<MethodWithSingleEnumParametersDeferred>(deferred);
    }
    // prepare output parameter
    ExtendedTypeCollectionEnumerationInTypeCollection enumerationOut = ExtendedTypeCollectionEnumerationInTypeCollection.ENUM_2_VALUE_EXTENSION_FOR_TYPECOLLECTION;
    deferred.resolve(enumerationOut);
    return new Promise<MethodWithSingleEnumParametersDeferred>(deferred);
}
Also used : Promise(io.joynr.provider.Promise) ExtendedTypeCollectionEnumerationInTypeCollection(joynr.interlanguagetest.namedTypeCollection2.ExtendedTypeCollectionEnumerationInTypeCollection) ProviderRuntimeException(joynr.exceptions.ProviderRuntimeException)

Aggregations

ProviderRuntimeException (joynr.exceptions.ProviderRuntimeException)8 ExtendedEnumerationWithPartlyDefinedValues (joynr.interlanguagetest.namedTypeCollection2.ExtendedEnumerationWithPartlyDefinedValues)8 Enumeration (joynr.interlanguagetest.Enumeration)4 ExtendedExtendedEnumeration (joynr.interlanguagetest.namedTypeCollection2.ExtendedExtendedEnumeration)4 ExtendedTypeCollectionEnumerationInTypeCollection (joynr.interlanguagetest.namedTypeCollection2.ExtendedTypeCollectionEnumerationInTypeCollection)4 Test (org.junit.Test)4 Promise (io.joynr.provider.Promise)3 ApplicationException (joynr.exceptions.ApplicationException)2 DeferredVoid (io.joynr.provider.DeferredVoid)1