use of org.qi4j.api.type.CollectionType in project qi4j-sdk by Qi4j.
the class AbstractCollectionSerializationTest method givenCollectionTypeWithIntegerAndNullElementWhenSerializingAndDeserializingExpectEquals.
@Test
public void givenCollectionTypeWithIntegerAndNullElementWhenSerializingAndDeserializingExpectEquals() throws Exception {
String output = valueSerialization.serialize(integerCollection());
CollectionType collectionType = new CollectionType(List.class, new ValueType(Integer.class));
List<Integer> list = valueSerialization.deserialize(collectionType, output);
assertEquals(integerCollection(), list);
}
use of org.qi4j.api.type.CollectionType in project qi4j-sdk by Qi4j.
the class AbstractCollectionSerializationTest method givenMapOfStringListStringAndNullElementWhenSerializingAndDeserializingExpectEquals.
@Test
public void givenMapOfStringListStringAndNullElementWhenSerializingAndDeserializingExpectEquals() throws Exception {
String output = valueSerialization.serialize(stringMultiMap());
CollectionType collectionType = new CollectionType(List.class, new ValueType(String.class));
MapType mapType = new MapType(Map.class, new ValueType(String.class), collectionType);
Map<String, List<String>> value = valueSerialization.deserialize(mapType, output);
assertEquals(stringMultiMap(), value);
}
use of org.qi4j.api.type.CollectionType in project qi4j-sdk by Qi4j.
the class AbstractCollectionSerializationTest method givenCollectionTypeWithByteAndNullElementWhenSerializingAndDeserializingExpectEquals.
@Test
public void givenCollectionTypeWithByteAndNullElementWhenSerializingAndDeserializingExpectEquals() throws Exception {
String output = valueSerialization.serialize(byteCollection());
CollectionType collectionType = new CollectionType(Set.class, new ValueType(Byte.class));
Set<Byte> list = valueSerialization.deserialize(collectionType, output);
assertEquals(new LinkedHashSet<Byte>(byteCollection()), list);
}
use of org.qi4j.api.type.CollectionType in project qi4j-sdk by Qi4j.
the class AbstractCollectionSerializationTest method givenCollectionTypeWithCharacterAndNullElementWhenSerializingAndDeserializingExpectEquals.
@Test
public void givenCollectionTypeWithCharacterAndNullElementWhenSerializingAndDeserializingExpectEquals() throws Exception {
String output = valueSerialization.serialize(characterCollection());
CollectionType collectionType = new CollectionType(List.class, new ValueType(Character.class));
List<Character> list = valueSerialization.deserialize(collectionType, output);
assertEquals(characterCollection(), list);
}
use of org.qi4j.api.type.CollectionType in project qi4j-sdk by Qi4j.
the class AbstractCollectionSerializationTest method givenCollectionTypeWithShortAndNullElementWhenSerializingAndDeserializingExpectEquals.
@Test
public void givenCollectionTypeWithShortAndNullElementWhenSerializingAndDeserializingExpectEquals() throws Exception {
String output = valueSerialization.serialize(shortCollection());
CollectionType collectionType = new CollectionType(List.class, new ValueType(Short.class));
List<Short> list = valueSerialization.deserialize(collectionType, output);
assertEquals(shortCollection(), list);
}
Aggregations