Commit 5c951c54 authored by Volker Krause's avatar Volker Krause
Browse files

Extend BCBP unit tests to cover the new IATA BCBP types

This also found a few typos in our test data that the old code
had not noticed so far.
parent 101ace26
IATA Barcoded Boarding Pass
formatCode: M
numberOfLegs: 1
passengerName: DOE/JOHN
electronicTicketIndicator: E
version: 0
fieldSize: 0
passengerDescription:
sourceOfCheckin:
sourceOfBoardingPassIssuance:
yearOfIssue: 0
dayOfIssue: 0
documentType:
airlineDesignatorOfBoardingPassIssuer:
baggageTagLicensePlateNumber1:
baggageTagLicensePlateNumber2:
baggageTagLicensePlateNumber3:
Date of issue:
Leg 1
operatingCarrierPNRCode: ABCDEFG
fromCityAirportCode: MRS
toCityAirportCode: LGW
operatingCarrierDesignator: EZY
flightNumber: 8724
dayOfFlight: 99
compartmentCode:
seatNumber: 3C
checkinSequenceNumber: 506
passengerStatus: 1
variableFieldSize: 10
conditionalFieldSize: 0
airlineNumericCode:
documentNumber:
selecteeIndicator:
internationalDocumentVerification:
marketingCarrierDesignator:
frequentFlyerAirlineDesignator:
frequenFlyerNumber:
idAdIndicator:
freeBaggageAllowance:
fastTrack:
Airline use section: xxxxxxxxxx
Date of flight: 2018-04-09
IATA Barcoded Boarding Pass
formatCode: M
numberOfLegs: 1
passengerName: DESMARAIS/LUC
electronicTicketIndicator: E
version: 0
fieldSize: 0
passengerDescription:
sourceOfCheckin:
sourceOfBoardingPassIssuance:
yearOfIssue: 0
dayOfIssue: 0
documentType:
airlineDesignatorOfBoardingPassIssuer:
baggageTagLicensePlateNumber1:
baggageTagLicensePlateNumber2:
baggageTagLicensePlateNumber3:
Date of issue:
Leg 1
operatingCarrierPNRCode: ABC123
fromCityAirportCode: YUL
toCityAirportCode: FRA
operatingCarrierDesignator: AC
flightNumber: 0834
dayOfFlight: 326
compartmentCode: J
seatNumber: 001A
checkinSequenceNumber: 0025
passengerStatus: 1
variableFieldSize: 0
conditionalFieldSize: 0
airlineNumericCode:
documentNumber:
selecteeIndicator:
internationalDocumentVerification:
marketingCarrierDesignator:
frequentFlyerAirlineDesignator:
frequenFlyerNumber:
idAdIndicator:
freeBaggageAllowance:
fastTrack:
Airline use section:
Date of flight: 2018-11-22
IATA Barcoded Boarding Pass
formatCode: M
numberOfLegs: 1
passengerName: DESMARAIS/LUC
electronicTicketIndicator: E
version: 5
fieldSize: 50
passengerDescription: 1
sourceOfCheckin: W
sourceOfBoardingPassIssuance: W
yearOfIssue: 1
dayOfIssue: 325
documentType: B
airlineDesignatorOfBoardingPassIssuer: AC
baggageTagLicensePlateNumber1: 0014123456002
baggageTagLicensePlateNumber2: 0014123467001
baggageTagLicensePlateNumber3: 0014123478901
Date of issue: 2011-11-21
Leg 1
operatingCarrierPNRCode: AB12C3
fromCityAirportCode: YUL
toCityAirportCode: FRA
operatingCarrierDesignator: AC
flightNumber: 0834
dayOfFlight: 326
compartmentCode: J
seatNumber: 003A
checkinSequenceNumber: 0027
passengerStatus: 1
variableFieldSize: 103
conditionalFieldSize: 42
airlineNumericCode: 014
documentNumber: 1234567890
selecteeIndicator:
internationalDocumentVerification: 1
marketingCarrierDesignator: AC
frequentFlyerAirlineDesignator: AC
frequenFlyerNumber: 1234567890123
idAdIndicator:
freeBaggageAllowance: 4PC
fastTrack: Y
Airline use section: LX58Z
Date of flight: 2011-11-22
Security:
type: 1
size: 8
securityData: ABCDEFGH
......@@ -25,7 +25,7 @@
"reservationStatus": "http://schema.org/ReservationConfirmed",
"reservedTicket": {
"@type": "Ticket",
"ticketToken": "aztecCode:M1GRANDMAIRE/MELANIE EABC123 GVACDGAF 0123 339C002F0025 130>5002A0571234567890 AF AF 1234567890123456 Y^18ABCDEFGH"
"ticketToken": "aztecCode:M1GRANDMAIRE/MELANIE EABC123 GVACDGAF 0123 339C002F0025 130>5002A0571234567890 AF AF 1234567890123456 Y^108ABCDEFGH"
},
"underName": {
"@type": "Person",
......
IATA Barcoded Boarding Pass
formatCode: M
numberOfLegs: 1
passengerName: GRANDMAIRE/MELANIE
electronicTicketIndicator: E
version: 5
fieldSize: 0
passengerDescription:
sourceOfCheckin:
sourceOfBoardingPassIssuance:
yearOfIssue: 0
dayOfIssue: 0
documentType:
airlineDesignatorOfBoardingPassIssuer:
baggageTagLicensePlateNumber1:
baggageTagLicensePlateNumber2:
baggageTagLicensePlateNumber3:
Date of issue:
Leg 1
operatingCarrierPNRCode: ABC123
fromCityAirportCode: GVA
toCityAirportCode: CDG
operatingCarrierDesignator: AF
flightNumber: 0123
dayOfFlight: 339
compartmentCode: C
seatNumber: 002F
checkinSequenceNumber: 0025
passengerStatus: 1
variableFieldSize: 48
conditionalFieldSize: 42
airlineNumericCode: 057
documentNumber: 1234567890
selecteeIndicator:
internationalDocumentVerification:
marketingCarrierDesignator: AF
frequentFlyerAirlineDesignator: AF
frequenFlyerNumber: 1234567890123456
idAdIndicator:
freeBaggageAllowance:
fastTrack: Y
Airline use section:
Date of flight: 2018-12-05
Security:
type: 1
size: 8
securityData: ABCDEFGH
IATA Barcoded Boarding Pass
formatCode: M
numberOfLegs: 2
passengerName: DESMARAIS/LUC
electronicTicketIndicator: E
version: 5
fieldSize: 50
passengerDescription: 1
sourceOfCheckin: W
sourceOfBoardingPassIssuance: W
yearOfIssue: 1
dayOfIssue: 325
documentType: B
airlineDesignatorOfBoardingPassIssuer: AC
baggageTagLicensePlateNumber1: 0014123456002
baggageTagLicensePlateNumber2: 0014123467001
baggageTagLicensePlateNumber3: 0014123478901
Date of issue: 2011-11-21
Leg 1
operatingCarrierPNRCode: AB12C3
fromCityAirportCode: YUL
toCityAirportCode: FRA
operatingCarrierDesignator: AC
flightNumber: 0834
dayOfFlight: 326
compartmentCode: J
seatNumber: 003A
checkinSequenceNumber: 0027
passengerStatus: 1
variableFieldSize: 103
conditionalFieldSize: 42
airlineNumericCode: 014
documentNumber: 1234567890
selecteeIndicator:
internationalDocumentVerification: 1
marketingCarrierDesignator: AC
frequentFlyerAirlineDesignator: AC
frequenFlyerNumber: 1234567890123
idAdIndicator:
freeBaggageAllowance: 4PC
fastTrack: Y
Airline use section: LX58Z
Date of flight: 2011-11-22
Leg 2
operatingCarrierPNRCode: DEF456
fromCityAirportCode: FRA
toCityAirportCode: GVA
operatingCarrierDesignator: LH
flightNumber: 3664
dayOfFlight: 327
compartmentCode: C
seatNumber: 012C
checkinSequenceNumber: 0002
passengerStatus: 1
variableFieldSize: 46
conditionalFieldSize: 42
airlineNumericCode: 014
documentNumber: 0987654321
selecteeIndicator:
internationalDocumentVerification: 1
marketingCarrierDesignator: AC
frequentFlyerAirlineDesignator: AC
frequenFlyerNumber: 1234567890123
idAdIndicator:
freeBaggageAllowance: 3PC
fastTrack: N
Airline use section: WQ
Date of flight: 2011-11-23
Security:
type: 1
size: 8
securityData: ABCDEFGH
......@@ -25,7 +25,7 @@
"reservationStatus": "http://schema.org/ReservationConfirmed",
"reservedTicket": {
"@type": "Ticket",
"ticketToken": "aztecCode:M2GRANDMAIRE/MELANIE EABC123 GVACDGAF 0123 339C002F0025 130>5002A0571234567890 AF AF 1234567890123456 YDEF456 CDGDTWNW 0049 339F001A0002 12C2A012098765432101 2PC ^18ABCDEFGH"
"ticketToken": "aztecCode:M2GRANDMAIRE/MELANIE EABC123 GVACDGAF 0123 339C002F0025 130>5002A0571234567890 AF AF 1234567890123456 YDEF456 CDGDTWNW 0049 339F001A0002 12C2A012098765432101 2PC ^108ABCDEFGH"
},
"underName": {
"@type": "Person",
......@@ -59,7 +59,7 @@
"reservationStatus": "http://schema.org/ReservationConfirmed",
"reservedTicket": {
"@type": "Ticket",
"ticketToken": "aztecCode:M2GRANDMAIRE/MELANIE EABC123 GVACDGAF 0123 339C002F0025 130>5002A0571234567890 AF AF 1234567890123456 YDEF456 CDGDTWNW 0049 339F001A0002 12C2A012098765432101 2PC ^18ABCDEFGH"
"ticketToken": "aztecCode:M2GRANDMAIRE/MELANIE EABC123 GVACDGAF 0123 339C002F0025 130>5002A0571234567890 AF AF 1234567890123456 YDEF456 CDGDTWNW 0049 339F001A0002 12C2A012098765432101 2PC ^108ABCDEFGH"
},
"underName": {
"@type": "Person",
......
IATA Barcoded Boarding Pass
formatCode: M
numberOfLegs: 2
passengerName: GRANDMAIRE/MELANIE
electronicTicketIndicator: E
version: 5
fieldSize: 0
passengerDescription:
sourceOfCheckin:
sourceOfBoardingPassIssuance:
yearOfIssue: 0
dayOfIssue: 0
documentType:
airlineDesignatorOfBoardingPassIssuer:
baggageTagLicensePlateNumber1:
baggageTagLicensePlateNumber2:
baggageTagLicensePlateNumber3:
Date of issue:
Leg 1
operatingCarrierPNRCode: ABC123
fromCityAirportCode: GVA
toCityAirportCode: CDG
operatingCarrierDesignator: AF
flightNumber: 0123
dayOfFlight: 339
compartmentCode: C
seatNumber: 002F
checkinSequenceNumber: 0025
passengerStatus: 1
variableFieldSize: 48
conditionalFieldSize: 42
airlineNumericCode: 057
documentNumber: 1234567890
selecteeIndicator:
internationalDocumentVerification:
marketingCarrierDesignator: AF
frequentFlyerAirlineDesignator: AF
frequenFlyerNumber: 1234567890123456
idAdIndicator:
freeBaggageAllowance:
fastTrack: Y
Airline use section:
Date of flight: 2018-12-05
Leg 2
operatingCarrierPNRCode: DEF456
fromCityAirportCode: CDG
toCityAirportCode: DTW
operatingCarrierDesignator: NW
flightNumber: 0049
dayOfFlight: 339
compartmentCode: F
seatNumber: 001A
checkinSequenceNumber: 0002
passengerStatus: 1
variableFieldSize: 44
conditionalFieldSize: 42
airlineNumericCode: 012
documentNumber: 0987654321
selecteeIndicator: 0
internationalDocumentVerification: 1
marketingCarrierDesignator:
frequentFlyerAirlineDesignator:
frequenFlyerNumber:
idAdIndicator:
freeBaggageAllowance: 2PC
fastTrack:
Airline use section:
Date of flight: 2018-12-05
Security:
type: 1
size: 8
securityData: ABCDEFGH
IATA Barcoded Boarding Pass
formatCode: M
numberOfLegs: 1
passengerName: DOE/JOHN
electronicTicketIndicator: E
version: 5
fieldSize: 24
passengerDescription: 1
sourceOfCheckin: W
sourceOfBoardingPassIssuance: M
yearOfIssue: 7
dayOfIssue: 34
documentType: B
airlineDesignatorOfBoardingPassIssuer: SN
baggageTagLicensePlateNumber1:
baggageTagLicensePlateNumber2:
baggageTagLicensePlateNumber3:
Date of issue: 2017-02-03
Leg 1
operatingCarrierPNRCode: XXX007
fromCityAirportCode: TXL
toCityAirportCode: BRU
operatingCarrierDesignator: SN
flightNumber: 2588
dayOfFlight: 34
compartmentCode: Y
seatNumber: 023D
checkinSequenceNumber: 0999
passengerStatus: 3
variableFieldSize: 93
conditionalFieldSize: 42
airlineNumericCode: 082
documentNumber: 0000000000
selecteeIndicator: 0
internationalDocumentVerification:
marketingCarrierDesignator: SN
frequentFlyerAirlineDesignator: LH
frequenFlyerNumber: 123456789012345
idAdIndicator:
freeBaggageAllowance:
fastTrack:
Airline use section: *30600000K0902
Date of flight: 2017-02-03
IATA Barcoded Boarding Pass
formatCode: M
numberOfLegs: 1
passengerName: DOE/JOHN
electronicTicketIndicator: E
version: 0
fieldSize: 0
passengerDescription:
sourceOfCheckin:
sourceOfBoardingPassIssuance:
yearOfIssue: 0
dayOfIssue: 0
documentType:
airlineDesignatorOfBoardingPassIssuer:
baggageTagLicensePlateNumber1:
baggageTagLicensePlateNumber2:
baggageTagLicensePlateNumber3:
Date of issue:
Leg 1
operatingCarrierPNRCode: XXX007
fromCityAirportCode: TXL
toCityAirportCode: BRU
operatingCarrierDesignator: SN
flightNumber: 2592
dayOfFlight: 110
compartmentCode: Y
seatNumber:
checkinSequenceNumber:
passengerStatus:
variableFieldSize: 0
conditionalFieldSize: 0
airlineNumericCode:
documentNumber:
selecteeIndicator:
internationalDocumentVerification:
marketingCarrierDesignator:
frequentFlyerAirlineDesignator:
frequenFlyerNumber:
idAdIndicator:
freeBaggageAllowance:
fastTrack:
Airline use section:
Date of flight: 2018-04-20
IATA Barcoded Boarding Pass
formatCode: M
numberOfLegs: 1
passengerName: DOE/JOHN
electronicTicketIndicator: E
version: 0
fieldSize: 0
passengerDescription:
sourceOfCheckin:
sourceOfBoardingPassIssuance:
yearOfIssue: 0
dayOfIssue: 0
documentType:
airlineDesignatorOfBoardingPassIssuer:
baggageTagLicensePlateNumber1:
baggageTagLicensePlateNumber2:
baggageTagLicensePlateNumber3:
Date of issue:
Leg 1
operatingCarrierPNRCode: XXX007
fromCityAirportCode: TXL
toCityAirportCode: BRU
operatingCarrierDesignator: SN
flightNumber: 2592
dayOfFlight: 110
compartmentCode:
seatNumber:
checkinSequenceNumber:
passengerStatus:
variableFieldSize: 0
conditionalFieldSize: 0
airlineNumericCode:
documentNumber:
selecteeIndicator:
internationalDocumentVerification:
marketingCarrierDesignator:
frequentFlyerAirlineDesignator:
frequenFlyerNumber:
idAdIndicator:
freeBaggageAllowance:
fastTrack:
Airline use section:
Date of flight: 2018-04-20
IATA Barcoded Boarding Pass
formatCode: M
numberOfLegs: 1
passengerName: DOE/JOHN
electronicTicketIndicator:
version: 1
fieldSize: 24
passengerDescription: 1
sourceOfCheckin: W
sourceOfBoardingPassIssuance:
yearOfIssue: 8
dayOfIssue: 33
documentType: B
airlineDesignatorOfBoardingPassIssuer: EW
baggageTagLicensePlateNumber1: 0000000000000
baggageTagLicensePlateNumber2:
baggageTagLicensePlateNumber3:
Date of issue: 2018-02-02
Leg 1
operatingCarrierPNRCode: XXX007
fromCityAirportCode: BRU
toCityAirportCode: TXL
operatingCarrierDesignator: EW
flightNumber: 8103
dayOfFlight: 35
compartmentCode: Y
seatNumber: 012C
checkinSequenceNumber: 0030
passengerStatus: 1
variableFieldSize: 71
conditionalFieldSize: 41
airlineNumericCode: 104
documentNumber: 0000000000
selecteeIndicator:
internationalDocumentVerification: 0
marketingCarrierDesignator:
frequentFlyerAirlineDesignator: LH
frequenFlyerNumber: 123456789012345
idAdIndicator:
freeBaggageAllowance:
fastTrack:
Airline use section:
Date of flight: 2018-02-04
IATA Barcoded Boarding Pass
formatCode: M
numberOfLegs: 1
passengerName: DOE/JOHN
electronicTicketIndicator: E
version: 2
fieldSize: 24
passengerDescription: 0
sourceOfCheckin:
sourceOfBoardingPassIssuance:
yearOfIssue: 0
dayOfIssue: 0
documentType: B
airlineDesignatorOfBoardingPassIssuer: 1A
baggageTagLicensePlateNumber1:
baggageTagLicensePlateNumber2:
baggageTagLicensePlateNumber3:
Date of issue:
Leg 1
operatingCarrierPNRCode: XXX007
fromCityAirportCode: LIS
toCityAirportCode: LCG
operatingCarrierDesignator: TP
flightNumber: 1080
dayOfFlight: 204
compartmentCode: Y
seatNumber: 002D
checkinSequenceNumber: 0003
passengerStatus: 3
variableFieldSize: 92
conditionalFieldSize: 41
airlineNumericCode: 047
documentNumber: 1234567890
selecteeIndicator: 0
internationalDocumentVerification:
marketingCarrierDesignator:
frequentFlyerAirlineDesignator:
frequenFlyerNumber:
idAdIndicator:
freeBaggageAllowance:
fastTrack:
Airline use section: *306 09 BRND
Date of flight: 2018-07-23
......@@ -17,6 +17,8 @@
#include <QJsonArray>
#include <QJsonDocument>
#include <QObject>
#include <QProcess>
#include <QStandardPaths>
#include <QTest>
using namespace KItinerary;
......@@ -31,27 +33,27 @@ private Q_SLOTS:
QTest::addColumn<QString>("refFile");
// example data from IATA resolution 792 version 5 Attachment B (with security sections shortended or omitted)
QTest::newRow("single leg, mandatory only") << QStringLiteral("M1DESMARAIS/LUC EABC123 YULFRAAC 0834 326J001A0025 100") << QStringLiteral("iata-resolution792-example1.json");
QTest::newRow("single leg, all fields") << QStringLiteral("M1DESMARAIS/LUC EAB12C3 YULFRAAC 0834 326J003A0027 167>5321WW1325BAC 0014123456002001412346700100141234789012A0141234567890 1AC AC 1234567890123 4PCYLX58Z^108ABCDEFGH") << QStringLiteral("iata-resolution792-example2.json");
QTest::newRow("single leg, partial") << QStringLiteral("M1GRANDMAIRE/MELANIE EABC123 GVACDGAF 0123 339C002F0025 130>5002A0571234567890 AF AF 1234567890123456 Y^18ABCDEFGH") << QStringLiteral("iata-resolution792-example3.json");
QTest::newRow("multi leg, all fields") << QStringLiteral("M2DESMARAIS/LUC EAB12C3 YULFRAAC 0834 326J003A0027 167>5321WW1325BAC 0014123456002001412346700100141234789012A0141234567890 1AC AC 1234567890123 4PCYLX58ZDEF456 FRAGVALH 3664 327C012C0002 12E2A0140987654321 1AC AC 1234567890123 3PCNWQ^108ABCDEFGH") << QStringLiteral("iata-resolution792-example4.json");
QTest::newRow("multi leg, partial") << QStringLiteral("M2GRANDMAIRE/MELANIE EABC123 GVACDGAF 0123 339C002F0025 130>5002A0571234567890 AF AF 1234567890123456 YDEF456 CDGDTWNW 0049 339F001A0002 12C2A012098765432101 2PC ^18ABCDEFGH") << QStringLiteral("iata-resolution792-example5.json");
QTest::newRow("single leg, mandatory only") << QStringLiteral("M1DESMARAIS/LUC EABC123 YULFRAAC 0834 326J001A0025 100") << QStringLiteral("iata-resolution792-example1");
QTest::newRow("single leg, all fields") << QStringLiteral("M1DESMARAIS/LUC EAB12C3 YULFRAAC 0834 326J003A0027 167>5321WW1325BAC 0014123456002001412346700100141234789012A0141234567890 1AC AC 1234567890123 4PCYLX58Z^108ABCDEFGH") << QStringLiteral("iata-resolution792-example2");
QTest::newRow("single leg, partial") << QStringLiteral("M1GRANDMAIRE/MELANIE EABC123 GVACDGAF 0123 339C002F0025 130>5002A0571234567890 AF AF 1234567890123456 Y^108ABCDEFGH") << QStringLiteral("iata-resolution792-example3");
QTest::newRow("multi leg, all fields") << QStringLiteral("M2DESMARAIS/LUC EAB12C3 YULFRAAC 0834 326J003A0027 167>5321WW1325BAC 0014123456002001412346700100141234789012A0141234567890 1AC AC 1234567890123 4PCYLX58ZDEF456 FRAGVALH 3664 327C012C0002 12E2A0140987654321 1AC AC 1234567890123 3PCNWQ^108ABCDEFGH") << QStringLiteral("iata-resolution792-example4");
QTest::newRow("multi leg, partial") << QStringLiteral("M2GRANDMAIRE/MELANIE EABC123 GVACDGAF 0123 339C002F0025 130>5002A0571234567890 AF AF 1234567890123456 YDEF456 CDGDTWNW 0049 339F001A0002 12C2A012098765432101 2PC ^108ABCDEFGH") << QStringLiteral("iata-resolution792-example5");
// EW misses the 'E' eticket marker (BCBP item 253)
QTest::newRow("missing eticket indicator") << QStringLiteral("M1DOE/JOHN XXX007 BRUTXLEW 8103 035Y012C0030 147>1181W 8033BEW 0000000000000291040000000000 0 LH 123456789012345 ") << QStringLiteral("missing-eticket-indicator.json");
QTest::newRow("missing eticket indicator") << QStringLiteral("M1DOE/JOHN XXX007 BRUTXLEW 8103 035Y012C0030 147>1181W 8033BEW 0000000000000291040000000000 0 LH 123456789012345 ") << QStringLiteral("missing-eticket-indicator");
// boarding pass issue date (BCBP item 22)
QTest::newRow("issue date") << QStringLiteral("M1DOE/JOHN EXXX007 TXLBRUSN 2588 034Y023D0999 35D>5181WM7034BSN 2A08200000000000 SN LH 123456789012345 *30600000K0902 ") << QStringLiteral("issue-date.json");
QTest::newRow("issue date") << QStringLiteral("M1DOE/JOHN EXXX007 TXLBRUSN 2588 034Y023D0999 35D>5181WM7034BSN 2A08200000000000 SN LH 123456789012345 *30600000K0902 ") << QStringLiteral("issue-date");
// EasyJet being easy on the standard interpretation
QTest::newRow("easyjet") << QStringLiteral("M1DOE/JOHN EABCDEFGMRSLGWEZY8724 99 3C 506 10Axxxxxxxxxx") << QStringLiteral("easyjet.json");
QTest::newRow("easyjet") << QStringLiteral("M1DOE/JOHN EABCDEFGMRSLGWEZY8724 99 3C 506 10Axxxxxxxxxx") << QStringLiteral("easyjet");
// Brussels Airlines short codes on booking confirmation
QTest::newRow("minimal1") << QStringLiteral("M1DOE/JOHN EXXX007 TXLBRUSN 2592 110Y") << QStringLiteral("minimal.json");
QTest::newRow("minimal2") << QStringLiteral("M1DOE/JOHN EXXX007 TXLBRUSN 2592 110") << QStringLiteral("minimal2.json");
QTest::newRow("minimal1") << QStringLiteral("M1DOE/JOHN EXXX007 TXLBRUSN 2592 110Y") << QStringLiteral("minimal");
QTest::newRow("minimal2") << QStringLiteral("M1DOE/JOHN EXXX007 TXLBRUSN 2592 110") << QStringLiteral("minimal2");
// TAP missing boarding pass issue date