Search in sources :

Example 6 with Enumeration

use of joynr.interlanguagetest.Enumeration in project joynr by bmwcarit.

the class IltConsumerGetterSetterTest method callGetAttributeEnumeration.

@Test
public void callGetAttributeEnumeration() {
    LOG.info(name.getMethodName() + "");
    try {
        Enumeration result;
        // must set the value before it can be retrieved again
        Enumeration enumerationArg = Enumeration.ENUM_0_VALUE_2;
        testInterfaceProxy.setAttributeEnumeration(enumerationArg);
        result = testInterfaceProxy.getAttributeEnumeration();
        if (result == null) {
            fail(name.getMethodName() + " - FAILED - got no result");
            return;
        }
        if (result != Enumeration.ENUM_0_VALUE_2) {
            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 : Enumeration(joynr.interlanguagetest.Enumeration) ProviderRuntimeException(joynr.exceptions.ProviderRuntimeException) Test(org.junit.Test)

Example 7 with Enumeration

use of joynr.interlanguagetest.Enumeration in project joynr by bmwcarit.

the class IltProvider method methodToFireBroadcastWithMultipleEnumerationParameters.

/*
     * methodToFireBroadcastWithMultipleEnumerationParameters
     */
@Override
public Promise<DeferredVoid> methodToFireBroadcastWithMultipleEnumerationParameters(String[] partitions) {
    logger.warn("***************************************************************************");
    logger.warn("* IltProvider.methodToFireBroadcastWithMultipleEnumerationParameters called");
    logger.warn("***************************************************************************");
    DeferredVoid deferred = new DeferredVoid();
    deferred.resolve();
    ExtendedEnumerationWithPartlyDefinedValues extendedEnumerationOut = ExtendedEnumerationWithPartlyDefinedValues.ENUM_2_VALUE_EXTENSION_FOR_ENUM_WITHOUT_DEFINED_VALUES;
    Enumeration enumerationOut = Enumeration.ENUM_0_VALUE_1;
    fireBroadcastWithMultipleEnumerationParameters(extendedEnumerationOut, enumerationOut, partitions);
    return new Promise<DeferredVoid>(deferred);
}
Also used : Promise(io.joynr.provider.Promise) Enumeration(joynr.interlanguagetest.Enumeration) ExtendedExtendedEnumeration(joynr.interlanguagetest.namedTypeCollection2.ExtendedExtendedEnumeration) ExtendedEnumerationWithPartlyDefinedValues(joynr.interlanguagetest.namedTypeCollection2.ExtendedEnumerationWithPartlyDefinedValues) DeferredVoid(io.joynr.provider.DeferredVoid)

Example 8 with Enumeration

use of joynr.interlanguagetest.Enumeration in project joynr by bmwcarit.

the class IltProvider method methodWithMultipleEnumParameters.

/*
     * methodWithMultipleEnumParameters
     *
     * return fixed values for now
     */
@Override
public Promise<MethodWithMultipleEnumParametersDeferred> methodWithMultipleEnumParameters(Enumeration enumerationArg, ExtendedTypeCollectionEnumerationInTypeCollection extendedEnumerationArg) {
    logger.warn("*****************************************************");
    logger.warn("* IltProvider.methodWithMultipleEnumParameters called");
    logger.warn("*****************************************************");
    MethodWithMultipleEnumParametersDeferred deferred = new MethodWithMultipleEnumParametersDeferred();
    // 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");
        deferred.reject(new ProviderRuntimeException("methodWithMultipleEnumParameters: received wrong argument"));
        return new Promise<MethodWithMultipleEnumParametersDeferred>(deferred);
    }
    // prepare output parameters
    ExtendedEnumerationWithPartlyDefinedValues extendedEnumerationOut = ExtendedEnumerationWithPartlyDefinedValues.ENUM_2_VALUE_EXTENSION_FOR_ENUM_WITHOUT_DEFINED_VALUES;
    Enumeration enumerationOut = Enumeration.ENUM_0_VALUE_1;
    deferred.resolve(extendedEnumerationOut, enumerationOut);
    return new Promise<MethodWithMultipleEnumParametersDeferred>(deferred);
}
Also used : Promise(io.joynr.provider.Promise) Enumeration(joynr.interlanguagetest.Enumeration) ExtendedExtendedEnumeration(joynr.interlanguagetest.namedTypeCollection2.ExtendedExtendedEnumeration) ExtendedEnumerationWithPartlyDefinedValues(joynr.interlanguagetest.namedTypeCollection2.ExtendedEnumerationWithPartlyDefinedValues) ProviderRuntimeException(joynr.exceptions.ProviderRuntimeException)

Example 9 with Enumeration

use of joynr.interlanguagetest.Enumeration in project joynr by bmwcarit.

the class IltProviderBean method methodToFireBroadcastWithMultipleEnumerationParameters.

/*
     * methodToFireBroadcastWithMultipleEnumerationParameters
     */
@Override
public void methodToFireBroadcastWithMultipleEnumerationParameters() {
    logger.warn("***************************************************************************");
    logger.warn("* IltProvider.methodToFireBroadcastWithMultipleEnumerationParameters called");
    logger.warn("***************************************************************************");
    ExtendedEnumerationWithPartlyDefinedValues extendedEnumerationOut = ExtendedEnumerationWithPartlyDefinedValues.ENUM_2_VALUE_EXTENSION_FOR_ENUM_WITHOUT_DEFINED_VALUES;
    Enumeration enumerationOut = Enumeration.ENUM_0_VALUE_1;
// TODO
// fireBroadcastWithMultipleEnumerationParameters(extendedEnumerationOut, enumerationOut);
}
Also used : Enumeration(joynr.interlanguagetest.Enumeration) ExtendedExtendedEnumeration(joynr.interlanguagetest.namedTypeCollection2.ExtendedExtendedEnumeration) ExtendedEnumerationWithPartlyDefinedValues(joynr.interlanguagetest.namedTypeCollection2.ExtendedEnumerationWithPartlyDefinedValues)

Aggregations

Enumeration (joynr.interlanguagetest.Enumeration)9 ProviderRuntimeException (joynr.exceptions.ProviderRuntimeException)7 Test (org.junit.Test)5 ExtendedEnumerationWithPartlyDefinedValues (joynr.interlanguagetest.namedTypeCollection2.ExtendedEnumerationWithPartlyDefinedValues)4 ExtendedExtendedEnumeration (joynr.interlanguagetest.namedTypeCollection2.ExtendedExtendedEnumeration)4 Promise (io.joynr.provider.Promise)2 JoynrRuntimeException (io.joynr.exceptions.JoynrRuntimeException)1 DeferredVoid (io.joynr.provider.DeferredVoid)1 AttributeSubscriptionAdapter (io.joynr.pubsub.subscription.AttributeSubscriptionAdapter)1 OnChangeWithKeepAliveSubscriptionQos (joynr.OnChangeWithKeepAliveSubscriptionQos)1