summaryrefslogtreecommitdiffstats
path: root/src/test/java/org
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/java/org/uic/barcode/ticket/api/test/testtickets/AsnLevelPassTimeZoneTestTicketV1.java (renamed from src/main/java/org/uic/barcode/ticket/api/test/testtickets/AsnLevelPassTimeZoneTestTicketV1.java)0
-rw-r--r--src/test/java/org/uic/barcode/ticket/api/test/testtickets/CustomerCardTestTicketV1.java (renamed from src/main/java/org/uic/barcode/ticket/api/test/testtickets/CustomerCardTestTicketV1.java)0
-rw-r--r--src/test/java/org/uic/barcode/ticket/api/test/testtickets/CustomerCardTestTicketV2.java (renamed from src/main/java/org/uic/barcode/ticket/api/test/testtickets/CustomerCardTestTicketV2.java)0
-rw-r--r--src/test/java/org/uic/barcode/ticket/api/test/testtickets/DelayTestTicketV3.java (renamed from src/main/java/org/uic/barcode/ticket/api/test/testtickets/DelayTestTicketV3.java)0
-rw-r--r--src/test/java/org/uic/barcode/ticket/api/test/testtickets/FipTimeZoneTestTicketV1.java (renamed from src/main/java/org/uic/barcode/ticket/api/test/testtickets/FipTimeZoneTestTicketV1.java)0
-rw-r--r--src/test/java/org/uic/barcode/ticket/api/test/testtickets/FipTimeZoneTestTicketV2.java (renamed from src/main/java/org/uic/barcode/ticket/api/test/testtickets/FipTimeZoneTestTicketV2.java)0
-rw-r--r--src/test/java/org/uic/barcode/ticket/api/test/testtickets/OpenTestTicketV1.java (renamed from src/main/java/org/uic/barcode/ticket/api/test/testtickets/OpenTestTicketV1.java)0
-rw-r--r--src/test/java/org/uic/barcode/ticket/api/test/testtickets/OpenTicketTimeZoneTestTicketV1.java (renamed from src/main/java/org/uic/barcode/ticket/api/test/testtickets/OpenTicketTimeZoneTestTicketV1.java)0
-rw-r--r--src/test/java/org/uic/barcode/ticket/api/test/testtickets/OpenTicketTimeZoneTestTicketV2.java (renamed from src/main/java/org/uic/barcode/ticket/api/test/testtickets/OpenTicketTimeZoneTestTicketV2.java)0
-rw-r--r--src/test/java/org/uic/barcode/ticket/api/test/testtickets/ParkingTestTicketV1.java (renamed from src/main/java/org/uic/barcode/ticket/api/test/testtickets/ParkingTestTicketV1.java)0
-rw-r--r--src/test/java/org/uic/barcode/ticket/api/test/testtickets/ParkingTestTicketV2.java (renamed from src/main/java/org/uic/barcode/ticket/api/test/testtickets/ParkingTestTicketV2.java)0
-rw-r--r--src/test/java/org/uic/barcode/ticket/api/test/testtickets/PassTestTicketV1.java (renamed from src/main/java/org/uic/barcode/ticket/api/test/testtickets/PassTestTicketV1.java)0
-rw-r--r--src/test/java/org/uic/barcode/ticket/api/test/testtickets/PassTimeZoneTestTicketCase1V1.java (renamed from src/main/java/org/uic/barcode/ticket/api/test/testtickets/PassTimeZoneTestTicketCase1V1.java)0
-rw-r--r--src/test/java/org/uic/barcode/ticket/api/test/testtickets/PassTimeZoneTestTicketCase2V1.java (renamed from src/main/java/org/uic/barcode/ticket/api/test/testtickets/PassTimeZoneTestTicketCase2V1.java)0
-rw-r--r--src/test/java/org/uic/barcode/ticket/api/test/testtickets/PassTimeZoneTestTicketCase3V1.java (renamed from src/main/java/org/uic/barcode/ticket/api/test/testtickets/PassTimeZoneTestTicketCase3V1.java)0
-rw-r--r--src/test/java/org/uic/barcode/ticket/api/test/testtickets/PassTimeZoneTestTicketV2.java (renamed from src/main/java/org/uic/barcode/ticket/api/test/testtickets/PassTimeZoneTestTicketV2.java)0
-rw-r--r--src/test/java/org/uic/barcode/ticket/api/test/testtickets/ReservationTestTicketV1.java (renamed from src/main/java/org/uic/barcode/ticket/api/test/testtickets/ReservationTestTicketV1.java)0
-rw-r--r--src/test/java/org/uic/barcode/ticket/api/test/testtickets/ReservationTestTicketV2.java (renamed from src/main/java/org/uic/barcode/ticket/api/test/testtickets/ReservationTestTicketV2.java)0
-rw-r--r--src/test/java/org/uic/barcode/ticket/api/test/testtickets/SimpleTicketLinkTestTicket.java (renamed from src/main/java/org/uic/barcode/ticket/api/test/testtickets/SimpleTicketLinkTestTicket.java)0
-rw-r--r--src/test/java/org/uic/barcode/ticket/api/test/testtickets/SimpleUicTestTicket.java (renamed from src/main/java/org/uic/barcode/ticket/api/test/testtickets/SimpleUicTestTicket.java)0
-rw-r--r--src/test/java/org/uic/barcode/ticket/api/test/testtickets/StationPassageTestTicketV1.java (renamed from src/main/java/org/uic/barcode/ticket/api/test/testtickets/StationPassageTestTicketV1.java)0
-rw-r--r--src/test/java/org/uic/barcode/ticket/api/test/testtickets/StationPassageTestTicketV2.java (renamed from src/main/java/org/uic/barcode/ticket/api/test/testtickets/StationPassageTestTicketV2.java)0
-rw-r--r--src/test/java/org/uic/barcode/ticket/api/test/testtickets/VoucherTestTicketV1.java (renamed from src/main/java/org/uic/barcode/ticket/api/test/testtickets/VoucherTestTicketV1.java)0
-rw-r--r--src/test/java/org/uic/barcode/ticket/api/test/testtickets/VoucherTestTicketV2.java (renamed from src/main/java/org/uic/barcode/ticket/api/test/testtickets/VoucherTestTicketV2.java)0
-rw-r--r--src/test/java/org/uic/barcode/ticketTestDB/DecodeSparpreisTicketDBTest.java61
25 files changed, 61 insertions, 0 deletions
diff --git a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/AsnLevelPassTimeZoneTestTicketV1.java b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/AsnLevelPassTimeZoneTestTicketV1.java
index 5408638..5408638 100644
--- a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/AsnLevelPassTimeZoneTestTicketV1.java
+++ b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/AsnLevelPassTimeZoneTestTicketV1.java
diff --git a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/CustomerCardTestTicketV1.java b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/CustomerCardTestTicketV1.java
index 09faac8..09faac8 100644
--- a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/CustomerCardTestTicketV1.java
+++ b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/CustomerCardTestTicketV1.java
diff --git a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/CustomerCardTestTicketV2.java b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/CustomerCardTestTicketV2.java
index 7f01b94..7f01b94 100644
--- a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/CustomerCardTestTicketV2.java
+++ b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/CustomerCardTestTicketV2.java
diff --git a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/DelayTestTicketV3.java b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/DelayTestTicketV3.java
index 9364acd..9364acd 100644
--- a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/DelayTestTicketV3.java
+++ b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/DelayTestTicketV3.java
diff --git a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/FipTimeZoneTestTicketV1.java b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/FipTimeZoneTestTicketV1.java
index bfd54fe..bfd54fe 100644
--- a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/FipTimeZoneTestTicketV1.java
+++ b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/FipTimeZoneTestTicketV1.java
diff --git a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/FipTimeZoneTestTicketV2.java b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/FipTimeZoneTestTicketV2.java
index 08b4507..08b4507 100644
--- a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/FipTimeZoneTestTicketV2.java
+++ b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/FipTimeZoneTestTicketV2.java
diff --git a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/OpenTestTicketV1.java b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/OpenTestTicketV1.java
index 69a61a9..69a61a9 100644
--- a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/OpenTestTicketV1.java
+++ b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/OpenTestTicketV1.java
diff --git a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/OpenTicketTimeZoneTestTicketV1.java b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/OpenTicketTimeZoneTestTicketV1.java
index 5ca6b73..5ca6b73 100644
--- a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/OpenTicketTimeZoneTestTicketV1.java
+++ b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/OpenTicketTimeZoneTestTicketV1.java
diff --git a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/OpenTicketTimeZoneTestTicketV2.java b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/OpenTicketTimeZoneTestTicketV2.java
index 3acc754..3acc754 100644
--- a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/OpenTicketTimeZoneTestTicketV2.java
+++ b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/OpenTicketTimeZoneTestTicketV2.java
diff --git a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/ParkingTestTicketV1.java b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/ParkingTestTicketV1.java
index ad70424..ad70424 100644
--- a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/ParkingTestTicketV1.java
+++ b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/ParkingTestTicketV1.java
diff --git a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/ParkingTestTicketV2.java b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/ParkingTestTicketV2.java
index 99d9711..99d9711 100644
--- a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/ParkingTestTicketV2.java
+++ b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/ParkingTestTicketV2.java
diff --git a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/PassTestTicketV1.java b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/PassTestTicketV1.java
index a165308..a165308 100644
--- a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/PassTestTicketV1.java
+++ b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/PassTestTicketV1.java
diff --git a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/PassTimeZoneTestTicketCase1V1.java b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/PassTimeZoneTestTicketCase1V1.java
index 8bea50a..8bea50a 100644
--- a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/PassTimeZoneTestTicketCase1V1.java
+++ b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/PassTimeZoneTestTicketCase1V1.java
diff --git a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/PassTimeZoneTestTicketCase2V1.java b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/PassTimeZoneTestTicketCase2V1.java
index cc30e72..cc30e72 100644
--- a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/PassTimeZoneTestTicketCase2V1.java
+++ b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/PassTimeZoneTestTicketCase2V1.java
diff --git a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/PassTimeZoneTestTicketCase3V1.java b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/PassTimeZoneTestTicketCase3V1.java
index 715a292..715a292 100644
--- a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/PassTimeZoneTestTicketCase3V1.java
+++ b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/PassTimeZoneTestTicketCase3V1.java
diff --git a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/PassTimeZoneTestTicketV2.java b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/PassTimeZoneTestTicketV2.java
index 7539f0d..7539f0d 100644
--- a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/PassTimeZoneTestTicketV2.java
+++ b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/PassTimeZoneTestTicketV2.java
diff --git a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/ReservationTestTicketV1.java b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/ReservationTestTicketV1.java
index 840b584..840b584 100644
--- a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/ReservationTestTicketV1.java
+++ b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/ReservationTestTicketV1.java
diff --git a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/ReservationTestTicketV2.java b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/ReservationTestTicketV2.java
index ef84644..ef84644 100644
--- a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/ReservationTestTicketV2.java
+++ b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/ReservationTestTicketV2.java
diff --git a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/SimpleTicketLinkTestTicket.java b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/SimpleTicketLinkTestTicket.java
index d752043..d752043 100644
--- a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/SimpleTicketLinkTestTicket.java
+++ b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/SimpleTicketLinkTestTicket.java
diff --git a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/SimpleUicTestTicket.java b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/SimpleUicTestTicket.java
index d8adb3d..d8adb3d 100644
--- a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/SimpleUicTestTicket.java
+++ b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/SimpleUicTestTicket.java
diff --git a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/StationPassageTestTicketV1.java b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/StationPassageTestTicketV1.java
index b0626f1..b0626f1 100644
--- a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/StationPassageTestTicketV1.java
+++ b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/StationPassageTestTicketV1.java
diff --git a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/StationPassageTestTicketV2.java b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/StationPassageTestTicketV2.java
index c551293..c551293 100644
--- a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/StationPassageTestTicketV2.java
+++ b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/StationPassageTestTicketV2.java
diff --git a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/VoucherTestTicketV1.java b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/VoucherTestTicketV1.java
index b3c2a76..b3c2a76 100644
--- a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/VoucherTestTicketV1.java
+++ b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/VoucherTestTicketV1.java
diff --git a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/VoucherTestTicketV2.java b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/VoucherTestTicketV2.java
index e7844d6..e7844d6 100644
--- a/src/main/java/org/uic/barcode/ticket/api/test/testtickets/VoucherTestTicketV2.java
+++ b/src/test/java/org/uic/barcode/ticket/api/test/testtickets/VoucherTestTicketV2.java
diff --git a/src/test/java/org/uic/barcode/ticketTestDB/DecodeSparpreisTicketDBTest.java b/src/test/java/org/uic/barcode/ticketTestDB/DecodeSparpreisTicketDBTest.java
new file mode 100644
index 0000000..5af8bc2
--- /dev/null
+++ b/src/test/java/org/uic/barcode/ticketTestDB/DecodeSparpreisTicketDBTest.java
@@ -0,0 +1,61 @@
+package org.uic.barcode.ticketTestDB;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.uic.barcode.Decoder;
+import org.uic.barcode.asn1.uper.UperEncoder;
+import org.uic.barcode.staticFrame.ticketLayoutBarcode.TicketLayout;
+import org.uic.barcode.ticket.api.spec.IOpenTicket;
+import org.uic.barcode.ticket.api.spec.ITrainLink;
+import org.uic.barcode.ticket.api.spec.IUicRailTicket;
+
+public class DecodeSparpreisTicketDBTest {
+
+ @Test
+ public void testDecoder() throws Exception {
+
+
+ byte[] content = UperEncoder.bytesFromHexString(getEncodingV2Hex());
+
+ // try to decode
+ Decoder decoder = new Decoder(content);
+ TicketLayout layout = decoder.getLayout();
+ IUicRailTicket ticket = decoder.getUicTicket();
+
+
+ Assert.assertNotNull(ticket);
+
+ Assert.assertNotNull(ticket.getDocumentData());
+ Assert.assertNotNull(ticket.getIssuerDetails());
+ Assert.assertNotNull(ticket.getTravelerDetails());
+ assert(ticket.getTravelerDetails().getTravelers().size() == 1);
+ assert(ticket.getDocumentData().size() == 1);
+ IOpenTicket openTicket = (IOpenTicket) ticket.getDocumentData().iterator().next();
+ Assert.assertNotNull(openTicket.getValidRegionList());
+ ITrainLink tl = (ITrainLink) openTicket.getValidRegionList().iterator().next();
+ assert(tl.getTrain().contentEquals("ICE973"));
+ Assert.assertNotNull(decoder);
+ }
+
+ public static String getEncodingV2Hex() {
+
+ return "2355543032313038303030303032782e" +
+ "2fe184a1d85e89e9338b298ec61aeba2" +
+ "48ce722056ca940a967c8a1d39126e2c" +
+ "628c4fcea91ba35216a0a350f894de5e" +
+ "bd7b8909920fde947feede0e20c43031" +
+ "3939789c01bc0043ff555f464c455831" +
+ "333031383862b20086e10dc125ea2815" +
+ "110881051c844464d985668e23a00a80" +
+ "000e96c2e4e6e8cadc08aed2d8d90104" +
+ "44d7be0100221ce610ea559b64364c38" +
+ "a82361d1cb5e1e5d32a3d0979bd099c8" +
+ "426b0b7373432b4b6852932baba3634b" +
+ "733b2b715ab34b09d101e18981c181f1" +
+ "424221521291521292a17a3a920a1152" +
+ "5a095282314952b20a49529952826278" +
+ "083001a4c38ae5bb303ace7003800700" +
+ "14b00240400f53757065722053706172" +
+ "7072656973c41e4a03";
+ }
+} \ No newline at end of file