apache/cayenne — pull request #6 by AlexKolonitsky (2014-08-28 09:52:31+00:00)
Title: CAY-1946 CDbimport improvements

Maven changes
1) jacoco report to control code coverage, it was included into "tests-development" profile
2) new dependency datafactory - in order to use random data in tests where exact value not really important
3) XmlUnit - for xml file comparison

Small refactoring
1) remove 'final' in loop parameters and private methods
2) remove public in interfaces
3) remove unnecessary casting
4) add {} for if operator
5) add @Deprecated for methods which marked as deprecated in comments
6) replace StringBuilder with simple string concatenation; since java 5 compiler can do this optimization by it self: http://docs.oracle.com/javase/specs/jls/se5.0/html/expressions.html#15.18.1.2
7) add more info into exceptions
8) move methods into class where it give most cohesion
9) make object fields final where it is possible

Other changes
1) added DbLoaderConfiguration class; this class responsibility should be provide to DataLoader all necessary information
2) added DefaultDbLoaderDelegate to avoid all methods implementation where only one required
3) make token name a constructor parameter and remove all other implementations of this method
4) I've created builders for domain objects (i.e. DataMap, Db\Obj Entity, Db\Obj Attribute, ...) and Factory for all builders; Main goal to provide easy way of construction objects and fill them partially with only data that necessary for test case, everything else required to make object valid will be generated randomly.
5) DbMergerTest - test correct identification of DbToModel changes
6) TokensReversTest - test compliance with the invariant token.reverse.reverse == token
7) TokensToModelExecution - test application correctness of DbToModel tokens
8) DbImportAction - this class will check availability of dataMap file and do merge if it is exist otherwise just load model from db
9) DbImportParameters - was renamed to DbImportConfiguration and also responsible fo construction of necessary objects for during import process
10) functional or end-to-end test for maven plugin basic usage scenarios