List of usage examples for org.apache.commons.configuration MapConfiguration MapConfiguration
public MapConfiguration(Map map)
From source file:com.intel.mtwilson.fs.ConfigurableFeatureFilesystem.java
public ConfigurableFeatureFilesystem() { this(new MapConfiguration(new Properties())); }
From source file:com.intel.mtwilson.fs.ConfigurableFeatureFilesystem.java
public ConfigurableFeatureFilesystem(Properties properties) { this(new MapConfiguration(properties)); }
From source file:com.nesscomputing.config.EmptyConfigOverrideTest.java
@Test public void testEmptyConfigOverride() { // Fails in ness-cache <= 2.1.0 Config.getOverriddenConfig(Config.getEmptyConfig(), new MapConfiguration(Collections.<String, String>emptyMap())); }
From source file:de.hybris.platform.mediaconversion.mock.MockConfigurationService.java
public MockConfigurationService() { final Properties props = new Properties(); final PlatformConfig platformConfig = ConfigUtil.getPlatformConfig(this.getClass()); ConfigUtil.loadRuntimeProperties(props, platformConfig); this.config = new MapConfiguration(props); }
From source file:com.cloudera.nav.plugin.model.PigIdGeneratorTest.java
@Before public void testOperationId() { String jobName = "Brain"; String plan = "The same thing we do every night pinky"; Map<String, Object> map = Maps.newHashMap(); map.put(PigIdGenerator.PIG_LOGICAL_PLAN_HASH_PROP, plan); MapConfiguration jobConf = new MapConfiguration(map); String id = PigIdGenerator.generateNewOperationId(jobName, jobConf); assertEquals(MD5IdGenerator.generateIdentity(jobName, plan), id); }
From source file:net.sf.zekr.engine.theme.Theme.java
/** * Save a ThemeData configuration file./*from www .j a va 2 s . c om*/ * * @param td theme data object to be stored to the disk * @throws IOException */ public static void save(ThemeData td) throws IOException { OutputStreamWriter osw = new OutputStreamWriter( new FileOutputStream(Naming.getThemePropsDir() + "/" + td.fileName)); LinkedHashMap<String, Object> map = new LinkedHashMap<String, Object>(); map.put("name", td.name); map.put("author", td.author); map.put("version", td.version); map.putAll(td.props); ConfigUtils.write(new MapConfiguration(map), osw); // ConfigurationUtils.dump(new MapConfiguration(map), new PrintWriter(osw)); IOUtils.closeQuietly(osw); }
From source file:com.nesscomputing.config.FixedConfigModule.java
public FixedConfigModule(Map<String, String> configOverrides) { final ImmutableMap.Builder<String, String> builder = ImmutableMap.builder(); builder.putAll(configOverrides);// w ww . j a v a 2 s .c o m this.config = Config.getFixedConfig(new SystemConfiguration(), new MapConfiguration(builder.build())); }
From source file:com.cloudera.nav.plugin.model.PigIdGeneratorTest.java
@Before public void testExecId() { Map<String, Object> map = Maps.newHashMap(); String script = "acme.plan.no.2012374587"; map.put(PigIdGenerator.PIG_SCRIPT_ID_PROP, script); MapConfiguration jobConf = new MapConfiguration(map); String id = PigIdGenerator.generateExecutionId(jobConf); assertEquals(MD5IdGenerator.generateIdentity(script), id); }
From source file:com.smbtec.xo.tinkerpop.blueprints.api.TinkerPopXOProvider.java
@Override public Datastore<TinkerPopDatastoreSession<Graph>, VertexMetadata, String, EdgeMetadata, String> createDatastore( final XOUnit xoUnit) { if (xoUnit == null) { throw new IllegalArgumentException("XOUnit must not be null"); }/*w w w . ja va2 s. c o m*/ return new TinkerPopDatastore(new MapConfiguration(xoUnit.getProperties())); }
From source file:com.comcast.viper.flume2storm.sink.StormSinkTest.java
@BeforeClass public static void configure() { // Storm sink configuration stormSinkConfig = new MapConfiguration(new HashMap<String, Object>()); stormSinkConfig.addProperty(StormSinkConfiguration.LOCATION_SERVICE_FACTORY_CLASS, SimpleLocationServiceFactory.class.getName()); stormSinkConfig.addProperty(StormSinkConfiguration.SERVICE_PROVIDER_SERIALIZATION_CLASS, SimpleServiceProviderSerialization.class.getName()); stormSinkConfig.addProperty(StormSinkConfiguration.EVENT_SENDER_FACTORY_CLASS, SimpleEventSenderFactory.class.getName()); stormSinkConfig.addProperty(StormSinkConfiguration.CONNECTION_PARAMETERS_FACTORY_CLASS, SimpleConnectionParametersFactory.class.getName()); }