use of com.b3dgs.lionengine.Config in project lionengine by b3dgs.
the class LoaderTest method testScaled.
/**
* Test with screen scaled.
*/
@Test
public void testScaled() {
final Resolution output = new Resolution(640, 480, 0);
final Config config = new Config(output, 16, true);
Loader.start(config, SequenceSingleMock.class).await();
}
use of com.b3dgs.lionengine.Config in project lionengine by b3dgs.
the class LoaderTest method testNoIconWindowed.
/**
* Test with no icon in windowed mode.
*/
@Test
public void testNoIconWindowed() {
final Config config = new Config(OUTPUT, 16, true, Medias.create("void"));
Loader.start(config, SequenceSingleMock.class).await();
}
use of com.b3dgs.lionengine.Config 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.Config in project lionengine by b3dgs.
the class LoaderTest method testDirect.
/**
* Test with screen direct.
*/
@Test
public void testDirect() {
final Resolution output = new Resolution(320, 240, 60);
final Config config = new Config(output, 16, true);
Loader.start(config, SequenceSingleMock.class).await();
}
use of com.b3dgs.lionengine.Config in project lionengine by b3dgs.
the class LoaderTest method testIconWindowed.
/**
* Test with an icon in windowed mode.
*/
@Test
public void testIconWindowed() {
final Config config = new Config(OUTPUT, 16, true, icon);
Loader.start(config, SequenceSingleMock.class).await();
}
Aggregations