PageRenderTime 9ms CodeModel.GetById 2ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/tst/org/diffkit/diff/testcase/TestCases.txt

http://diffkit.googlecode.com/
Plain Text | 244 lines | 207 code | 37 blank | 0 comment | 0 complexity | 4c00652783092c643660fb08613a8772 MD5 | raw file
  1test1
  2-----
  3A basic sanity check that compares two identical DB tables using the most straightforward possible 
  4comparison. Everything is wired explicitly into a PassthroughPlan.
  5
  6test2
  7-----
  8Compare two DB tables using the most straightforward possible comparison.  
  9Everything is wired explicitly into a PassthroughPlan.
 10
 11test3
 12-----
 13A basic sanity check that compares two identical File Tables using the most straightforward possible 
 14comparison. Everything is wired explicitly into a PassthroughPlan.
 15
 16test4
 17-----
 18Compare two File tables using the most straightforward possible comparison.  
 19Everything is wired explicitly into a PassthroughPlan.
 20
 21test5
 22-----
 23Compare two File tables using the most straightforward possible comparison.  
 24Everything is wired explicitly into a PassthroughPlan. Plan limits diffs to ROW_DIFF diffs only.
 25
 26test6
 27-----
 28Compare two File tables using the most straightforward possible comparison.  
 29Everything is wired explicitly into a PassthroughPlan. Plan limits diffs to COLUMN_DIFF diffs only.
 30
 31test7
 32-----
 33Compare two File tables using the most straightforward possible comparison.  
 34Everything is wired explicitly into a PassthroughPlan. Plan limits total number of diffs (maxDiffs) to 2.
 35
 36test8
 37-----
 38Compare two DB tables using the most automatic default provided by the MagicPlan. Only the two table names
 39and the ConnectionInfo are provided in the plan file. Everything else is figured out by MagicPlan.
 40
 41test9
 42-----
 43Compare two file tables using the most automatic default provided by the MagicPlan. Only the two file paths 
 44and the file path for the Sink are provided in the plan file. Everything else is figured out by MagicPlan.
 45
 46test10
 47------
 48Compare two DB tables using mostly automatic default provided by the MagicPlan. Plan specifies keyColumnNames, 
 49which are different from the pk defined in the database for the target table. If alignment was carried out using 
 50table pk (column1), all rows would be row diffs. Instead, engine is able to align the rows and produce only column diffs
 51because of the keyColumnName override (column3).
 52
 53test11
 54------
 55Compare two file tables using mostly automatic default provided by the MagicPlan. Plan specifies keyColumnNames, 
 56which are different from the default pk (first column) for file based tables. If alignment was carried out using 
 57default pk (column1), all rows would be row diffs. Instead, engine is able to align the rows and produce only column diffs
 58because of the keyColumnName override (column3).
 59
 60test12
 61------
 62Compare heterogenous sources, lhs is DB rhs is FILE, using MagicPlan. Differences in table structure are
 63silently ignored by AutomaticTableComparison. Column3 is a BIGINT in the DB, but a STRING in the FILE, 
 64because the FILE is only auto modelled. So the Diffor has to perform conversion.
 65
 66test13
 67------
 68Demonstrate the use of diffColumnNames and displayColumnNames in MagicPlan.  There are diffs in 
 69column3 and column4. The plan uses diffColumnNames to limit the comparison to just column2,
 70ensuring that only row diffs are found (there are no column diffs in column2).  By default, only key columns
 71are used for display in the diff report, but the plan specifies that column1 and column3 should be used 
 72in the display of rows within the diff report.
 73
 74test14
 75------
 76Demonstrate the use of ignoreColumnNames and displayColumnNames in MagicPlan.  There are diffs in 
 77column3 and column4. The plan uses ignorefColumnNames to exclude column3 and column4 from diffing,
 78ensuring that only row diffs are found (there are no column diffs in column2).  By default, only key columns
 79are used for display in the diff report, but the plan specifies that column1 and column3 should be used 
 80in the display of rows within the diff report.
 81
 82test15
 83------
 84Test global numberTolerance and toleranceMap. MagicPlan will ensure that no numeric diffs of magnitude
 85less than 3 will be considered (numberTolerance =2), and that any diffs in COLUMN3 and COLUMN4 that 
 86are not greater than 4 (toleranceMap; 4=COLUMN3,COLUMN4) will be ignored.
 87
 88test16
 89------
 90Test DBSource where clause. There are two rows on the lhs (COLUMN1=0, 5555) that are not on the rhs.
 91By default, these would generate ROW diffs. However, we add a lhsWhereClause to the MagicPlan that
 92excludes all rows only the rhs that are not on the lhs. The result is that the diff report contains only 
 93column diffs.
 94
 95test17
 96------
 97Test the boundary case where one table (LHS) has rows, but the other table (RHS) is empty.
 98
 99test18
