use of org.terasology.persistence.typeHandling.inMemory.InMemoryPersistedDataSerializer in project Terasology by MovingBlocks.
the class SimpleCoreHandlerTest method serialization.
@ParameterizedTest(name = "{1}")
@DisplayName("Check simple core types serialization")
@MethodSource("primitives")
<T> void serialization(T obj, TypeHandler<T> typeHandler, PersistedData expectedData) throws Exception {
PersistedData data = typeHandler.serialize(obj, new InMemoryPersistedDataSerializer());
Assertions.assertEquals(expectedData.getClass(), data.getClass());
Assertions.assertEquals(getData(expectedData), getData(data));
}
use of org.terasology.persistence.typeHandling.inMemory.InMemoryPersistedDataSerializer in project Terasology by MovingBlocks.
the class CharacterTypeHandlerTest method testSerialize.
@Test
void testSerialize() {
PersistedDataSerializer serializer = new InMemoryPersistedDataSerializer();
char linefeedChar = '\n';
PersistedData data = typeHandler.serializeNonNull(linefeedChar, serializer);
Assertions.assertEquals("\n", data.getAsString());
}
Aggregations