-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathBaseAWTTest.java
More file actions
37 lines (30 loc) · 1.28 KB
/
BaseAWTTest.java
File metadata and controls
37 lines (30 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package com.jme3.terrain.collision;
import com.jme3.asset.AssetManager;
import com.jme3.system.JmeSystem;
/**
* This class provides some utility functions to properly test the jMonkeyEngine.<br>
* Thus it contains simple methods to get and create a headless assetManager amongst other things.<br>
* In comparison to {@link BaseTest} it provides a DefaultAssetManager capable of loading image formats using AWT, which
* however makes those tests unsuitable for headless ci testing. This requires jme3-desktop to be a testRuntime dependency.
*
* @author MeFisto94
*/
public abstract class BaseAWTTest {
private AssetManager assetManager;
static {
//JmeSystem.setSystemDelegate(new JmeDesktopSystem());
}
public AssetManager getAssetManager() {
if (assetManager == null) {
assetManager = createAssetManager();
}
return assetManager;
}
private AssetManager createAssetManager() {
/* Desktop.cfg supports the following additional file formats at the time of writing:
LOADER com.jme3.texture.plugins.AWTLoader : jpg, bmp, gif, png, jpeg
LOADER com.jme3.audio.plugins.OGGLoader : ogg
*/
return JmeSystem.newAssetManager(BaseTest.class.getResource("/com/jme3/asset/Desktop.cfg"));
}
}