Search in sources :

Example 1 with ExtendedTypeCollectionEnumerationInTypeCollection

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

the class IltConsumerSyncMethodTest method callMethodWithMultipleEnumParameters.

@Test
public void callMethodWithMultipleEnumParameters() {
    LOG.info(name.getMethodName() + "");
    try {
        joynr.interlanguagetest.Enumeration enumerationArg;
        ExtendedTypeCollectionEnumerationInTypeCollection extendedEnumerationArg;
        MethodWithMultipleEnumParametersReturned result;
        enumerationArg = joynr.interlanguagetest.Enumeration.ENUM_0_VALUE_3;
        extendedEnumerationArg = ExtendedTypeCollectionEnumerationInTypeCollection.ENUM_2_VALUE_EXTENSION_FOR_TYPECOLLECTION;
        result = testInterfaceProxy.methodWithMultipleEnumParameters(enumerationArg, extendedEnumerationArg);
        if (result == null) {
            fail(name.getMethodName() + " - FAILED - got no result");
            return;
        }
        if (result.enumerationOut != Enumeration.ENUM_0_VALUE_1 || result.extendedEnumerationOut != ExtendedEnumerationWithPartlyDefinedValues.ENUM_2_VALUE_EXTENSION_FOR_ENUM_WITHOUT_DEFINED_VALUES) {
            LOG.info(name.getMethodName() + " - FAILED");
            fail(name.getMethodName() + " - FAILED - got invalid result - enumerationOut");
            return;
        }
    } catch (Exception e) {
        fail(name.getMethodName() + " - FAILED - caught unexpected exception: " + e.getMessage());
        return;
    }
    LOG.info(name.getMethodName() + " - OK");
}
Also used : MethodWithMultipleEnumParametersReturned(joynr.interlanguagetest.TestInterfaceSync.MethodWithMultipleEnumParametersReturned) ExtendedTypeCollectionEnumerationInTypeCollection(joynr.interlanguagetest.namedTypeCollection2.ExtendedTypeCollectionEnumerationInTypeCollection) Enumeration(joynr.interlanguagetest.Enumeration) ApplicationException(joynr.exceptions.ApplicationException) ProviderRuntimeException(joynr.exceptions.ProviderRuntimeException) Test(org.junit.Test)

Example 2 with ExtendedTypeCollectionEnumerationInTypeCollection

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

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

the class IltProvider method methodToFireBroadcastWithSingleEnumerationParameter.

/*
     * methodToFireBroadcastWithSingleEnumerationParameter
     */
@Override
public Promise<DeferredVoid> methodToFireBroadcastWithSingleEnumerationParameter(String[] partitions) {
    logger.warn("************************************************************************");
    logger.warn("* IltProvider.methodToFireBroadcastWithSingleEnumerationParameter called");
    logger.warn("************************************************************************");
    DeferredVoid deferred = new DeferredVoid();
    ExtendedTypeCollectionEnumerationInTypeCollection enumerationOut = ExtendedTypeCollectionEnumerationInTypeCollection.ENUM_2_VALUE_EXTENSION_FOR_TYPECOLLECTION;
    fireBroadcastWithSingleEnumerationParameter(enumerationOut, partitions);
    deferred.resolve();
    return new Promise<DeferredVoid>(deferred);
}
Also used : Promise(io.joynr.provider.Promise) ExtendedTypeCollectionEnumerationInTypeCollection(joynr.interlanguagetest.namedTypeCollection2.ExtendedTypeCollectionEnumerationInTypeCollection) DeferredVoid(io.joynr.provider.DeferredVoid)

Example 4 with ExtendedTypeCollectionEnumerationInTypeCollection

use of joynr.interlanguagetest.namedTypeCollection2.ExtendedTypeCollectionEnumerationInTypeCollection 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 5 with ExtendedTypeCollectionEnumerationInTypeCollection

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

Aggregations

ExtendedTypeCollectionEnumerationInTypeCollection (joynr.interlanguagetest.namedTypeCollection2.ExtendedTypeCollectionEnumerationInTypeCollection)13 ProviderRuntimeException (joynr.exceptions.ProviderRuntimeException)8 Test (org.junit.Test)6 Promise (io.joynr.provider.Promise)4 ApplicationException (joynr.exceptions.ApplicationException)4 Enumeration (joynr.interlanguagetest.Enumeration)4 StructWithStringArray (joynr.interlanguagetest.namedTypeCollection1.StructWithStringArray)4 ExtendedEnumerationWithPartlyDefinedValues (joynr.interlanguagetest.namedTypeCollection2.ExtendedEnumerationWithPartlyDefinedValues)4 SubscriptionException (io.joynr.exceptions.SubscriptionException)2 DeferredVoid (io.joynr.provider.DeferredVoid)2 MethodWithMultipleEnumParametersReturned (joynr.interlanguagetest.TestInterfaceSync.MethodWithMultipleEnumParametersReturned)2 ExtendedExtendedEnumeration (joynr.interlanguagetest.namedTypeCollection2.ExtendedExtendedEnumeration)2 MapStringString (joynr.interlanguagetest.namedTypeCollection2.MapStringString)2 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)1 SuppressWarnings (edu.umd.cs.findbugs.annotations.SuppressWarnings)1 IOException (java.io.IOException)1 PrintWriter (java.io.PrintWriter)1 StringWriter (java.io.StringWriter)1 MulticastSubscriptionQos (joynr.MulticastSubscriptionQos)1 OnChangeWithKeepAliveSubscriptionQos (joynr.OnChangeWithKeepAliveSubscriptionQos)1