List of usage examples for org.apache.commons.configuration Configuration getBoolean
boolean getBoolean(String key);
From source file:keel.Algorithms.Neural_Networks.NNEP_Common.NeuralNetIndividualSpecies.java
/** * <p>/*from w w w . java 2s . c o m*/ * Configuration parameters for this species are: * * * input-layer.number-of-inputs (int) * Number of inputs. Number of inputs of this species neural nets. * * output-layer.number-of-outputs (int) * Number of inputs. Number of outputs of this species neural nets. * * hidden-layer(i).weight-range (complex) * Weigth range of the hidden layer number "i". * * output-layer.weight-range (complex) * Weigth range of the outputlayer. * * hidden-layer(i).maximum-number-of-neurons (int) * Maximum number of neurons of hidden layer number "i". * * hidden-layer(i).initial-number-of-neurons (int) * Initial number of neurons of hidden layer number "i". * * hidden-layer(i)[@type] (string) * Layer type of the hidden layer number "i". * * output-layer[@type] (string) * Layer type of the output layer. * * hidden-layer(i)[@biased] (string) * Boolean indicating if hidden layer number "i" is biased. * * output-layer[@type] (string) * Boolean indicating if the output layer is biased. * * @param configutation Configuration if the Individual * </p> */ @SuppressWarnings("unchecked") public void configure(Configuration configuration) { // -------------------------------------- Setup neuralNetType neuralNetType = configuration.getString("neural-net-type"); // -------------------------------------- Setup nOfHiddenLayers nOfHiddenLayers = configuration.getList("hidden-layer[@type]").size(); // -------------------------------------- Setup nOfInputs //nOfInputs = configuration.getInt("input-layer.number-of-inputs"); // -------------------------------------- Setup nOfOutputs //nOfOutputs = configuration.getInt("output-layer.number-of-outputs"); // Initialize arrays maxNofneurons = new int[nOfHiddenLayers]; minNofneurons = new int[nOfHiddenLayers]; initialMaxNofneurons = new int[nOfHiddenLayers]; type = new String[nOfHiddenLayers + 1]; initiator = new String[nOfHiddenLayers + 1]; biased = new boolean[nOfHiddenLayers + 1]; weightRanges = new Interval[nOfHiddenLayers + 1][]; neuronTypes = new String[nOfHiddenLayers + 1][]; percentages = new double[nOfHiddenLayers + 1][]; initiatorNeuronTypes = new String[nOfHiddenLayers + 1][]; for (int i = 0; i < nOfHiddenLayers + 1; i++) { String header; if (i != nOfHiddenLayers) { header = "hidden-layer(" + i + ")"; // ---------------------------------- Setup maxNofneurons array maxNofneurons[i] = configuration.getInt(header + ".maximum-number-of-neurons"); // ---------------------------------- Setup minNofneurons array minNofneurons[i] = configuration.getInt(header + ".minimum-number-of-neurons"); // ---------------------------------- Setup initialMaxNofneurons array initialMaxNofneurons[i] = configuration.getInt(header + ".initial-maximum-number-of-neurons"); // ---------------------------------- Setup initiator array initiator[i] = configuration.getString(header + ".initiator-of-links"); } else { header = "output-layer"; // ---------------------------------- Setup initiator array initiator[i] = configuration.getString(header + ".initiator-of-links"); } // ----------------------------------------- Setup type array type[i] = configuration.getString(header + "[@type]"); // ----------------------------------------- Setup biased array biased[i] = configuration.getBoolean(header + "[@biased]"); // -------------------------------------- Setup weight ranges array weightRanges[i] = new Interval[1]; try { // Range name String rangeName = header + ".weight-range"; // Range classname String rangeClassname = configuration.getString(rangeName + "[@type]"); // Range class Class<Interval> rangeClass = (Class<Interval>) Class.forName(rangeClassname); // Range instance Interval range = rangeClass.newInstance(); // Configura range range.configure(configuration.subset(rangeName)); // Set range if (i != nOfHiddenLayers) setHiddenLayerWeightRange(i, 0, range); else setOutputLayerWeightRange(0, range); } catch (ClassNotFoundException e) { throw new ConfigurationRuntimeException("Illegal range classname"); } catch (InstantiationException e) { throw new ConfigurationRuntimeException("Problems creating an instance of range", e); } catch (IllegalAccessException e) { throw new ConfigurationRuntimeException("Problems creating an instance of range", e); } } }
From source file:dk.dbc.opensearch.datadock.DatadockMain.java
/** * * //from ww w . j av a 2 s.c o m * @param args * @throws ConfigurationException */ public DatadockMain(String[] args) throws ConfigurationException { /** Try obtaining home path of datadock. If property 'datadock.home' is not set, * current working directory is assumed to be home. */ String datadockHome = System.getProperty("datadock.home"); if (datadockHome == null) { datadockHome = new File(".").getAbsolutePath(); } else { datadockHome = new File(datadockHome).getAbsolutePath(); } log.info(String.format("Using datadock.home: %s", datadockHome)); System.out.println(String.format("Using datadock.home: %s", datadockHome)); Configuration config = null; // Try reading properties file from -Dproperties.file String localPropFileName = System.getProperty("properties.file"); // If -Dpropfile is not set try reading from either ../config/datadock.properties or ./config/datadock.properties if (localPropFileName != null) { config = new PropertiesConfiguration(localPropFileName); } else { localPropFileName = "../config/" + propFileName; if (new File(localPropFileName).exists()) { config = new PropertiesConfiguration(localPropFileName); } localPropFileName = "./config/" + propFileName; if (new File(localPropFileName).exists()) { config = new PropertiesConfiguration(localPropFileName); } } // Throw new ConfigurationException if properties file could not be located. if (config == null) { throw new ConfigurationException( String.format("Could not load configuration from configuration file: %s; CWD: %s", localPropFileName, new File(".").getAbsoluteFile())); } log.info(String.format("Using properties file: %s", localPropFileName)); try { String configFile = config.getString("Log4j"); if (new File(configFile).exists()) { Log4jConfiguration.configure(configFile); } else { if (configFile.startsWith("../")) { configFile = configFile.replaceFirst("../", ""); if (new File(configFile).exists()) { Log4jConfiguration.configure(configFile); } else { throw new ConfigurationException( String.format("Could not locate config file at: %s", config.getString("Log4j"))); } } else { throw new ConfigurationException( String.format("Could not locate config file at: %s", config.getString("Log4j"))); } } log.info(String.format("Using config file: %s", configFile)); } catch (ConfigurationException ex) { String errMsg = String.format("Logger could not be configured, will continue without logging: %s", ex.getMessage()); log.error(errMsg); System.out.println(errMsg); } pollTime = config.getInt("MainPollTime"); queueSize = config.getInt("QueueSize"); corePoolSize = config.getInt("CorePoolSize"); maxPoolSize = config.getInt("MaxPoolSize"); keepAliveTime = config.getInt("KeepAliveTime"); log.debug(String.format("Starting Datadock with pollTime = %s", pollTime)); log.debug(String.format("Starting Datadock with queueSize = %s", queueSize)); log.debug(String.format("Starting Datadock with corePoolSize = %s", corePoolSize)); log.debug(String.format("Starting Datadock with maxPoolSize = %s", maxPoolSize)); log.debug(String.format("Starting Datadock with keepAliveTime = %s", keepAliveTime)); pluginFlowXmlPath = new File(config.getString("PluginFlowXmlPath")); pluginFlowXsdPath = new File(config.getString("PluginFlowXsdPath")); if (null == pluginFlowXmlPath || null == pluginFlowXsdPath) { throw new ConfigurationException( "Failed to initialize configuration values for File objects properly (pluginFlowXmlPath or pluginFlowXsdPath)"); } log.debug(String.format("Starting Datadock with pluginFlowXmlPath = %s", pluginFlowXmlPath)); log.debug(String.format("Starting Datadock with pluginFlowXsdPath = %s", pluginFlowXsdPath)); maxToHarvest = config.getInt("MaxToHarvest"); dataBaseNames = config.getList("OracleDataBaseNames"); oracleCacheName = config.getString("OracleCacheName"); oracleUrl = config.getString("OracleUrl"); oracleUser = config.getString("OracleUserID"); oraclePassWd = config.getString("OraclePassWd"); minLimit = config.getString("OracleMinLimit"); maxLimit = config.getString("OracleMaxLimit"); initialLimit = config.getString("OracleInitialLimit"); connectionWaitTimeout = config.getString("OracleConnectionWaitTimeout"); usePriorityFlag = config.getBoolean("UsePriorityField"); host = config.getString("Host"); port = config.getString("Port"); user = config.getString("User"); pass = config.getString("PassPhrase"); javascriptPath = config.getString("ScriptPath"); fileHarvestLightDir = config.getString("ToHarvest"); fileHarvestLightSuccessDir = config.getString("HarvestDone"); fileHarvestLightFailureDir = config.getString("HarvestFailure"); }
From source file:ninja.utils.NinjaConstantTest.java
/** * This testcase makes sure that all constants defined * in NinjaConstant are working.// ww w.j a v a2s . c o m * * File conf/all_constants.conf simply contains all contstants. * We simply read them in and check if the constants are okay. * * Aim is to prevent stupid spelling mistakes. * */ @Test public void testAllConstants() { Configuration configuration = SwissKnife.loadConfigurationInUtf8("conf/all_constants.conf"); assertEquals("LANGUAGES", configuration.getString(NinjaConstant.applicationLanguages)); assertEquals("PREFIX", configuration.getString(NinjaConstant.applicationCookiePrefix)); assertEquals("NAME", configuration.getString(NinjaConstant.applicationName)); assertEquals("SECRET", configuration.getString(NinjaConstant.applicationSecret)); assertEquals("SERVER_NAME", configuration.getString(NinjaConstant.serverName)); assertEquals(9999, configuration.getInt(NinjaConstant.sessionExpireTimeInSeconds)); assertEquals(false, configuration.getBoolean(NinjaConstant.sessionSendOnlyIfChanged)); assertEquals(false, configuration.getBoolean(NinjaConstant.sessionTransferredOverHttpsOnly)); assertEquals(true, configuration.getBoolean(NinjaConstant.sessionHttpOnly)); }
From source file:nl.tudelft.graphalytics.configuration.ConfigurationUtil.java
public static boolean getBoolean(Configuration config, String property) throws InvalidConfigurationException { ensureConfigurationKeyExists(config, property); try {//from w w w . j a va2s .c o m return config.getBoolean(property); } catch (ConversionException ignore) { throw new InvalidConfigurationException("Invalid value for property \"" + resolve(config, property) + "\": \"" + config.getString(property) + "\", expected a boolean value."); } }
From source file:org.ambraproject.freemarker.AmbraFreemarkerConfig.java
/** * Constructor that loads the list of css and javascript files and page titles for pages which follow the standard * templates. Creates its own composite configuration by iterating over each of the configs in the config to assemble * a union of pages defined./* ww w . ja v a 2 s.c om*/ * * @param configuration Ambra configuration * @throws Exception Exception */ public AmbraFreemarkerConfig(Configuration configuration) throws Exception { if (log.isDebugEnabled()) { log.debug("Creating FreeMarker configuration"); } debug = configuration.getBoolean("struts.devMode"); dirPrefix = configuration.getString("ambra.platform.appContext"); subdirPrefix = configuration.getString("ambra.platform.resourceSubDir"); host = configuration.getString("ambra.platform.host"); casLoginURL = configuration.getString("ambra.services.cas.url.login"); casLogoutURL = configuration.getString("ambra.services.cas.url.logout"); registrationURL = configuration.getString("ambra.services.registration.url.registration"); changePasswordURL = configuration.getString("ambra.services.registration.url.change-password"); changeEmailURL = configuration.getString("ambra.services.registration.url.change-email"); doiResolverURL = configuration.getString("ambra.services.crossref.plos.doiurl"); defaultJournalName = configuration.getString(DEFAULT_JOURNAL_NAME_CONFIG_KEY); journals = new HashMap<String, JournalConfig>(); journalsByIssn = new HashMap<String, JournalConfig>(); orgName = configuration.getString("ambra.platform.name"); feedbackEmail = configuration.getString("ambra.platform.email.feedback"); cache_storage_strong = configuration.getInt("ambra.platform.template_cache.strong", DEFAULT_TEMPLATE_CACHE_STRONG); cache_storage_soft = configuration.getInt("ambra.platform.template_cache.soft", DEFAULT_TEMPLATE_CACHE_SOFT); templateUpdateDelay = configuration.getInt("ambra.platform.template_cache.update_delay", DEFAULT_TEMPLATE_UPDATE_DELAY); String date = configuration.getString("ambra.platform.cisStartDate"); freemarkerProperties = configuration.subset("ambra.platform.freemarker"); nedProfileURL = configuration.getString("ned.profile"); nedRegistrationURL = configuration.getString("ned.registration"); if (date == null) { throw new Exception("Could not find the cisStartDate node in the " + "ambra platform configuration. Make sure the " + "ambra/platform/cisStartDate node exists."); } try { cisStartDate = DateFormat.getDateInstance(DateFormat.SHORT).parse(date); } catch (ParseException ex) { throw new Exception("Could not parse the cisStartDate value of \"" + date + "\" in the ambra platform configuration. Make sure the cisStartDate is in the " + "following format: dd/mm/yyyy", ex); } loadConfig(configuration); processVirtualJournalConfig(configuration); // Now that the "journals" Map exists, index that map by Eissn to populate "journalsByEissn". if (journals.entrySet() != null && journals.entrySet().size() > 0) { for (Entry<String, JournalConfig> e : journals.entrySet()) { JournalConfig j = e.getValue(); journalsByIssn.put(j.getIssn(), j); } } journalUrls = buildUrlMap(journals); journalsUrlsByIssn = buildUrlMap(journalsByIssn); if (log.isTraceEnabled()) { for (Entry<String, JournalConfig> e : journals.entrySet()) { JournalConfig j = e.getValue(); log.trace("Journal: " + e.getKey()); log.trace("Journal url: " + j.getUrl()); log.trace("Default Title: " + j.getDefaultTitle()); log.trace("Default CSS: " + printArray(j.getDefaultCss())); log.trace("Default JavaScript: " + printArray(j.getDefaultCss())); Map<String, String[]> map = j.getCssFiles(); for (Entry<String, String[]> entry : map.entrySet()) { log.trace("PageName: " + entry.getKey()); log.trace("CSS FILES: " + printArray(entry.getValue())); } map = j.getJavaScriptFiles(); for (Entry<String, String[]> entry : map.entrySet()) { log.trace("PageName: " + entry.getKey()); log.trace("JS FILES: " + printArray(entry.getValue())); } for (Entry<String, String> entry : j.getTitles().entrySet()) { log.trace("PageName: " + entry.getKey()); log.trace("Title: " + entry.getValue()); } } log.trace("Dir Prefix: " + dirPrefix); log.trace("SubDir Prefix: " + subdirPrefix); log.trace("Host: " + host); log.trace("Cas url login: " + casLoginURL); log.trace("Case url logout: " + casLogoutURL); log.trace("Registration URL: " + registrationURL); log.trace("Registration Change Pass URL: " + changePasswordURL); log.trace("Registration Change EMail URL: " + changeEmailURL); log.trace("DOI Resolver URL: " + doiResolverURL); log.trace("Default Journal Name: " + defaultJournalName); log.trace("NED Profile URL: " + nedProfileURL); log.trace("NED Registration URL: " + nedRegistrationURL); } if (log.isDebugEnabled()) { log.debug("End FreeMarker Configuration Reading"); } }
From source file:org.ambraproject.struts2.AmbraFreemarkerConfig.java
/** * Constructor that loads the list of css and javascript files and page titles for pages which * follow the standard templates. Creates its own composite configuration by iterating over each * of the configs in the config to assemble a union of pages defined. * @param configuration Ambra configuration * @throws Exception Exception// w w w .ja v a2s. c o m * */ public AmbraFreemarkerConfig(Configuration configuration) throws Exception { if (log.isDebugEnabled()) { log.debug("Creating FreeMarker configuration"); } dojoDebug = configuration.getBoolean("struts.devMode"); dirPrefix = configuration.getString("ambra.platform.appContext"); subdirPrefix = configuration.getString("ambra.platform.resourceSubDir"); host = configuration.getString("ambra.platform.host"); casLoginURL = configuration.getString("ambra.services.cas.url.login"); casLogoutURL = configuration.getString("ambra.services.cas.url.logout"); registrationURL = configuration.getString("ambra.services.registration.url.registration"); changePasswordURL = configuration.getString("ambra.services.registration.url.change-password"); changeEmailURL = configuration.getString("ambra.services.registration.url.change-email"); doiResolverURL = configuration.getString("ambra.services.crossref.plos.doiurl"); pubGetURL = configuration.getString("ambra.services.pubget.url"); defaultJournalName = configuration.getString(DEFAULT_JOURNAL_NAME_CONFIG_KEY); journals = new HashMap<String, JournalConfig>(); journalsByIssn = new HashMap<String, JournalConfig>(); orgName = configuration.getString("ambra.platform.name"); feedbackEmail = configuration.getString("ambra.platform.email.feedback"); cache_storage_strong = configuration.getInt("ambra.platform.template_cache.strong", DEFAULT_TEMPLATE_CACHE_STRONG); cache_storage_soft = configuration.getInt("ambra.platform.template_cache.soft", DEFAULT_TEMPLATE_CACHE_SOFT); templateUpdateDelay = configuration.getInt("ambra.platform.template_cache.update_delay", DEFAULT_TEMPLATE_UPDATE_DELAY); String date = configuration.getString("ambra.platform.cisStartDate"); freemarkerProperties = configuration.subset("ambra.platform.freemarker"); if (date == null) { throw new Exception("Could not find the cisStartDate node in the " + "ambra platform configuration. Make sure the " + "ambra/platform/cisStartDate node exists."); } try { cisStartDate = DateFormat.getDateInstance(DateFormat.SHORT).parse(date); } catch (ParseException ex) { throw new Exception("Could not parse the cisStartDate value of \"" + date + "\" in the ambra platform configuration. Make sure the cisStartDate is in the " + "following format: dd/mm/yyyy", ex); } loadConfig(configuration); processVirtualJournalConfig(configuration); // Now that the "journals" Map exists, index that map by Eissn to populate "journalsByEissn". if (journals.entrySet() != null && journals.entrySet().size() > 0) { for (Entry<String, JournalConfig> e : journals.entrySet()) { JournalConfig j = e.getValue(); journalsByIssn.put(j.getIssn(), j); } } if (log.isTraceEnabled()) { for (Entry<String, JournalConfig> e : journals.entrySet()) { JournalConfig j = e.getValue(); log.trace("Journal: " + e.getKey()); log.trace("Journal url: " + j.getUrl()); log.trace("Default Title: " + j.getDefaultTitle()); log.trace("Default CSS: " + printArray(j.getDefaultCss())); log.trace("Default JavaScript: " + printArray(j.getDefaultCss())); Map<String, String[]> map = j.getCssFiles(); for (Entry<String, String[]> entry : map.entrySet()) { log.trace("PageName: " + entry.getKey()); log.trace("CSS FILES: " + printArray(entry.getValue())); } map = j.getJavaScriptFiles(); for (Entry<String, String[]> entry : map.entrySet()) { log.trace("PageName: " + entry.getKey()); log.trace("JS FILES: " + printArray(entry.getValue())); } for (Entry<String, String> entry : j.getTitles().entrySet()) { log.trace("PageName: " + entry.getKey()); log.trace("Title: " + entry.getValue()); } } log.trace("Dir Prefix: " + dirPrefix); log.trace("SubDir Prefix: " + subdirPrefix); log.trace("Host: " + host); log.trace("Cas url login: " + casLoginURL); log.trace("Case url logout: " + casLogoutURL); log.trace("Registration URL: " + registrationURL); log.trace("Registration Change Pass URL: " + changePasswordURL); log.trace("Registration Change EMail URL: " + changeEmailURL); log.trace("DOI Resolver URL: " + doiResolverURL); log.trace("PubGet URL:" + pubGetURL); log.trace("Default Journal Name: " + defaultJournalName); } if (log.isDebugEnabled()) { log.debug("End FreeMarker Configuration Reading"); } }
From source file:org.apache.atlas.ha.HAConfiguration.java
/** * Return whether HA is enabled or not./* ww w . ja va 2 s.co m*/ * @param configuration underlying configuration instance * @return */ public static boolean isHAEnabled(Configuration configuration) { boolean ret = false; if (configuration.containsKey(HAConfiguration.ATLAS_SERVER_HA_ENABLED_KEY)) { ret = configuration.getBoolean(ATLAS_SERVER_HA_ENABLED_KEY); } else { String[] ids = configuration.getStringArray(HAConfiguration.ATLAS_SERVER_IDS); ret = ids != null && ids.length > 1; } return ret; }
From source file:org.apache.atlas.ha.HAConfiguration.java
/** * Get the web server address that a server instance with the passed ID is bound to. * * This method uses the property {@link SecurityProperties#TLS_ENABLED} to determine whether * the URL is http or https.// w ww. ja v a 2 s .c o m * * @param configuration underlying configuration * @param serverId serverId whose host:port property is picked to build the web server address. * @return */ public static String getBoundAddressForId(Configuration configuration, String serverId) { String hostPort = configuration.getString(ATLAS_SERVER_ADDRESS_PREFIX + serverId); boolean isSecure = configuration.getBoolean(SecurityProperties.TLS_ENABLED); String protocol = (isSecure) ? "https://" : "http://"; return protocol + hostPort; }
From source file:org.apache.james.postage.configuration.ConfigurationLoader.java
public Map<String, PostageConfiguration> create(Configuration configuration) { log.debug("reading configuration."); Map<String, PostageConfiguration> postageConfigurations = new LinkedHashMap<String, PostageConfiguration>(); List<String> scenariosIds = configuration.getList("scenario[@id]"); log.debug("scenarios contained in configuration: " + scenariosIds.size()); Iterator<String> scenarioIter = scenariosIds.iterator(); int scenarioCount = 0; while (scenarioIter.hasNext()) { String scenarioId = scenarioIter.next(); if (postageConfigurations.containsKey(scenarioId)) { log.error("found in configuration more than one scenario which is named: " + scenarioId); continue; }/* w w w. ja v a 2 s .c om*/ PostageConfiguration postageConfiguration = new PostageConfiguration(scenarioId); String scenario = getIndexedPropertyName("scenario", scenarioCount); postageConfiguration.setDurationMinutes( configuration.getInt(getAttributedPropertyName(scenario, "runtimeMinutes"))); addDescription(postageConfiguration, configuration.subset(scenario + ".description")); String scenarioInternalUsers = scenario + ".users.internal"; UserList internals = new UserList( configuration.getInt(getAttributedPropertyName(scenarioInternalUsers, "count")), configuration.getString(getAttributedPropertyName(scenarioInternalUsers, "username-prefix")), configuration.getString(getAttributedPropertyName(scenarioInternalUsers, "domain")), configuration.getString(getAttributedPropertyName(scenarioInternalUsers, "password"))); postageConfiguration.setInternalUsers(internals); postageConfiguration.setInternalReuseExisting( configuration.getBoolean(getAttributedPropertyName(scenarioInternalUsers, "reuseExisting"))); String scenarioExternalUsers = scenario + ".users.external"; UserList externals = new UserList( configuration.getInt(getAttributedPropertyName(scenarioExternalUsers, "count")), configuration.getString(getAttributedPropertyName(scenarioExternalUsers, "username-prefix")), configuration.getString(getAttributedPropertyName(scenarioExternalUsers, "domain"))); postageConfiguration.setExternalUsers(externals); String scenarioTestserver = scenario + ".testserver"; postageConfiguration.setTestserverHost( configuration.getString(getAttributedPropertyName(scenarioTestserver, "host"))); postageConfiguration.setTestserverPortPOP3( configuration.getInt(getAttributedPropertyName(scenarioTestserver + ".pop3", "port"))); postageConfiguration.setTestserverPOP3FetchesPerMinute( configuration.getInt(getAttributedPropertyName(scenarioTestserver + ".pop3", "count-per-min"))); postageConfiguration.setTestserverPortSMTPInbound( configuration.getInt(getAttributedPropertyName(scenarioTestserver + ".smtp-inbound", "port"))); postageConfiguration.setTestserverPortSMTPForwarding(configuration .getInt(getAttributedPropertyName(scenarioTestserver + ".smtp-forwarding", "port"))); postageConfiguration.setTestserverSMTPForwardingWaitSeconds(configuration.getInt( getAttributedPropertyName(scenarioTestserver + ".smtp-forwarding", "latecomer-wait-seconds"))); postageConfiguration.setTestserverRemoteManagerPort( configuration.getInt(getAttributedPropertyName(scenarioTestserver + ".remotemanager", "port"))); postageConfiguration.setTestserverRemoteManagerUsername(configuration .getString(getAttributedPropertyName(scenarioTestserver + ".remotemanager", "name"))); postageConfiguration.setTestserverRemoteManagerPassword(configuration .getString(getAttributedPropertyName(scenarioTestserver + ".remotemanager", "password"))); postageConfiguration.setTestserverSpamAccountUsername(configuration .getString(getAttributedPropertyName(scenarioTestserver + ".spam-account", "name"))); postageConfiguration.setTestserverSpamAccountPassword(configuration .getString(getAttributedPropertyName(scenarioTestserver + ".spam-account", "password"))); postageConfiguration.setTestserverPortJMXRemoting(configuration .getInt(getAttributedPropertyName(scenarioTestserver + ".jvm-resources", "jmx-remoting-port"))); addSendProfiles(postageConfiguration, configuration, scenario); postageConfigurations.put(postageConfiguration.getId(), postageConfiguration); scenarioCount++; } return postageConfigurations; }
From source file:org.apache.marmotta.loader.core.test.CLITest.java
@Test public void testStatisticsWithout() throws ParseException { Configuration cfg = MarmottaLoader.parseOptions(new String[] { "-s", "-f", "file1.ttl" }); Assert.assertNotNull(cfg.getProperty(LoaderOptions.STATISTICS_ENABLED)); Assert.assertNull(cfg.getProperty(LoaderOptions.STATISTICS_GRAPH)); Assert.assertTrue(cfg.getBoolean(LoaderOptions.STATISTICS_ENABLED)); }