1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 package org.dbunit.assertion;
22
23 import org.dbunit.dataset.ITable;
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38 public class Difference
39 {
40 private ITable expectedTable;
41 private ITable actualTable;
42 private int rowIndex;
43 private String columnName;
44 private Object expectedValue;
45 private Object actualValue;
46 private String failMessage;
47
48 public Difference(final ITable expectedTable, final ITable actualTable,
49 final int rowIndex, final String columnName,
50 final Object expectedValue, final Object actualValue)
51 {
52 this(expectedTable, actualTable, rowIndex, columnName, expectedValue,
53 actualValue, "");
54 }
55
56 public Difference(final ITable expectedTable, final ITable actualTable,
57 final int rowIndex, final String columnName,
58 final Object expectedValue, final Object actualValue,
59 final String failMessage)
60 {
61 this.expectedTable = expectedTable;
62 this.actualTable = actualTable;
63 this.rowIndex = rowIndex;
64 this.columnName = columnName;
65 this.expectedValue = expectedValue;
66 this.actualValue = actualValue;
67 this.failMessage = failMessage;
68 }
69
70 @Override
71 public String toString()
72 {
73 final StringBuilder sb = new StringBuilder();
74 sb.append(getClass().getName()).append("[");
75 sb.append("expectedTable=").append(expectedTable);
76 sb.append(", actualTable=").append(actualTable);
77 sb.append(", rowIndex=").append(rowIndex);
78 sb.append(", columnName=").append(columnName);
79 sb.append(", expectedValue=").append(expectedValue);
80 sb.append(", actualValue=").append(actualValue);
81 sb.append(", failMessage=").append(failMessage);
82 sb.append("]");
83 return sb.toString();
84 }
85
86 public ITable getExpectedTable()
87 {
88 return expectedTable;
89 }
90
91 public ITable getActualTable()
92 {
93 return actualTable;
94 }
95
96 public int getRowIndex()
97 {
98 return rowIndex;
99 }
100
101 public String getColumnName()
102 {
103 return columnName;
104 }
105
106 public Object getExpectedValue()
107 {
108 return expectedValue;
109 }
110
111 public Object getActualValue()
112 {
113 return actualValue;
114 }
115
116 public String getFailMessage()
117 {
118 return failMessage;
119 }
120
121 public void setFailMessage(final String failMessage)
122 {
123 this.failMessage = failMessage;
124 }
125 }