use of com.google.refine.importers.SeparatorBasedImporter in project OpenRefine by OpenRefine.
the class WikidataRefineTest method createCSVProject.
protected Project createCSVProject(String projectName, String input) {
Project project = new Project();
ProjectMetadata metadata = new ProjectMetadata();
metadata.setName(projectName);
ObjectNode options = mock(ObjectNode.class);
RefineTest.prepareImportOptions(options, ",", -1, 0, 0, 1, false, false);
ImportingJob job = ImportingManager.createJob();
SeparatorBasedImporter importer = new SeparatorBasedImporter();
List<Exception> exceptions = new ArrayList<Exception>();
importer.parseOneFile(project, metadata, job, "filesource", new StringReader(input), -1, options, exceptions);
project.update();
ProjectManager.singleton.registerProject(project, metadata);
projects.add(project);
importingJobs.add(job);
return project;
}
Aggregations