use of joynr.types.TestTypes.TEverythingExtendedStruct in project joynr by bmwcarit.
the class SerializationTest method serializeDeserializeMapWithEnumKeyTest.
@Test
public void serializeDeserializeMapWithEnumKeyTest() throws Exception {
TEverythingMap tmap = new TEverythingMap();
Byte tInt8 = 1;
Byte tUInt8 = 2;
Short tInt16 = 3;
Short tUInt16 = 4;
Integer tInt32 = 5;
Integer tUInt32 = 6;
Long tInt64 = 7L;
Long tUInt64 = 8L;
Double tDouble = 9.0;
Float tFloat = 10.0f;
Boolean tBoolean = false;
String tString = "tString";
Byte[] tByteBuffer = { 1, 2, 3 };
Byte[] tUInt8Array = { 4, 5, 6 };
TEnum tEnum = TEnum.TLITERALA;
TEnum[] tEnumArray = { TEnum.TLITERALA, TEnum.TLITERALB };
String[] tStringArray = { "tStringArray1", "tStringArray2" };
Word word = new Word(new Vowel[] { Vowel.A, Vowel.E });
Word[] wordArray = { word, word };
Boolean tBooleanExtended = true;
String tStringExtended = "tStringExtended";
TStringKeyMap tStringMap = new TStringKeyMap();
tStringMap.put("key1", "value1");
tStringMap.put("key2", "value2");
TStruct typeDefForTStruct = new TStruct();
TEverythingExtendedStruct value = new TEverythingExtendedStruct(tInt8, tUInt8, tInt16, tUInt16, tInt32, tUInt32, tInt64, tUInt64, tDouble, tFloat, tString, tBoolean, tByteBuffer, tUInt8Array, tEnum, tEnumArray, tStringArray, word, wordArray, tStringMap, typeDefForTStruct, tBooleanExtended, tStringExtended);
tmap.put(TEnum.TLITERALA, value);
tmap.put(TEnum.TLITERALB, value);
String valueAsString = objectMapper.writeValueAsString(tmap);
TEverythingMap readValue = objectMapper.readValue(valueAsString, TEverythingMap.class);
assertEquals(tmap, readValue);
}
Aggregations