diff options
author | CGantert345 <57003061+CGantert345@users.noreply.github.com> | 2021-03-29 14:08:45 +0200 |
---|---|---|
committer | CGantert345 <57003061+CGantert345@users.noreply.github.com> | 2021-03-29 14:08:45 +0200 |
commit | e023e674020f1a435f7b8c8b9276704f576ea6e5 (patch) | |
tree | 011863c021df3e5356f07b056d30d0e7476061e4 /src/org/uic/barcode/test/TicketLayoutTest.java | |
parent | Merge pull request #13 from UnionInternationalCheminsdeFer/time_zone_fix_3 (diff) | |
download | UIC-barcode-e023e674020f1a435f7b8c8b9276704f576ea6e5.tar UIC-barcode-e023e674020f1a435f7b8c8b9276704f576ea6e5.tar.gz UIC-barcode-e023e674020f1a435f7b8c8b9276704f576ea6e5.tar.bz2 UIC-barcode-e023e674020f1a435f7b8c8b9276704f576ea6e5.tar.lz UIC-barcode-e023e674020f1a435f7b8c8b9276704f576ea6e5.tar.xz UIC-barcode-e023e674020f1a435f7b8c8b9276704f576ea6e5.tar.zst UIC-barcode-e023e674020f1a435f7b8c8b9276704f576ea6e5.zip |
Diffstat (limited to 'src/org/uic/barcode/test/TicketLayoutTest.java')
-rw-r--r-- | src/org/uic/barcode/test/TicketLayoutTest.java | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/src/org/uic/barcode/test/TicketLayoutTest.java b/src/org/uic/barcode/test/TicketLayoutTest.java deleted file mode 100644 index 3d053e7..0000000 --- a/src/org/uic/barcode/test/TicketLayoutTest.java +++ /dev/null @@ -1,72 +0,0 @@ -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.staticFrame.ticketLayoutBarcode.LayoutElement;
-import org.uic.barcode.staticFrame.ticketLayoutBarcode.TicketLayout;
-import org.uic.barcode.test.utils.SimpleTestTicketLayout;
-import org.uic.barcode.test.utils.TestUtils;
-import org.uic.barcode.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());
-
- compare(layout, tl2.getLayout());
-
- }
-
- public static void compare(TicketLayout layout1, TicketLayout layout2) {
-
- assert(layout1.getLayoutStandard().equals(layout2.getLayoutStandard()));
-
- for (LayoutElement e1: layout1.getElements() ) {
-
- for (LayoutElement e2 :layout2.getElements()) {
-
- boolean found = false;
- if (e1.getLine() == e2.getLine() && e1.getColumn() == e2.getColumn()) {
- found = true;
- assert(e1.getText().equals(e2.getText()));
- }
- assert(found == true);
-
- }
-
- }
-
- }
-
-
-
-
-}
|