Tired of writing code to set up test data? Fixjures provide a way to instantiate java objects from external, terse, human-readable (and more importantly human-_writable_) text files. YAML and JSON are supported out of the box.
If you"re interested in the old 1.x line (legacy, but supports Java 1.5), check the OldHome.
2.0 introduces YAML support which, IMFO, is a much cleaner and easier way to quickly draft up some dummy objects for tests.
accounts.yaml
- id: 1 name: Test Account 1 description: Test Account Description type: Personal contacts: - name: Joe Contact email: joe@somewhere.com - name: Jane Contact email: jane@somewhere.com- id: 2 name: Test Account 2 description: etc, etc...
AccountWidgetTest.java
List
testAccounts = Fixjure.listOf(Account.class) .from(YamlSource.newYamlResource("accounts.yaml")) .create();