MCPcopy Create free account
hub / github.com/PCGen/pcgen / createDummySettingsFile

Method createDummySettingsFile

code/src/test/pcgen/util/TestHelper.java:502–518  ·  view source on GitHub ↗

Write a settings/config file for use by unit tests. @param configFileName The name of the new config file. @param configFolder The folder in which other settings files will be saved. @param pccLoc The location of the data folder. @throws IOException If the file cannot be written.

(String configFileName,
											   String configFolder, String pccLoc)

Source from the content-addressed store, hash-verified

500 * @throws IOException If the file cannot be written.
501 */
502 public static void createDummySettingsFile(String configFileName,
503 String configFolder, String pccLoc) throws IOException
504 {
505 File configFile = new File(configFileName);
506 configFile.deleteOnExit();
507 try (BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(
508 configFile), StandardCharsets.UTF_8)))
509 {
510 bw.write("settingsPath=" + configFolder + "\r\n");
511 if (pccLoc != null)
512 {
513 LOG.info("Using PCC Location of '" + pccLoc + "'.");
514 bw.write("pccFilesPath=" + pccLoc + "\r\n");
515 }
516 bw.write("customPath=testsuite\\\\customdata\r\n");
517 }
518 }
519
520 public static void loadGameModes(String testConfigFile)
521 {

Callers 4

runTestMethod · 0.95
loadGameModesMethod · 0.95
loadGameModesMethod · 0.95
loadGameModesMethod · 0.95

Calls 1

writeMethod · 0.65

Tested by

no test coverage detected