private PrefabManager prefabManager;
@Before
public void setup() throws Exception {
ModuleManager moduleManager = ModuleManagerFactory.create();
AssetManager assetManager = new AssetManager(moduleManager.getEnvironment());
CoreRegistry.put(ModuleManager.class, moduleManager);
CoreRegistry.put(AssetManager.class, assetManager);
AssetType.registerAssetTypes(assetManager);
URL url = getClass().getClassLoader().getResource("testResources");
url = new URL(url.toString().substring(0, url.toString().length() - "testResources".length() - 1));
assetManager.setAssetFactory(AssetType.PREFAB, new AssetFactory<PrefabData, Prefab>() {
@Override
public Prefab buildAsset(AssetUri uri, PrefabData data) {
return new PojoPrefab(uri, data);
}
});
NetworkSystem networkSystem = mock(NetworkSystem.class);
when(networkSystem.getMode()).thenReturn(NetworkMode.NONE);
EntityManager em = new EntitySystemBuilder().build(moduleManager.getEnvironment(), networkSystem, new ReflectionReflectFactory());
prefabManager = new PojoPrefabManager();
}