blob: 7b9ae1b2c64dd041a33ad6b1878ab03960007b05 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
package org.uic.barcode.test.utils;
import org.uic.barcode.staticFrame.ticketLayoutBarcode.LayoutElement;
import org.uic.barcode.staticFrame.ticketLayoutBarcode.TicketLayout;
public class SimpleTestTicketLayout {
public static TicketLayout getSimpleTestTicketLayout() {
TicketLayout layout = new TicketLayout();
layout.setLayoutStandard("RCT2");
LayoutElement element = new LayoutElement();
element.setColumn(1);
element.setLine(1);
element.setHeight(1);
element.setWidth(20);
element.setText("Müller");
layout.addLayoutElement(element);
return layout;
}
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);
}
}
}
}
|