/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

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