use of org.terasology.entitySystem.stubs.MappedTypeComponent in project Terasology by MovingBlocks.
the class EntitySerializerTest method testMappedTypeHandling.
@Test
public void testMappedTypeHandling() throws Exception {
componentLibrary.register(new SimpleUri("test", "mappedtype"), MappedTypeComponent.class);
EntityRef entity = entityManager.create();
entity.addComponent(new MappedTypeComponent());
EntityData.Entity entityData = entitySerializer.serialize(entity);
long nextId = entityManager.getNextId();
entityManager.clear();
entityManager.setNextId(nextId);
EntityRef loadedEntity = entitySerializer.deserialize(entityData);
assertTrue(loadedEntity.exists());
assertTrue(loadedEntity.hasComponent(MappedTypeComponent.class));
}
Aggregations