Search in sources :

Example 1 with MCRConfigurationLoader

use of org.mycore.common.config.MCRConfigurationLoader in project mycore by MyCoRe-Org.

the class MCRTestCaseHelper method before.

public static void before(Map<String, String> testProperties) {
    String mcrComp = MCRRuntimeComponentDetector.getMyCoReComponents().stream().map(MCRComponent::toString).collect(Collectors.joining(", "));
    String appMod = MCRRuntimeComponentDetector.getApplicationModules().stream().map(MCRComponent::toString).collect(Collectors.joining(", "));
    System.out.printf("MyCoRe components detected: %s\nApplications modules detected: %s\n", mcrComp.isEmpty() ? "'none'" : mcrComp, appMod.isEmpty() ? "'none'" : appMod);
    MCRConfiguration config = MCRConfiguration.instance();
    MCRConfigurationLoader configurationLoader = MCRConfigurationLoaderFactory.getConfigurationLoader();
    HashMap<String, String> baseProperties = new HashMap<>(configurationLoader.load());
    baseProperties.putAll(testProperties);
    config.initialize(baseProperties, true);
}
Also used : MCRConfigurationLoader(org.mycore.common.config.MCRConfigurationLoader) MCRConfiguration(org.mycore.common.config.MCRConfiguration) HashMap(java.util.HashMap)

Aggregations

HashMap (java.util.HashMap)1 MCRConfiguration (org.mycore.common.config.MCRConfiguration)1 MCRConfigurationLoader (org.mycore.common.config.MCRConfigurationLoader)1