use of com.b3dgs.lionengine.graphic.FactoryGraphicMock in project lionengine by b3dgs.
the class FilterBilinearTest method setUp.
/**
* Prepare test.
*/
@BeforeClass
public static void setUp() {
Medias.setLoadFromJar(FilterBilinearTest.class);
Graphics.setFactoryGraphic(new FactoryGraphicMock());
media = Medias.create("image.png");
}
use of com.b3dgs.lionengine.graphic.FactoryGraphicMock in project lionengine by b3dgs.
the class FilterHq3xTest method setUp.
/**
* Prepare test.
*/
@BeforeClass
public static void setUp() {
Medias.setLoadFromJar(FilterHq3xTest.class);
Graphics.setFactoryGraphic(new FactoryGraphicMock());
media = Medias.create("image.png");
}
use of com.b3dgs.lionengine.graphic.FactoryGraphicMock in project lionengine by b3dgs.
the class LoaderTest method prepareTest.
/**
* Prepare the test.
*/
@BeforeClass
public static void prepareTest() {
Medias.setLoadFromJar(LoaderTest.class);
Graphics.setFactoryGraphic(new FactoryGraphicMock());
icon = Medias.create("image.png");
}
use of com.b3dgs.lionengine.graphic.FactoryGraphicMock in project lionengine by b3dgs.
the class LoaderTest method testInterruptedUnchecked.
/**
* Test interrupted unchecked exception.
*
* @throws InterruptedException If error.
*/
@Test(timeout = SequenceInterruptMock.PAUSE_MILLI * 2L)
public void testInterruptedUnchecked() throws InterruptedException {
try {
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();
semaphore.acquire();
Assert.assertTrue(exception.get().getCause() instanceof NullPointerException);
} finally {
Verbose.info("****************************************************************************************");
Graphics.setFactoryGraphic(new FactoryGraphicMock());
}
}
use of com.b3dgs.lionengine.graphic.FactoryGraphicMock in project lionengine by b3dgs.
the class RasterImageTest method setUp.
/**
* Prepare test.
*
* @throws IOException If error.
*/
@BeforeClass
public static void setUp() throws IOException {
Medias.setLoadFromJar(RasterImageTest.class);
Graphics.setFactoryGraphic(new FactoryGraphicMock());
mediaRaster = Medias.create("raster.xml");
}
Aggregations