Skip to content
jtessler edited this page Feb 24, 2012 · 6 revisions

This process allows you to update the conf/initial-data.yml or create new test data using the current state of the application. This allows you to run Openbook, make some changes, and then save the new state to a human-readable YAML file.

Setup

Option 1: Install module to your system's Play! directory

  1. Install the module to your Play! framework: play install logisimayml-1.8
  2. Update your local dependencies: play dependencies

Option 2: Install module to your local Openbook directory

  1. Run play dependencies to download and install the module locally.

How to generate new YAML

  1. Setup FS database in conf/application.conf: db=fs (this module does not work with the in-memory database)
  • Start Play!: play run
  • Log in, make edits, etc.
  • Once you're ready to save the current OpenBook state, close Play.
  • Generate the new YAML file: play yml:generate (saves to conf/data.yml)
  • Convert back to the in-memory database in conf/application.conf: db=mem
  • Delete the FS database created in step (4): rm -r db/
  • Use the new YAML file as the initial data: mv conf/data.yml conf/initial-data.yml
  • Check in the changes to GitHub.

Alternative: Use the generated YAML file as test data

  1. Save the new YAML file as initial test data: mv conf/data.yml test/foo_test.yml
  • Begin the new test with the line: Fixtures.loadModels("foo_test.yml");

Sources