use of com.b3dgs.lionengine.graphic.FactoryGraphicMock in project lionengine by b3dgs.
the class DrawableTest method setUp.
/**
* Setup test.
*/
@BeforeClass
public static void setUp() {
Medias.setLoadFromJar(DrawableTest.class);
Graphics.setFactoryGraphic(new FactoryGraphicMock());
media = Medias.create("image.png");
font = Medias.create("fontdata.xml");
}
use of com.b3dgs.lionengine.graphic.FactoryGraphicMock in project lionengine by b3dgs.
the class SpriteFontTest method setUp.
/**
* Prepare test.
*/
@BeforeClass
public static void setUp() {
Graphics.setFactoryGraphic(new FactoryGraphicMock());
Medias.setLoadFromJar(SpriteFontTest.class);
media = Medias.create("image.png");
font = Medias.create("fontdata.xml");
}
use of com.b3dgs.lionengine.graphic.FactoryGraphicMock in project lionengine by b3dgs.
the class SpriteTest method setUp.
/**
* Prepare test.
*/
@BeforeClass
public static void setUp() {
Graphics.setFactoryGraphic(new FactoryGraphicMock());
Medias.setLoadFromJar(SpriteTest.class);
media = Medias.create("image.png");
}
use of com.b3dgs.lionengine.graphic.FactoryGraphicMock in project lionengine by b3dgs.
the class SpriteDigitTest method beforeTests.
/**
* Prepare tests.
*/
@BeforeAll
public static void beforeTests() {
Graphics.setFactoryGraphic(new FactoryGraphicMock());
Medias.setLoadFromJar(SpriteDigitTest.class);
}
use of com.b3dgs.lionengine.graphic.FactoryGraphicMock in project lionengine by b3dgs.
the class LoaderTest method testInterruptedUnchecked.
/**
* Test interrupted unchecked exception.
*/
@Test
void testInterruptedUnchecked() {
Graphics.setFactoryGraphic(new FactoryGraphicMock() {
@Override
public Screen createScreen(Config config) {
return null;
}
});
final AtomicReference<Throwable> exception = new AtomicReference<>();
final Semaphore semaphore = new Semaphore(0);
final Thread thread = new Thread() {
@Override
public void run() {
final TaskFuture future = Loader.start(CONFIG, SequenceInterruptMock.class);
future.await();
}
};
thread.setUncaughtExceptionHandler((t, throwable) -> {
exception.set(throwable);
semaphore.release();
});
Verbose.info("*********************************** EXPECTED VERBOSE ***********************************");
thread.start();
assertTimeout(SequenceInterruptMock.PAUSE_MILLI * 2L, semaphore::acquire);
assertTrue(exception.get().getCause() instanceof NullPointerException);
Verbose.info("****************************************************************************************");
Graphics.setFactoryGraphic(new FactoryGraphicMock());
}
Aggregations