summaryrefslogtreecommitdiffstats
path: root/src/org/uic/barcode/test
diff options
context:
space:
mode:
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);
+
+ }
+
+ }
+
}
}