diff options
author | CGantert345 <57003061+CGantert345@users.noreply.github.com> | 2020-07-28 17:57:25 +0200 |
---|---|---|
committer | CGantert345 <57003061+CGantert345@users.noreply.github.com> | 2020-07-28 17:57:25 +0200 |
commit | b17ce13cc31abd088088bf8ab26cc924a6a36585 (patch) | |
tree | 5588e1ccc212213097500f4cb43fa0e3e68e323b /src/org/uic/barcode/test/TicketLayoutTest.java | |
parent | Draft of the new DOSIPAS included (diff) | |
download | UIC-barcode-b17ce13cc31abd088088bf8ab26cc924a6a36585.tar UIC-barcode-b17ce13cc31abd088088bf8ab26cc924a6a36585.tar.gz UIC-barcode-b17ce13cc31abd088088bf8ab26cc924a6a36585.tar.bz2 UIC-barcode-b17ce13cc31abd088088bf8ab26cc924a6a36585.tar.lz UIC-barcode-b17ce13cc31abd088088bf8ab26cc924a6a36585.tar.xz UIC-barcode-b17ce13cc31abd088088bf8ab26cc924a6a36585.tar.zst UIC-barcode-b17ce13cc31abd088088bf8ab26cc924a6a36585.zip |
Diffstat (limited to 'src/org/uic/barcode/test/TicketLayoutTest.java')
-rw-r--r-- | src/org/uic/barcode/test/TicketLayoutTest.java | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/org/uic/barcode/test/TicketLayoutTest.java b/src/org/uic/barcode/test/TicketLayoutTest.java new file mode 100644 index 0000000..0210896 --- /dev/null +++ b/src/org/uic/barcode/test/TicketLayoutTest.java @@ -0,0 +1,45 @@ +package org.uic.barcode.test;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+
+import org.junit.Test;
+import org.uic.barcode.staticFrame.UTLAYDataRecord;
+import org.uic.barcode.staticHeader.ticketLayoutBarcode.TicketLayout;
+import org.uic.barcode.test.utils.SimpleTestTicketLayout;
+import org.uic.barcode.test.utils.TestUtils;
+import org.uic.ticket.EncodingFormatException;
+
+
+public class TicketLayoutTest {
+
+
+ @Test public void testTicketLayout() throws IOException, EncodingFormatException{
+
+ UTLAYDataRecord tl1 = new UTLAYDataRecord();
+
+ TicketLayout layout = SimpleTestTicketLayout.getSimpleTestTicketLayout();
+ tl1.setLayout(layout);
+
+ byte[] encoded = null;
+ try {
+ encoded = tl1.encode();
+ } catch (IOException e) {
+ throw (e);
+ }
+
+ String hex = TestUtils.hexStringFromBytes(encoded);
+
+ assertEquals(hex,"555F544C41593031303034305243543230303031303130313031323030303030374DC3BC6C6C6572");
+
+ UTLAYDataRecord tl2 = new UTLAYDataRecord();
+
+ tl2.decode(tl1.encode());
+
+
+ assertEquals(tl1.toString(),tl2.toString());
+
+ }
+
+}
|