100------
101Compare across different databases. Compare two DB tables using the most automatic 
102default provided by the MagicPlan. Only the two table names and the ConnectionInfo are 
103provided in the plan file. Everything else is figured out by MagicPlan.
104
105test19
106------
107Exercise of various SQL data types: VARCHAR, BIGINT, DATE, CHAR, TIME, INT, 
108DECIMAL, DOUBLE, REAL, TIMESTAMP, BOOLEAN, TINYINT, SMALLINT, CLOB
109
110test20
111------
112Demos issue 5. The target DB tables do not have PK defined at the SQL level. User
113has specified keyColumnNames in the plan file. DKDBSource must reorder the rows 
114appropriately for the key definition in the plan file to assure that there is only
1151 row diff.
116
117test21
118------
119Test of diffKind and maxDiffs properties in MagicPlan. Plan limits
120diffs to ROW_DIFF diffs only, and maxDiffs of 2. If BOTH kinds of diffs were
121reported, there would be 4 COLUMN_DIFFs, in addition to the 2 ROW_DIFFs. But the
122diffKind property filters those out. If maxDiff was not specified, it would 
123default to a huge number (Long.MAX), and all 3 row diffs would be reported. But 
124since maxDiffs is specified to the MagicPlan, only the first 2 ROW_DIFFs are
125reported.
126
127test22
128------
129Demonstrates ability of TestCaseRunner to test for Exceptions (or failures) of 
130a specified type. In this case, the MagicPlan file specifies displayColumnNames
131that don't exist in the sources. So we expect that the framework will throw an
132appropriate exception.
133
134test23
135------
136Demonstrates withSummary option of the DKFileSink. Also demonstrates the 
137groupByColumnNames option.
138
139test24
140------
141Demonstrates the TextDiffor and how it can be used to compare CLOBs in a way
142that is insensitive to newlines. Also demonstrates the use of the whereClause.
143
144test25
145------
146Demonstrates the use of dbTableName in MagicPlan. The table name is the
147same on the LHS and RHS. Also demonstrates use of whereClause in MagicPlan. 
148The where clause is the same on the LHS and RHS.
149
150test26
151------
152Demonstrates SqlPatchSink, and how it is used to generate SQL statements 
153(INSERT, DELETE, UPDATE) in order to synchronize two tables. Also demonstrates
154how DiffKit handles creating DML statements for Strings that contain embedded
155single quotes (')
156
157test27
158------
159A basic sanity check that compares two identical Excel XLSX File Tables using the
160most straightforward possible comparison. Everything is wired explicitly into a
161PassthroughPlan.
162
163test28
164------
165Compare two spreadsheet file tables using mostly automatic default provided by
166the MagicPlan. Only the two file names are provided in the plan file.
167
168test29
169------
170Compare SpreadSheet tables using a PassthroughPlan. Demonstrates targeting an 
171explicitly named sheet, rather than defaulting to first sheet. Also demonstrates
172a SpreadSheet that exercises all of the different data types available within 
173DiffKit for describing columns.
174
175test30
176------
177Demonstrates situation where all columns in target tables are part of primary
178key defined in the database. This covers issue #62. Even though it's not possible
179to search for column diffs in this scenario, DiffKit must still be able to properly
180find row diffs.
181
182test31
183------
184Compare SpreadSheet tables using a PassthroughPlan. Demonstrates leaving the sheet 
185name blank in the plan, so that the first sheet is used by default. Demonstrates
186explicitly modeling the ROW_NUM, and how ROW_DIFFs are reported when using ROW_NUM
187as the key. Demonstrates use of header row (hasHeader -> true). 
188Exercises several different data types.
189
190test32
191------
192This test is the same as test31, except that the key is COLUMN1 instead of <ROW_NUM>,
193and the spreadsheets are not pre-sorted (isSorted = false), so that DiffKit has to
194sort them internally before diff'ng.
195Compare SpreadSheet tables using a PassthroughPlan. Demonstrates leaving the sheet 
196name blank in the plan, so that the first sheet is used by default. Demonstrates
197how ROW_DIFFs are generated when rows are aligned on COLUMN1, instead of ROW_NUM
198(e.g. Test31). Demonstrates use of header row (hasHeader -> true). 
199Exercises several different data types.
200
201test33
202------
203Compare SpreadSheet tables using a MagicPlan. Sheet name is not specified, so 
204that the first sheet is used by default. No key is specified in the plan, so 
205ROW_NUM will be used. Demonstrates how ROW_DIFFs are reported when using ROW_NUM
206as the key. Demonstrates use of header row (hasHeader -> true). 
207Exercises several different data types. This test is same as test31, except that
208it is specified using a MagicPlan instead of the PassthroughPlan used in test31.
209
210test34
211------
212Compare SpreadSheet tables using a MagicPlan. Key is COLUMN1 instead
213of <ROW_NUM>, and the spreadsheets are not pre-sorted (isSorted = false), so
214that DiffKit has to sort them internally before diff'ng. Demonstrates leaving
215the sheet name blank in the plan, so that the first sheet is used by default.
216Demonstrates how ROW_DIFFs are generated when rows are aligned on COLUMN1,
217instead of ROW_NUM (e.g. Test31). Demonstrates use of header row (hasHeader ->
218true). Exercises several different data types. This is functionally same as
219test32, except that this test is specified using a MagicPlan, whereas 32 uses a
220PassthroughPlan.
221
222test35
223------
224Compare a spreadsheet against a flat-file using a MagicPlan. Both the flat-file 
225and the SS have a header. Assumes that both files are already sorted. Also
226demonstrate numerical tolerance. Without tolerance, values in COLUMN8 and COLUMN9
227will be different in all rows.
228
229[N.B. Using a MagicPlan, it's currently possible to diff spreadsheet vs. flat-file 
230only in the case where the key in the spreadsheet is type String. That's because the 
231key type in the spreadsheet must match the key type in the flat-file, and all
232columns are always typed to String in a flat-file when using a MagicPlan.]
233
234test36
235------
236Compare a SpreadSheet on the LHS vs. a DB Source on the RHS, using a MagicPlan.
237Demonstrates the use of ToleranceMap. Also highlights a bug in DiffKit data type
238coercion. COLUMN5 has the same type (to the extent that you can clearly type SS
239columns) in both the SS and the DB: Time. It's read from both sources a java.sql.Time,
240however there is some subtle difference in the way that the values are read that
241results in different Time (reported by getTime()) values. So COLUMN5 generates
242a diff in every row even though the values appear to be the same in the diff
243report file.
244