Search in sources :

Example 1 with PropertyContextFactory

use of pcgen.system.PropertyContextFactory in project pcgen by PCGen.

the class DataTest method loadGameModes.

private static void loadGameModes() {
    String configFolder = "testsuite";
    String pccLoc = TestHelper.findDataFolder();
    System.out.println("Got data folder of " + pccLoc);
    try {
        TestHelper.createDummySettingsFile(TEST_CONFIG_FILE, configFolder, pccLoc);
    } catch (IOException e) {
        Logging.errorPrint("DataTest.loadGameModes failed", e);
    }
    PropertyContextFactory configFactory = new PropertyContextFactory(SystemUtils.USER_DIR);
    configFactory.registerAndLoadPropertyContext(ConfigurationSettings.getInstance(TEST_CONFIG_FILE));
    Main.loadProperties(false);
    PCGenTask loadPluginTask = Main.createLoadPluginTask();
    loadPluginTask.execute();
    GameModeFileLoader gameModeFileLoader = new GameModeFileLoader();
    gameModeFileLoader.execute();
    CampaignFileLoader campaignFileLoader = new CampaignFileLoader();
    campaignFileLoader.execute();
}
Also used : CampaignFileLoader(pcgen.persistence.CampaignFileLoader) PCGenTask(pcgen.system.PCGenTask) PropertyContextFactory(pcgen.system.PropertyContextFactory) IOException(java.io.IOException) GameModeFileLoader(pcgen.persistence.GameModeFileLoader)

Example 2 with PropertyContextFactory

use of pcgen.system.PropertyContextFactory in project pcgen by PCGen.

the class TestHelper method loadGameModes.

public static void loadGameModes(String testConfigFile) {
    String configFolder = "testsuite";
    String pccLoc = TestHelper.findDataFolder();
    System.out.println("Got data folder of " + pccLoc);
    try {
        TestHelper.createDummySettingsFile(testConfigFile, configFolder, pccLoc);
    } catch (IOException e) {
        Logging.errorPrint("DataTest.loadGameModes failed", e);
    }
    PropertyContextFactory configFactory = new PropertyContextFactory(SystemUtils.USER_DIR);
    configFactory.registerAndLoadPropertyContext(ConfigurationSettings.getInstance(testConfigFile));
    Main.loadProperties(false);
    PCGenTask loadPluginTask = Main.createLoadPluginTask();
    loadPluginTask.execute();
    GameModeFileLoader gameModeFileLoader = new GameModeFileLoader();
    gameModeFileLoader.execute();
    CampaignFileLoader campaignFileLoader = new CampaignFileLoader();
    campaignFileLoader.execute();
}
Also used : CampaignFileLoader(pcgen.persistence.CampaignFileLoader) PCGenTask(pcgen.system.PCGenTask) PropertyContextFactory(pcgen.system.PropertyContextFactory) IOException(java.io.IOException) GameModeFileLoader(pcgen.persistence.GameModeFileLoader)

Example 3 with PropertyContextFactory

use of pcgen.system.PropertyContextFactory in project pcgen by PCGen.

the class DataLoadTest method loadGameModes.

private static void loadGameModes() {
    String configFolder = "testsuite";
    String pccLoc = TestHelper.findDataFolder();
    System.out.println("Got data folder of " + pccLoc);
    try {
        TestHelper.createDummySettingsFile(TEST_CONFIG_FILE, configFolder, pccLoc);
    } catch (IOException e) {
        Logging.errorPrint("DataTest.loadGameModes failed", e);
    }
    PropertyContextFactory configFactory = new PropertyContextFactory(SystemUtils.USER_DIR);
    configFactory.registerAndLoadPropertyContext(ConfigurationSettings.getInstance(TEST_CONFIG_FILE));
    Main.loadProperties(false);
    PCGenTask loadPluginTask = Main.createLoadPluginTask();
    loadPluginTask.execute();
    GameModeFileLoader gameModeFileLoader = new GameModeFileLoader();
    gameModeFileLoader.execute();
    CampaignFileLoader campaignFileLoader = new CampaignFileLoader();
    campaignFileLoader.execute();
}
Also used : CampaignFileLoader(pcgen.persistence.CampaignFileLoader) PCGenTask(pcgen.system.PCGenTask) PropertyContextFactory(pcgen.system.PropertyContextFactory) IOException(java.io.IOException) GameModeFileLoader(pcgen.persistence.GameModeFileLoader)

Example 4 with PropertyContextFactory

use of pcgen.system.PropertyContextFactory in project pcgen by PCGen.

the class PCGenDataConvert method main.

public static void main(String[] args) {
    //$NON-NLS-1$
    Logging.log(Level.INFO, "Starting PCGen Data Converter v" + PCGenPropBundle.getVersionNumber());
    configFactory = new PropertyContextFactory(SystemUtils.USER_DIR);
    configFactory.registerAndLoadPropertyContext(ConfigurationSettings.getInstance());
    Main.loadProperties(true);
    getConverter().setVisible(true);
}
Also used : PropertyContextFactory(pcgen.system.PropertyContextFactory)

Aggregations

PropertyContextFactory (pcgen.system.PropertyContextFactory)4 IOException (java.io.IOException)3 CampaignFileLoader (pcgen.persistence.CampaignFileLoader)3 GameModeFileLoader (pcgen.persistence.GameModeFileLoader)3 PCGenTask (pcgen.system.PCGenTask)3