List of usage examples for org.apache.commons.configuration2 BaseHierarchicalConfiguration BaseHierarchicalConfiguration
public BaseHierarchicalConfiguration()
From source file:com.gs.obevo.impl.reader.PackageMetadataReader.java
private ImmutableHierarchicalConfiguration getConfig(String configContent) { if (configContent == null) { return new BaseHierarchicalConfiguration(); }//from w ww .j a va 2s . c om Properties props = new Properties(); try { props.load(new StringReader(configContent)); return ConfigurationUtils.convertToHierarchical(ConfigurationConverter.getConfiguration(props)); } catch (IOException e) { throw new RuntimeException(e); } }
From source file:org.aksw.mlbenchmark.BenchmarkRunnerTest.java
@BeforeClass public static void setUpClass() throws ConfigLoaderException { // set up mock class configMock = mock(BenchmarkConfig.class); when(configMock.getLearningSystems()).thenReturn(learningSystem); when(configMock.getSeed()).thenReturn(seed); when(configMock.getCrossValidationFolds()).thenReturn(crossValidationFolds); when(configMock.isLeaveOneOut()).thenReturn(leaveOneOut); when(configMock.getThreadsCount()).thenReturn(threadsCount); when(configMock.getMexOutputFile()).thenReturn(mexOutputFile); when(configMock.getScenarios()).thenReturn(scenarios); when(configMock.getLearningSystemConfiguration(any(LearningSystemInfo.class))) .thenReturn(new BaseConfiguration()); when(configMock.getLearningTaskConfiguration(anyString())).thenReturn(new BaseConfiguration()); when(configMock.getLearningProblemConfiguration(any(Scenario.class))).thenReturn(new BaseConfiguration()); when(configMock.getConfig()).thenReturn(new BaseHierarchicalConfiguration()); // create instance instance = new BenchmarkRunner(configMock); }