diff options
author | CGantert345 <57003061+CGantert345@users.noreply.github.com> | 2021-04-01 12:51:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-01 12:51:03 +0200 |
commit | 495ff0f98f341ad72a832527b60d5fca6182268e (patch) | |
tree | f9a1b016f70bc928ae4abfce59964b1654db3687 /src/main/java/org/uic/barcode/ticket/api/test/testtickets/PassTestTicketV1.java | |
parent | Merge pull request #17 from UnionInternationalCheminsdeFer/time_zone_fix_documentation (diff) | |
parent | - fix for train link, date and time is not defined optional (diff) | |
download | UIC-barcode-495ff0f98f341ad72a832527b60d5fca6182268e.tar UIC-barcode-495ff0f98f341ad72a832527b60d5fca6182268e.tar.gz UIC-barcode-495ff0f98f341ad72a832527b60d5fca6182268e.tar.bz2 UIC-barcode-495ff0f98f341ad72a832527b60d5fca6182268e.tar.lz UIC-barcode-495ff0f98f341ad72a832527b60d5fca6182268e.tar.xz UIC-barcode-495ff0f98f341ad72a832527b60d5fca6182268e.tar.zst UIC-barcode-495ff0f98f341ad72a832527b60d5fca6182268e.zip |
Diffstat (limited to 'src/main/java/org/uic/barcode/ticket/api/test/testtickets/PassTestTicketV1.java')
-rw-r--r-- | src/main/java/org/uic/barcode/ticket/api/test/testtickets/PassTestTicketV1.java | 150 |
1 files changed, 0 insertions, 150 deletions
diff --git a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/PassTestTicketV1.java b/src/main/java/org/uic/barcode/ticket/api/test/testtickets/PassTestTicketV1.java deleted file mode 100644 index a165308..0000000 --- a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/PassTestTicketV1.java +++ /dev/null @@ -1,150 +0,0 @@ -package org.uic.barcode.ticket.api.test.testtickets;
-
-import org.uic.barcode.ticket.api.asn.omv1.CardReferenceType;
-import org.uic.barcode.ticket.api.asn.omv1.ControlData;
-import org.uic.barcode.ticket.api.asn.omv1.CustomerStatusType;
-import org.uic.barcode.ticket.api.asn.omv1.DocumentData;
-import org.uic.barcode.ticket.api.asn.omv1.ExtensionData;
-import org.uic.barcode.ticket.api.asn.omv1.IssuingData;
-import org.uic.barcode.ticket.api.asn.omv1.LinkMode;
-import org.uic.barcode.ticket.api.asn.omv1.PassData;
-import org.uic.barcode.ticket.api.asn.omv1.SequenceOfCardReferenceType;
-import org.uic.barcode.ticket.api.asn.omv1.SequenceOfCustomerStatusType;
-import org.uic.barcode.ticket.api.asn.omv1.SequenceOfDocumentData;
-import org.uic.barcode.ticket.api.asn.omv1.SequenceOfExtensionData;
-import org.uic.barcode.ticket.api.asn.omv1.SequenceOfTicketLinkType;
-import org.uic.barcode.ticket.api.asn.omv1.SequenceOfTravelerType;
-import org.uic.barcode.ticket.api.asn.omv1.TicketDetailData;
-import org.uic.barcode.ticket.api.asn.omv1.TicketLinkType;
-import org.uic.barcode.ticket.api.asn.omv1.TicketType;
-import org.uic.barcode.ticket.api.asn.omv1.TravelClassType;
-import org.uic.barcode.ticket.api.asn.omv1.TravelerData;
-import org.uic.barcode.ticket.api.asn.omv1.TravelerType;
-import org.uic.barcode.ticket.api.asn.omv1.UicRailTicketData;
-
- public class PassTestTicketV1 {
-
- public static UicRailTicketData getUicTestTicket() {
- UicRailTicketData ticket = new UicRailTicketData();
- populateTicket(ticket);
- return ticket;
- }
-
-
- private static void populateTicket(UicRailTicketData ticket) {
-
- ticket.setControlDetail(new ControlData());
- populate(ticket.getControlDetail());
-
-
- ticket.setIssuingDetail(new IssuingData());
- populateIssuingData(ticket.getIssuingDetail());
-
- TravelerData td = new TravelerData();
- populateTravelerData(td);
- ticket.setTravelerDetail(td);
-
- SequenceOfDocumentData ds = new SequenceOfDocumentData();
-
-
- //OpenTicket
- DocumentData do1 = new DocumentData();
- addPass(do1);
- ds.add(do1);
-
- ticket.setTransportDocument(ds);
-
- SequenceOfExtensionData ed = new SequenceOfExtensionData();
- populateExtensionSequence(ed);
- ticket.setExtension(ed);
-
- }
-
-
- private static void addPass(DocumentData dd) {
-
- TicketDetailData tdd = new TicketDetailData();
- PassData otd = new PassData();
- otd.setInfoText("pass");
- otd.setClassCode(TravelClassType.first);
- otd.setPassDescription("ONE COUNTRY");
- tdd.setPass(otd);
- dd.setTicket(tdd);
- }
-
-
- private static void populateTravelerData(TravelerData td) {
- td.setGroupName("myGroup");
- SequenceOfTravelerType trs = new SequenceOfTravelerType();
- TravelerType tr = new TravelerType();
- tr.setIdCard("12345");
- tr.setFirstName("John");
- tr.setSecondName("Dow");
- tr.setTicketHolder(true);
- SequenceOfCustomerStatusType ts = new SequenceOfCustomerStatusType();
- CustomerStatusType cst = new CustomerStatusType();
- cst.setCustomerStatusDescr("senior");
- ts.add(cst);
- tr.setStatus(ts);
- trs.add(tr);
- td.setTraveler(trs);
- }
-
- private static void populateIssuingData(IssuingData issuingDetail) {
- issuingDetail.setIssuingYear(2018L);
- issuingDetail.setIssuingDay(1L);
- issuingDetail.setIssuerPNR("issuerTestPNR");
- issuingDetail.setSpecimen(true);
- issuingDetail.setSecurePaperTicket(false);
- issuingDetail.setActivated(true);
- issuingDetail.setIssuedOnLine(12L);
- }
-
- private static void populateExtensionSequence(SequenceOfExtensionData ed) {
- ExtensionData ed1 = new ExtensionData();
- ed1.setExtensionId("1");
- byte[] ba1 = { (byte) 0x82, (byte) 0xDA };
- ed1.setExtensionData(ba1);
- ExtensionData ed2 = new ExtensionData();
- ed2.setExtensionId("2");
- byte[] ba2 = { (byte) 0x83, (byte) 0xDA };
- ed2.setExtensionData(ba2);
- ed.add(ed1);
- ed.add(ed2);
- }
-
- private static void populate(ControlData controlDetail) {
- controlDetail.infoText = "cd";
- controlDetail.setAgeCheckRequired(false);
- controlDetail.setIdentificationByIdCard(false);
- controlDetail.setIdentificationByPassportId(false);
- controlDetail.setOnlineValidationRequired(false);
- controlDetail.setPassportValidationRequired(false);
- controlDetail.setReductionCardCheckRequired(false);
- controlDetail.setIdentificationByCardReference(new SequenceOfCardReferenceType());
- controlDetail.getIdentificationByCardReference().add(populateCardRefrence());
- SequenceOfTicketLinkType sit = new SequenceOfTicketLinkType();
- populateLinkedTickets(sit);
- controlDetail.setIncludedTickets(sit);
- }
-
- private static void populateLinkedTickets(SequenceOfTicketLinkType sequenceOfTicketLinkType) {
- TicketLinkType tlt = new TicketLinkType();
- tlt.productOwnerIA5="test";
- tlt.setTicketType(TicketType.pass);
- tlt.setIssuerPNR("PNR");
- tlt.setReferenceIA5("UED12435867");
- tlt.setLinkMode(LinkMode.onlyValidInCombination);
- tlt.setIssuerName("OEBB");
- sequenceOfTicketLinkType.add(tlt);
- }
-
- private static CardReferenceType populateCardRefrence() {
- CardReferenceType cr = new CardReferenceType();
- cr.setTrailingCardIdNum(100L);
- return cr;
- }
-
-
-
- }
|