### Question:
VLogDataSourceConfigurationVisitor implements DataSourceConfigurationVisitor { String getDirCanonicalPath(FileDataSource dataSource) throws IOException { return Paths.get(dataSource.getFile().getCanonicalPath()).getParent().toString(); }  String getConfigString(); @Override void visit(CsvFileDataSource dataSource); @Override void visit(RdfFileDataSource dataSource); @Override void visit(SparqlQueryResultDataSource dataSource); @Override void visit(TridentDataSource dataSource); @Override void visit(InMemoryDataSource dataSource);  }### Answer:
@Test public void getDirCanonicalPath_relativePath_succeeds() throws IOException { final VLogDataSourceConfigurationVisitor visitor = new VLogDataSourceConfigurationVisitor(); final FileDataSource fileDataSource = new CsvFileDataSource("file.csv"); final String currentFolder = new File(".").getCanonicalPath(); assertEquals(currentFolder, visitor.getDirCanonicalPath(fileDataSource)); }
@Test public void getDirCanonicalPath_nonNormalisedPath_succeeds() throws IOException { final VLogDataSourceConfigurationVisitor visitor = new VLogDataSourceConfigurationVisitor(); final FileDataSource fileDataSource = new CsvFileDataSource("./././file.csv"); final String currentFolder = new File(".").getCanonicalPath(); assertEquals(currentFolder, visitor.getDirCanonicalPath(fileDataSource)); }