Package org.terasology.persistence.typeHandling

Examples of org.terasology.persistence.typeHandling.SerializationContext.create()


        PersistedData data = mock(PersistedData.class);
        when(data.getAsString()).thenReturn(TestEnum.NON_NULL.toString());
        when(data.isString()).thenReturn(true);

        SerializationContext serializationContext = mock(SerializationContext.class);
        when(serializationContext.create(TestEnum.NON_NULL.toString())).thenReturn(data);
        EnumTypeHandler<TestEnum> handler = new EnumTypeHandler<>(TestEnum.class);
        PersistedData serializedNonNull = handler.serialize(TestEnum.NON_NULL, serializationContext);
        assertEquals(data, serializedNonNull);

        DeserializationContext deserializationContext = mock(DeserializationContext.class);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.