@Test public void parsesMinimalConfigFile() throws Exception { File configFile = getResourceFile("/config/sample-config-minimal.xml"); Config config = ConfigReader.parseConfigXml(configFile); assertThat(config.getCanonicalURIsInputFile(), nullValue()); assertThat(config.getCanonicalURIsOutputFile(), nullValue()); assertThat(config.getDefaultResolutionStrategy(), notNullValue()); assertThat(config.getDefaultResolutionStrategy().getResolutionFunctionName(), nullValue()); assertThat(config.getDefaultResolutionStrategy().getAggregationErrorStrategy(), nullValue()); assertThat(config.getDefaultResolutionStrategy().getCardinality(), nullValue()); assertThat(config.getDefaultResolutionStrategy().getDependsOn(), nullValue()); assertThat(config.getDefaultResolutionStrategy().getParams(), notNullValue()); assertThat(config.getDefaultResolutionStrategy().getParams().size(), equalTo(0)); assertThat(config.getEnableFileCache(), equalTo(false)); assertThat(config.getMaxOutputTriples(), nullValue()); assertThat(config.getMetadataSources(), equalTo(Collections.<ConstructSourceConfig>emptyList())); assertThat(config.getSameAsSources().size(), equalTo(0)); assertThat(config.getPrefixes(), equalTo(Collections.<String, String>emptyMap())); assertThat(config.getRequiredClassOfProcessedResources(), nullValue()); assertThat(config.getPropertyResolutionStrategies(), equalTo(Collections.<URI, ResolutionStrategy>emptyMap())); assertThat(config.isLocalCopyProcessing(), equalTo(true)); assertThat(config.getDataSources().size(), equalTo(1)); DataSourceConfig dataSourceConfig = config.getDataSources().get(0); assertThat(dataSourceConfig.getName(), nullValue()); assertThat(dataSourceConfig.getType(), equalTo(EnumDataSourceType.VIRTUOSO)); assertThat(dataSourceConfig.getParams().get(ConfigParameters.DATA_SOURCE_VIRTUOSO_HOST), equalTo("localhost")); assertThat(dataSourceConfig.getParams().get(ConfigParameters.DATA_SOURCE_VIRTUOSO_PORT), equalTo("1111")); assertThat(dataSourceConfig.getParams().get(ConfigParameters.DATA_SOURCE_VIRTUOSO_USERNAME), equalTo("dba")); assertThat(dataSourceConfig.getParams().get(ConfigParameters.DATA_SOURCE_VIRTUOSO_PASSWORD), equalTo("dba2")); assertThat(dataSourceConfig.getNamedGraphRestriction(), notNullValue()); assertThat(dataSourceConfig.getNamedGraphRestriction().getPattern(), equalTo("")); assertThat(config.getOutputs().size(), equalTo(1)); Output output = config.getOutputs().get(0); assertThat(output.getType(), equalTo(EnumOutputType.FILE)); assertThat(output.getDataContext(), nullValue()); assertThat(output.getMetadataContext(), nullValue()); assertThat(output.getName(), nullValue()); assertThat(output.getParams().get(ConfigParameters.DATA_SOURCE_FILE_PATH), equalTo("out.n3")); assertThat(output.getParams().get(ConfigParameters.DATA_SOURCE_FILE_FORMAT), equalTo("ntriples")); assertThat(config.getMaxDateDifference(), equalTo(LDFTConfigConstants.MAX_DATE_DIFFERENCE)); assertThat(config.getOutputMappedSubjectsOnly(), equalTo(false)); assertThat(config.getPreferredCanonicalURIs(), equalTo(LDFTConfigConstants.DEFAULT_PREFERRED_CANONICAL_URIS)); assertThat(config.getTempDirectory(), equalTo(LDFTConfigConstants.DEFAULT_TEMP_DIRECTORY)); assertThat(config.getResultDataURIPrefix(), notNullValue()); assertThat(config.getPublisherScoreWeight(), equalTo(LDFTConfigConstants.PUBLISHER_SCORE_WEIGHT)); assertThat(config.getAgreeCoefficient(), equalTo(LDFTConfigConstants.AGREE_COEFFICIENT)); assertThat(config.getQueryTimeout(), equalTo(LDFTConfigConstants.DEFAULT_QUERY_TIMEOUT)); assertThat(config.getScoreIfUnknown(), equalTo(LDFTConfigConstants.SCORE_IF_UNKNOWN)); assertThat(config.isProfilingOn(), equalTo(false)); assertThat(config.getMaxFreeMemoryUsage(), equalTo(LDFTConfigConstants.MAX_FREE_MEMORY_USAGE)); assertThat(config.getMemoryLimit(), equalTo(null)); assertThat(config.getParserConfig(), equalTo(LDFTConfigConstants.DEFAULT_FILE_PARSER_CONFIG)); assertThat(config.getSameAsLinkTypes(), is(LDFTConfigConstants.SAME_AS_LINK_TYPES)); }
public static Config parseConfigXml(File configFile) throws InvalidInputException { ConfigReader instance = new ConfigReader(); return instance.parseConfigXmlImpl(configFile); }
ConfigReader { public static Config parseConfigXml(File configFile) throws InvalidInputException { ConfigReader instance = new ConfigReader(); return instance.parseConfigXmlImpl(configFile); } }
ConfigReader { public static Config parseConfigXml(File configFile) throws InvalidInputException { ConfigReader instance = new ConfigReader(); return instance.parseConfigXmlImpl(configFile); } private  ConfigReader(); }
ConfigReader { public static Config parseConfigXml(File configFile) throws InvalidInputException { ConfigReader instance = new ConfigReader(); return instance.parseConfigXmlImpl(configFile); } private  ConfigReader(); static Config parseConfigXml(File configFile); }
ConfigReader { public static Config parseConfigXml(File configFile) throws InvalidInputException { ConfigReader instance = new ConfigReader(); return instance.parseConfigXmlImpl(configFile); } private  ConfigReader(); static Config parseConfigXml(File configFile);  }