summaryrefslogtreecommitdiffstats
path: root/src/org/uic/barcode/test
diff options
context:
space:
mode:
authorCGantert345 <57003061+CGantert345@users.noreply.github.com>2021-03-25 18:37:47 +0100
committerGitHub <noreply@github.com>2021-03-25 18:37:47 +0100
commit945963a8118dcf88fe53386df1d0c08c53e79bf9 (patch)
treecafd23ff62d39812466f1751af006d010548eca8 /src/org/uic/barcode/test
parentMerge pull request #10 from UnionInternationalCheminsdeFer/time-zone-fix_2 (diff)
parent- additional test on LayoutElement with utf-8 (diff)
downloadUIC-barcode-945963a8118dcf88fe53386df1d0c08c53e79bf9.tar
UIC-barcode-945963a8118dcf88fe53386df1d0c08c53e79bf9.tar.gz
UIC-barcode-945963a8118dcf88fe53386df1d0c08c53e79bf9.tar.bz2
UIC-barcode-945963a8118dcf88fe53386df1d0c08c53e79bf9.tar.lz
UIC-barcode-945963a8118dcf88fe53386df1d0c08c53e79bf9.tar.xz
UIC-barcode-945963a8118dcf88fe53386df1d0c08c53e79bf9.tar.zst
UIC-barcode-945963a8118dcf88fe53386df1d0c08c53e79bf9.zip
Diffstat (limited to 'src/org/uic/barcode/test')
-rw-r--r--src/org/uic/barcode/test/TicketLayoutTest.java27
-rw-r--r--src/org/uic/barcode/test/utils/SimpleTestTicketLayout.java15
2 files changed, 42 insertions, 0 deletions
diff --git a/src/org/uic/barcode/test/TicketLayoutTest.java b/src/org/uic/barcode/test/TicketLayoutTest.java
index 089c87d..3d053e7 100644
--- a/src/org/uic/barcode/test/TicketLayoutTest.java
+++ b/src/org/uic/barcode/test/TicketLayoutTest.java
@@ -6,6 +6,7 @@ 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;
@@ -40,6 +41,32 @@ public class TicketLayoutTest {
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);
+
+ }
+
+ }
+
}
+
+
+
}
diff --git a/src/org/uic/barcode/test/utils/SimpleTestTicketLayout.java b/src/org/uic/barcode/test/utils/SimpleTestTicketLayout.java
index b1b6422..7b9ae1b 100644
--- a/src/org/uic/barcode/test/utils/SimpleTestTicketLayout.java
+++ b/src/org/uic/barcode/test/utils/SimpleTestTicketLayout.java
@@ -28,6 +28,21 @@ public class SimpleTestTicketLayout {
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);
+
+ }
+
+ }
+
}
}