@Test public void includesCorrectDependentResourcesInResourceDescriptions() throws Exception { Map<Resource, TreeSet<Statement>> result; ExternalSortingInputLoader inputLoader = createExternalSortingInputLoader(testInput3, false); try { result = collectResourceDescriptions(inputLoader); } finally { inputLoader.close(); } assertThat(result.size(), is(conflictClusters3.size())); for (Map.Entry<Resource, TreeSet<Statement>> entry : conflictClusters3.entrySet()) { Statement[] expectedStatements = entry.getValue().toArray(new Statement[0]); Statement[] actualStatements = result.get(entry.getKey()).toArray(new Statement[0]); String errorMessage = "Statements for resource " + entry.getKey() + " do not match"; assertThat(errorMessage, actualStatements.length, is(expectedStatements.length)); for (int i = 0; i < expectedStatements.length; i++) { assertThat(errorMessage, actualStatements[i], contextAwareStatementIsEqual(expectedStatements[i])); } } }
@Override public void close() throws LDFusionToolException { LOG.debug("Deleting input loader temporary files"); if (dataFileIterator != null) { try { dataFileIterator.close(); dataFileIterator = null; } catch (IOException e) { } } if (mergedAttributeFileIterator != null) { try { mergedAttributeFileIterator.close(); mergedAttributeFileIterator = null; } catch (IOException e) { } } for (File temporaryFile : temporaryFiles) { try { if (temporaryFile.exists()) { temporaryFile.delete(); } } catch (Exception e) { LOG.error("Error deleting temporary file " + temporaryFile.getName(), e); } } temporaryFiles.clear(); }
ExternalSortingInputLoader implements InputLoader { @Override public void close() throws LDFusionToolException { LOG.debug("Deleting input loader temporary files"); if (dataFileIterator != null) { try { dataFileIterator.close(); dataFileIterator = null; } catch (IOException e) { } } if (mergedAttributeFileIterator != null) { try { mergedAttributeFileIterator.close(); mergedAttributeFileIterator = null; } catch (IOException e) { } } for (File temporaryFile : temporaryFiles) { try { if (temporaryFile.exists()) { temporaryFile.delete(); } } catch (Exception e) { LOG.error("Error deleting temporary file " + temporaryFile.getName(), e); } } temporaryFiles.clear(); } }
ExternalSortingInputLoader implements InputLoader { @Override public void close() throws LDFusionToolException { LOG.debug("Deleting input loader temporary files"); if (dataFileIterator != null) { try { dataFileIterator.close(); dataFileIterator = null; } catch (IOException e) { } } if (mergedAttributeFileIterator != null) { try { mergedAttributeFileIterator.close(); mergedAttributeFileIterator = null; } catch (IOException e) { } } for (File temporaryFile : temporaryFiles) { try { if (temporaryFile.exists()) { temporaryFile.delete(); } } catch (Exception e) { LOG.error("Error deleting temporary file " + temporaryFile.getName(), e); } } temporaryFiles.clear(); } ExternalSortingInputLoader(
            Collection<AllTriplesLoader> dataSources,
            Set<URI> resourceDescriptionProperties,
            File cacheDirectory,
            ParserConfig parserConfig,
            long maxMemoryLimit); }
ExternalSortingInputLoader implements InputLoader { @Override public void close() throws LDFusionToolException { LOG.debug("Deleting input loader temporary files"); if (dataFileIterator != null) { try { dataFileIterator.close(); dataFileIterator = null; } catch (IOException e) { } } if (mergedAttributeFileIterator != null) { try { mergedAttributeFileIterator.close(); mergedAttributeFileIterator = null; } catch (IOException e) { } } for (File temporaryFile : temporaryFiles) { try { if (temporaryFile.exists()) { temporaryFile.delete(); } } catch (Exception e) { LOG.error("Error deleting temporary file " + temporaryFile.getName(), e); } } temporaryFiles.clear(); } ExternalSortingInputLoader(
            Collection<AllTriplesLoader> dataSources,
            Set<URI> resourceDescriptionProperties,
            File cacheDirectory,
            ParserConfig parserConfig,
            long maxMemoryLimit); @Override void initialize(UriMappingIterable uriMapping); @Override boolean hasNext(); @Override ResourceDescription next(); @Override void updateWithResolvedStatements(Collection<ResolvedStatement> resolvedStatements); @Override void close(); }
ExternalSortingInputLoader implements InputLoader { @Override public void close() throws LDFusionToolException { LOG.debug("Deleting input loader temporary files"); if (dataFileIterator != null) { try { dataFileIterator.close(); dataFileIterator = null; } catch (IOException e) { } } if (mergedAttributeFileIterator != null) { try { mergedAttributeFileIterator.close(); mergedAttributeFileIterator = null; } catch (IOException e) { } } for (File temporaryFile : temporaryFiles) { try { if (temporaryFile.exists()) { temporaryFile.delete(); } } catch (Exception e) { LOG.error("Error deleting temporary file " + temporaryFile.getName(), e); } } temporaryFiles.clear(); } ExternalSortingInputLoader(
            Collection<AllTriplesLoader> dataSources,
            Set<URI> resourceDescriptionProperties,
            File cacheDirectory,
            ParserConfig parserConfig,
            long maxMemoryLimit); @Override void initialize(UriMappingIterable uriMapping); @Override boolean hasNext(); @Override ResourceDescription next(); @Override void updateWithResolvedStatements(Collection<ResolvedStatement> resolvedStatements); @Override void close(); static final boolean USE_GZIP; }