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");
}
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");
}
use of joynr.interlanguagetest.namedTypeCollection2.MapStringString in project joynr by bmwcarit.
the class IltProviderBean method methodWithSingleMapParameters.
@Override
public MapStringString methodWithSingleMapParameters(MapStringString mapArg) {
if (mapArg == null) {
return null;
}
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());
}
return mapOut;
}
Aggregations