Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test for db merge #9

Closed
wants to merge 4 commits into from
Closed

Add test for db merge #9

wants to merge 4 commits into from

Conversation

AlexKolonitsky
Copy link
Contributor

  1. make token name a constructor parameter and remove all other implementations of this method
  2. 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.
  3. DbMergerTest - test correct identification of DbToModel changes
  4. TokensReversTest - test compliance with the invariant token.reverse.reverse == token
  5. TokensToModelExecution - test application correctness of DbToModel tokens
  6. new dependency datafactory - in order to use random data in tests where exact value not really important

…mentations of this method

2) 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.
3) DbMergerTest - test correct identification of DbToModel changes
4) TokensReversTest - test compliance with the invariant token.reverse.reverse == token
5) TokensToModelExecution - test application correctness of DbToModel tokens
6) new dependency datafactory - in order to use random data in tests where exact value not really important
@andrus
Copy link
Contributor

andrus commented Aug 30, 2014

Committed in a squashed form. Good stuff! Noticed a few test failures though (on HSQL and MySQL) :

Failed tests:
testForeignKey(org.apache.cayenne.merge.DropRelationshipToModelTest)
testRemoveFKColumnWithoutRelationshipInDb(org.apache.cayenne.merge.DropColumnToModelTest)

@andrus
Copy link
Contributor

andrus commented Sep 7, 2014

Unit tests failures are still happening even after applying #10. However I was able to narrow it down to java 6 tests. Doesn't happen on Java 7.

@AlexKolonitsky
Copy link
Contributor Author

I've fixed tests

@andrus
Copy link
Contributor

andrus commented Sep 7, 2014

Applied. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants