use of org.terasology.engine.core.PathManager in project Terasology by MovingBlocks.
the class GameProviderTest method init.
@BeforeAll
public static void init() throws NoSuchFieldException, IllegalAccessException, IOException {
PathManager pathManager = PathManager.getInstance();
Field savesPathField = pathManager.getClass().getDeclaredField("savesPath");
savesPathField.setAccessible(true);
savesPathField.set(pathManager, TMP_SAVES_FOLDER_PATH);
Field recordsPathField = pathManager.getClass().getDeclaredField("recordingsPath");
recordsPathField.setAccessible(true);
recordsPathField.set(pathManager, TMP_RECORDS_FOLDER_PATH);
Files.createDirectories(TMP_SAVES_FOLDER_PATH);
Files.createDirectories(TMP_RECORDS_FOLDER_PATH);
final File file = new File(GameProviderTest.class.getClassLoader().getResource(GAME_MANIFEST_JSON).getFile());
try {
manifestExample = com.google.common.io.Files.asCharSource(file, Charsets.UTF_8).read();
} catch (IOException e) {
fail("Could not load input file");
}
}
Aggregations