-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #91 from urbancamo/develop
- fix dxcc entity identification (prefer dxcc in the input ADIF file…
- Loading branch information
Showing
9 changed files
with
185 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 88 additions & 0 deletions
88
...uk/m0nom/adifproc/adif3/PreferAdifDxccEntityOverCalculatedDxccEntityFromCallsignTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
package uk.m0nom.adifproc.adif3; | ||
|
||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.ExtendWith; | ||
import org.marsik.ham.adif.Adif3; | ||
import org.marsik.ham.adif.Adif3Record; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.test.context.ContextConfiguration; | ||
import org.springframework.test.context.junit.jupiter.SpringExtension; | ||
import uk.m0nom.adifproc.FileProcessorApplicationConfig; | ||
import uk.m0nom.adifproc.activity.ActivityDatabaseService; | ||
import uk.m0nom.adifproc.adif3.contacts.Qso; | ||
import uk.m0nom.adifproc.adif3.contacts.Station; | ||
import uk.m0nom.adifproc.adif3.io.Adif3FileReader; | ||
import uk.m0nom.adifproc.adif3.io.Adif3FileWriter; | ||
import uk.m0nom.adifproc.adif3.print.Adif3PrintFormatter; | ||
import uk.m0nom.adifproc.dxcc.DxccEntities; | ||
import uk.m0nom.adifproc.dxcc.DxccJsonReader; | ||
import uk.m0nom.adifproc.dxcc.JsonDxccEntities; | ||
import uk.m0nom.adifproc.kml.KmlWriter; | ||
import uk.m0nom.adifproc.qrz.CachingQrzXmlService; | ||
import uk.m0nom.adifproc.adif3.control.TransformControl; | ||
import java.text.ParseException; | ||
|
||
@ExtendWith(SpringExtension.class) | ||
@ContextConfiguration(classes = FileProcessorApplicationConfig.class) | ||
public class PreferAdifDxccEntityOverCalculatedDxccEntityFromCallsignTest { | ||
@Autowired | ||
Adif3Transformer transformer; | ||
|
||
@Autowired | ||
Adif3FileReader reader; | ||
|
||
@Autowired | ||
Adif3FileWriter writer; | ||
|
||
@Autowired | ||
ActivityDatabaseService summits; | ||
|
||
@Autowired | ||
Adif3PrintFormatter formatter; | ||
|
||
@Autowired | ||
KmlWriter kmlWriter; | ||
|
||
@Autowired | ||
CachingQrzXmlService qrzXmlService; | ||
|
||
TransformControl transformControl; | ||
|
||
@Test | ||
public void testCountryOverDxcc() { | ||
try { | ||
transformControl = new TransformControl(); | ||
JsonDxccEntities jsonDxccEntities = new DxccJsonReader().read(); | ||
DxccEntities dxccEntities = new DxccEntities(); | ||
try { | ||
dxccEntities.setup(jsonDxccEntities); | ||
} catch (ParseException p) { | ||
Assertions.fail(p); | ||
} | ||
|
||
transformControl.setDxccEntities(dxccEntities); | ||
Adif3 input = reader.read("./target/test-classes/adif/LU7HF.adi", "windows-1251", false); | ||
assert input != null; | ||
assert input.getRecords().size() == 1; | ||
Adif3Record record = input.getRecords().get(0); | ||
assert record.getCall().equals("LU7HF"); | ||
assert record.getCountry().equals("Argentina"); | ||
assert record.getDxcc().equals(100); | ||
|
||
Qso qso = new Qso(record, 0); | ||
Station from = new Station(record.getStationCallsign(), qso); | ||
Station to = new Station(record.getStationCallsign(), qso); | ||
to.setDxccEntity(dxccEntities.getDxccEntity(100)); | ||
|
||
qso.setTo(to); | ||
qso.setFrom(from); | ||
|
||
dxccEntities.setToDxccEntity(qso, transformControl); | ||
assert(qso.getTo().getDxccEntity().getEntityCode() == 100); | ||
|
||
} catch (Exception e) { | ||
Assertions.fail("testApp() threw exception while setting up the test. ", e); | ||
} | ||
} | ||
} |
4 changes: 0 additions & 4 deletions
4
...est/java/uk/m0nom/adifproc/adif3/transform/comment/FieldParserCommentTransformerTest.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
### QLog ADIF Export | ||
<ADIF_VER:5>3.1.4 | ||
<PROGRAMID:4>QLog | ||
<PROGRAMVERSION:6>0.34.0 | ||
<CREATED_TIMESTAMP:15>20240515 003039 | ||
<EOH> | ||
|
||
<call:5>LU7HF | ||
<rst_sent:3>599 | ||
<rst_rcvd:3>599 | ||
<freq:6:N>24.895 | ||
<band:3>12m | ||
<mode:2>CW | ||
<name:15>MARCELO GABRIEL | ||
<qth:23>SAN FRANCISCO - CORDOBA | ||
<gridsquare:6>FF88XS | ||
<dxcc:3>100 | ||
<country:9>Argentina | ||
<cont:2>SA | ||
<cqz:2>13 | ||
<ituz:2>14 | ||
<pfx:3>LU7 | ||
<state:2>Se | ||
<qsl_rcvd:1>N | ||
<qsl_sent:1>Q | ||
<lotw_qsl_rcvd:1>N | ||
<lotw_qsl_sent:1>Y | ||
<lotw_qslsdate:8>20240510 | ||
<tx_pwr:3>100 | ||
<a_index:1>7 | ||
<band_rx:3>12m | ||
<distance:17>7002.559901983147 | ||
<eqsl_qslsdate:8>20240511 | ||
<eqsl_qsl_rcvd:1>N | ||
<eqsl_qsl_sent:1>Y | ||
<freq_rx:6>24.895 | ||
<k_index:1>2 | ||
<my_antenna:7>doublet | ||
<my_city:11>Bushnell FL | ||
<my_country:13>United States | ||
<my_cq_zone:1>5 | ||
<my_dxcc:3>291 | ||
<my_gridsquare:4>EL88 | ||
<my_itu_zone:1>8 | ||
<my_name:4>Dave | ||
<my_rig:5>FT710 | ||
<sfi:3>233 | ||
<station_callsign:4>KZ1O | ||
<qso_date:8:D>20240509 | ||
<time_on:6:T>213531 | ||
<qso_date_off:8:D>20240509 | ||
<time_off:6:T>213639 | ||
<eor> |