use of uk.m0nom.qrz.QrzXmlService in project adif-processor by urbancamo.
the class AdifReaderTest method testAdifFLE.
@Test
public void testAdifFLE() throws Exception {
AdiReader reader = new AdiReader();
BufferedReader inputReader = resourceInput("adif/2021-01-09-Queen-Adelaides-Hill.adi");
Optional<Adif3> result = reader.read(inputReader);
// System.out.println(new File("tmp.txt").getAbsolutePath());
YamlMapping config = Yaml.createYamlInput(new File("adif-processor.yaml")).readYamlMapping();
if (result.isPresent()) {
Adif3 log = result.get();
Qsos qsos = new Qsos(log);
assertThat(log.getHeader().getProgramId()).isEqualTo("FLE");
ActivityDatabases summits = new ActivityDatabases();
summits.loadData();
QrzXmlService qrzXmlService = new QrzXmlService(null, null);
if (!qrzXmlService.getSessionKey()) {
System.err.println("Could not connect to QRZ.COM, continuing...");
}
TransformResults results = new TransformResults();
Adif3RecordTransformer transformer = new CommentParsingAdifRecordTransformer(config, summits, qrzXmlService, control, results);
int index = 1;
for (Adif3Record rec : log.getRecords()) {
transformer.transform(qsos, rec, index++);
}
assertThat(log.getRecords()).hasSize(16);
}
}
Aggregations