/** * Initializes a headless GDX platform for testing. */ public static synchronized void init() { if (Gdx.gl instanceof MockGL) { // Already initialized return; } HeadlessNativesLoader.load(); Gdx.app = new GdxAppStub(); Gdx.files = new HeadlessFiles(); Gdx.net = new HeadlessNet(); Gdx.graphics = new MockGraphics(); Gdx.gl20 = MockGL.newInstance(); Gdx.gl = Gdx.gl20; Gdx.audio = new MockAudio(); Gdx.input = new MockInput(); }
public TestConfiguration() { GameConfig.config.setPathToResourcesAsString("src/main/resources/"); Gdx.files = new HeadlessFiles(); Gdx.gl = new HeadlessGl(); }
public TestCoreConfiguration() { GameConfig.config.setPathToResourcesAsString("src/test/resources/"); Gdx.files = new HeadlessFiles(); Gdx.gl = new HeadlessGl(); }
@Before public void setUp() { Gdx.files = new HeadlessFiles(); }