You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2014/12/11 14:31:43 UTC
svn commit: r1644629 -
/isis/site/trunk/content/more-advanced-topics/Fixture-Scripts.md
Author: danhaywood
Date: Thu Dec 11 13:31:43 2014
New Revision: 1644629
URL: http://svn.apache.org/r1644629
Log:
fixture scripts
Modified:
isis/site/trunk/content/more-advanced-topics/Fixture-Scripts.md
Modified: isis/site/trunk/content/more-advanced-topics/Fixture-Scripts.md
URL: http://svn.apache.org/viewvc/isis/site/trunk/content/more-advanced-topics/Fixture-Scripts.md?rev=1644629&r1=1644628&r2=1644629&view=diff
==============================================================================
--- isis/site/trunk/content/more-advanced-topics/Fixture-Scripts.md (original)
+++ isis/site/trunk/content/more-advanced-topics/Fixture-Scripts.md Thu Dec 11 13:31:43 2014
@@ -481,3 +481,45 @@ as `executionContext.getParameter("owned
Similarly, if an integration test programmatically calls `setOwnedBy(...)` on this script, then again the value will be
set for the script and all child scripts.
+
+## Running a fixture script automatically on start up
+
+If working or prototyping a particular user story (running with an in-memory database) it can be useful to have the
+application automatically run a specific fixture script. There are several ways to accomplish this.
+
+### Using isis.properties
+
+First, the fixture script class name can be specified in `isis.properties` config file:
+
+ isis.fixtures=fixture.todo.scenarios.ToDoItemsRecreateForSven
+
+The app must also be started using the following system property:
+
+ -D isis.persistor.datanucleus.install-fixtures=true
+
+### On the command line, using --fixture
+
+Alternatively, the fixture class itself can be specified on the command line using the `--fixture` flag:
+
+ --fixture fixture.todo.scenarios.ToDoItemsRecreateForSven \
+ -D isis.persistor.datanucleus.install-fixtures=true
+
+### On the command line, using system properties
+
+A variation on this is to specify the fixture class using the following system properties:
+
+ -D isis.fixtures=fixture.todo.scenarios.ToDoItemsRecreateForSven \
+ -D isis.persistor.datanucleus.install-fixtures=true
+
+Note that the key is "isis.fixtures", not "isis.fixture".
+
+### Running the standalone jetty-console
+
+A final variation allows the app to be run as a standalone WAR using jetty-console (ie `xxx-jetty-console.war`). This
+is accomplished using the `--initParam` flag:
+
+ java -jar todoapp-jetty-console.war \
+ --initParam isis.fixtures=fixture.todo.scenarios.ToDoItemsRecreateForSven \
+ --initParam isis.persistor.datanucleus.install-fixtures=true
+
+In this case any initParam named "isis." wil be loaded into Isis' configuration.