Skip to main content
added 208 characters in body
Source Link
prusswan
  • 7.2k
  • 4
  • 44
  • 65

The recommendation in Junit in Action 2e is actually not to create too many datasets (like one per test class), but just enough that is considered maintainable. Except for a few exceptional cases, I found it possible to use a master dataset for most unit tests, and individual datasets for integration tests. Limiting the usage of ExpectedDataSets is also an option.

Also, I used Unitils in combination with dbunit to simplify some of the setup and loading of test data, so you might want to consider it where appropriate.

The recommendation in Junit in Action 2e is actually not to create too many datasets (like one per test class), but just enough that is considered maintainable. Except for a few exceptional cases, I found it possible to use a master dataset for most unit tests, and individual datasets for integration tests. Limiting the usage of ExpectedDataSets is also an option.

The recommendation in Junit in Action 2e is actually not to create too many datasets (like one per test class), but just enough that is considered maintainable. Except for a few exceptional cases, I found it possible to use a master dataset for most unit tests, and individual datasets for integration tests. Limiting the usage of ExpectedDataSets is also an option.

Also, I used Unitils in combination with dbunit to simplify some of the setup and loading of test data, so you might want to consider it where appropriate.

Source Link
prusswan
  • 7.2k
  • 4
  • 44
  • 65

The recommendation in Junit in Action 2e is actually not to create too many datasets (like one per test class), but just enough that is considered maintainable. Except for a few exceptional cases, I found it possible to use a master dataset for most unit tests, and individual datasets for integration tests. Limiting the usage of ExpectedDataSets is also an option.