use of com.b3dgs.lionengine.game.ActionRef in project lionengine by b3dgs.
the class ProducerConfigTest method testExportsImports.
/**
* Test exports imports.
*/
@Test
public void testExportsImports() {
final ActionRef ref = new ActionRef("ref", false, new ArrayList<ActionRef>());
final ActionRef ref2 = new ActionRef("ref", false, Arrays.asList(ref));
final Collection<ActionRef> refs = Arrays.asList(new ActionRef("test", true, Arrays.asList(ref2)));
final Xml root = new Xml("test");
root.add(ActionsConfig.exports(refs));
final Media media = Medias.create("producer.xml");
root.save(media);
Assert.assertEquals(refs, ActionsConfig.imports(new Xml(media)));
Assert.assertEquals(refs, ActionsConfig.imports(new Configurer(media)));
Assert.assertTrue(media.getFile().delete());
}
use of com.b3dgs.lionengine.game.ActionRef in project lionengine by b3dgs.
the class ProducerConfigTest method testCancelOnRef.
/**
* Test cancel flag is not used on child reference.
*/
@Test
public void testCancelOnRef() {
final ActionRef ref = new ActionRef("ref", true, new ArrayList<ActionRef>());
final Collection<ActionRef> refs = Arrays.asList(new ActionRef("test", false, Arrays.asList(ref)));
final Xml root = new Xml("test");
root.add(ActionsConfig.exports(refs));
final Media media = Medias.create("producer.xml");
root.save(media);
Assert.assertNotEquals(refs, ActionsConfig.imports(new Xml(media)));
Assert.assertNotEquals(refs, ActionsConfig.imports(new Configurer(media)));
Assert.assertTrue(media.getFile().delete());
}
Aggregations