Search in sources :

Example 1 with MapStringString

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

the class IltConsumerGetterSetterTest method callGetAttributeMapStringString.

@Test
public void callGetAttributeMapStringString() {
    LOG.info(name.getMethodName() + "");
    try {
        // must set the value before it can be retrieved again
        MapStringString attributeMapStringStringArg = new MapStringString();
        attributeMapStringStringArg.put("keyString1", "valueString1");
        attributeMapStringStringArg.put("keyString2", "valueString2");
        attributeMapStringStringArg.put("keyString3", "valueString3");
        testInterfaceProxy.setAttributeMapStringString(attributeMapStringStringArg);
        MapStringString result = testInterfaceProxy.getAttributeMapStringString();
        if (result == null) {
            fail(name.getMethodName() + " - FAILED - got no result");
            return;
        }
        MapStringString expected = new MapStringString();
        expected.put("keyString1", "valueString1");
        expected.put("keyString2", "valueString2");
        expected.put("keyString3", "valueString3");
        if (!result.equals(expected)) {
            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 : MapStringString(joynr.interlanguagetest.namedTypeCollection2.MapStringString) ProviderRuntimeException(joynr.exceptions.ProviderRuntimeException) Test(org.junit.Test)

Example 2 with MapStringString

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

the class IltConsumerGetterSetterTest method callSetAttributeMapStringString.

@Test
public void callSetAttributeMapStringString() {
    LOG.info(name.getMethodName() + "");
    try {
        MapStringString attributeMapStringStringArg = new MapStringString();
        attributeMapStringStringArg.put("keyString1", "valueString1");
        attributeMapStringStringArg.put("keyString2", "valueString2");
        attributeMapStringStringArg.put("keyString3", "valueString3");
        testInterfaceProxy.setAttributeMapStringString(attributeMapStringStringArg);
    } catch (Exception e) {
        fail(name.getMethodName() + " - FAILED - caught unexpected exception: " + e.getMessage());
        return;
    }
    LOG.info(name.getMethodName() + " - OK");
}
Also used : MapStringString(joynr.interlanguagetest.namedTypeCollection2.MapStringString) ProviderRuntimeException(joynr.exceptions.ProviderRuntimeException) Test(org.junit.Test)

Example 3 with MapStringString

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

the class IltConsumerSyncMethodTest method callmethodWithSingleMapParameters.

@Test
public void callmethodWithSingleMapParameters() {
    LOG.info(name.getMethodName() + "");
    try {
        MapStringString mapArg = new MapStringString();
        mapArg.put("keyString1", "valueString1");
        mapArg.put("keyString2", "valueString2");
        mapArg.put("keyString3", "valueString3");
        MapStringString result;
        result = testInterfaceProxy.methodWithSingleMapParameters(mapArg);
        if (result == null) {
            fail(name.getMethodName() + " - FAILED - got no result");
            return;
        }
        MapStringString expected = new MapStringString();
        expected.put("valueString1", "keyString1");
        expected.put("valueString2", "keyString2");
        expected.put("valueString3", "keyString3");
        if (!result.equals(expected)) {
            fail(name.getMethodName() + " - FAILED - got invalid result");
            return;
        }
    } catch (Exception e) {
        fail(name.getMethodName() + " - FAILED - caught unexpected exception: " + e.getMessage());
    }
    LOG.info(name.getMethodName() + " - OK");
}
Also used : MapStringString(joynr.interlanguagetest.namedTypeCollection2.MapStringString) ApplicationException(joynr.exceptions.ApplicationException) ProviderRuntimeException(joynr.exceptions.ProviderRuntimeException) Test(org.junit.Test)

Example 4 with MapStringString

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

the class IltProvider method methodWithSingleMapParameters.

@Override
public Promise<MethodWithSingleMapParametersDeferred> methodWithSingleMapParameters(MapStringString mapArg) {
    MethodWithSingleMapParametersDeferred deferred = new MethodWithSingleMapParametersDeferred();
    if (mapArg == null) {
        deferred.resolve(null);
    } else {
        MapStringString mapOut = new MapStringString();
        Iterator<Map.Entry<String, String>> iterator = mapArg.entrySet().iterator();
        while (iterator.hasNext()) {
            Map.Entry<String, String> entry = (Entry<String, String>) iterator.next();
            mapOut.put(entry.getValue(), entry.getKey());
        }
        deferred.resolve(mapOut);
    }
    return new Promise<MethodWithSingleMapParametersDeferred>(deferred);
}
Also used : Promise(io.joynr.provider.Promise) Entry(java.util.Map.Entry) MapStringString(joynr.interlanguagetest.namedTypeCollection2.MapStringString) MapStringString(joynr.interlanguagetest.namedTypeCollection2.MapStringString) Map(java.util.Map)

Example 5 with MapStringString

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

the class IltConsumerGetterSetterTest method callSetAttributeMapStringString.

@Test
public void callSetAttributeMapStringString() {
    LOG.info(name.getMethodName() + "");
    try {
        MapStringString attributeMapStringStringArg = new MapStringString();
        attributeMapStringStringArg.put("keyString1", "valueString1");
        attributeMapStringStringArg.put("keyString2", "valueString2");
        attributeMapStringStringArg.put("keyString3", "valueString3");
        testInterfaceProxy.setAttributeMapStringString(attributeMapStringStringArg);
    } catch (Exception e) {
        fail(name.getMethodName() + " - FAILED - caught unexpected exception: " + e.getMessage());
        return;
    }
    LOG.info(name.getMethodName() + " - OK");
}
Also used : MapStringString(joynr.interlanguagetest.namedTypeCollection2.MapStringString) ProviderRuntimeException(joynr.exceptions.ProviderRuntimeException) Test(org.junit.Test)

Aggregations

MapStringString (joynr.interlanguagetest.namedTypeCollection2.MapStringString)8 ProviderRuntimeException (joynr.exceptions.ProviderRuntimeException)6 Test (org.junit.Test)6 Map (java.util.Map)2 Entry (java.util.Map.Entry)2 ApplicationException (joynr.exceptions.ApplicationException)2 Promise (io.joynr.provider.Promise)1