use of org.eol.globi.domain.LogContext in project eol-globi-data by jhpoelen.
the class StudyImporterForGoMexSI2IT method importWithCommit.
protected StudyImporterForGoMexSI2 importWithCommit(String baseUrlLastCommit) throws StudyImporterException, IOException {
StudyImporterForGoMexSI2 importer = new StudyImporterForGoMexSI2(new ParserFactoryLocal(), nodeFactory);
final List<String> msgs = new ArrayList<String>();
importer.setLogger(new ImportLogger() {
@Override
public void warn(LogContext study, String message) {
LOG.warn(message);
msgs.add("warn: " + message);
}
@Override
public void info(LogContext study, String message) {
LOG.info(message);
msgs.add("info: " + message);
}
@Override
public void severe(LogContext study, String message) {
LOG.error(message);
msgs.add("severe: " + message);
}
});
JsonNode config = new ObjectMapper().readTree("{ \n" + " \"citation\": \"testing source citation\",\n" + " \"format\": \"gomexsi\"\n" + "}");
DatasetImpl dataset = new DatasetImpl("some/namespace", URI.create(baseUrlLastCommit));
importer.setDataset(dataset);
dataset.setConfig(config);
importStudy(importer);
return importer;
}
Aggregations