2 years ago

#72313

test-img

Erch G

libGdx: Can't load assets from JUnit test class

I'm currently facing the following problem: I started a project using libGdx. I've almost finished it and want to run some JUnit tests now. In the test class I'm using an AssetManager to load assets from the src module, but however it doesn't work correctly.

assetManager.setLoader(SceneAsset.class, ".gltf", new GLTFAssetLoader());

assetManager.load("faceted_character/scene.gltf", SceneAsset.class);
assetManager.load("cute_cyborg/scene.gltf", SceneAsset.class);
assetManager.load("spaceship_orion/scene.gltf", SceneAsset.class);

assetManager.finishLoading();`

It throws this error: stacktrace

(line 49 is assetManager.finishLoading();)

This leads me to the question: How can I access these files from the test class?

java

junit

libgdx

asset-management

0 Answers

Your Answer

Accepted video resources