Search in sources :

Example 1 with Origin

use of com.b3dgs.lionengine.Origin in project lionengine by b3dgs.

the class OriginConfigTest method testExportsImports.

/**
 * Test exports imports.
 */
@Test
void testExportsImports() {
    final Origin origin = Origin.MIDDLE;
    final Xml root = new Xml("test");
    root.add(OriginConfig.exports(origin));
    final Media media = Medias.create("origin.xml");
    root.save(media);
    assertEquals(origin, OriginConfig.imports(new Xml(media)));
    assertEquals(origin, OriginConfig.imports(new Setup(media)));
    assertEquals(origin, OriginConfig.imports(new Configurer(media)));
    assertTrue(media.getFile().delete());
}
Also used : Origin(com.b3dgs.lionengine.Origin) Xml(com.b3dgs.lionengine.Xml) Media(com.b3dgs.lionengine.Media) Setup(com.b3dgs.lionengine.game.feature.Setup) Test(org.junit.jupiter.api.Test)

Aggregations

Media (com.b3dgs.lionengine.Media)1 Origin (com.b3dgs.lionengine.Origin)1 Xml (com.b3dgs.lionengine.Xml)1 Setup (com.b3dgs.lionengine.game.feature.Setup)1 Test (org.junit.jupiter.api.Test)1