You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by bu...@apache.org on 2014/12/11 14:31:50 UTC

svn commit: r932295 - in /websites/staging/isis/trunk: cgi-bin/ content/ content/more-advanced-topics/Fixture-Scripts.html

Author: buildbot
Date: Thu Dec 11 13:31:50 2014
New Revision: 932295

Log:
Staging update by buildbot for isis

Modified:
    websites/staging/isis/trunk/cgi-bin/   (props changed)
    websites/staging/isis/trunk/content/   (props changed)
    websites/staging/isis/trunk/content/more-advanced-topics/Fixture-Scripts.html

Propchange: websites/staging/isis/trunk/cgi-bin/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Thu Dec 11 13:31:50 2014
@@ -1 +1 @@
-1644624
+1644629

Propchange: websites/staging/isis/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Thu Dec 11 13:31:50 2014
@@ -1 +1 @@
-1644624
+1644629

Modified: websites/staging/isis/trunk/content/more-advanced-topics/Fixture-Scripts.html
==============================================================================
--- websites/staging/isis/trunk/content/more-advanced-topics/Fixture-Scripts.html (original)
+++ websites/staging/isis/trunk/content/more-advanced-topics/Fixture-Scripts.html Thu Dec 11 13:31:50 2014
@@ -926,6 +926,53 @@ as `executionContext.getParameter("owned
 <p>Similarly, if an integration test programmatically calls <code>setOwnedBy(...)</code> on this script, then again the value will be
 set for the script and all child scripts.</p>
 
+<h2>Running a fixture script automatically on start up</h2>
+
+<p>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.</p>
+
+<h3>Using isis.properties</h3>
+
+<p>First, the fixture script class name can be specified in <code>isis.properties</code> config file:</p>
+
+<pre><code>isis.fixtures=fixture.todo.scenarios.ToDoItemsRecreateForSven
+</code></pre>
+
+<p>The app must also be started using the following system property:</p>
+
+<pre><code>-D isis.persistor.datanucleus.install-fixtures=true
+</code></pre>
+
+<h3>On the command line, using --fixture</h3>
+
+<p>Alternatively, the fixture class itself can be specified on the command line using the <code>--fixture</code> flag:</p>
+
+<pre><code>--fixture fixture.todo.scenarios.ToDoItemsRecreateForSven \
+-D isis.persistor.datanucleus.install-fixtures=true
+</code></pre>
+
+<h3>On the command line, using system properties</h3>
+
+<p>A variation on this is to specify the fixture class using the following system properties:</p>
+
+<pre><code>-D isis.fixtures=fixture.todo.scenarios.ToDoItemsRecreateForSven \
+-D isis.persistor.datanucleus.install-fixtures=true
+</code></pre>
+
+<p>Note that the key is "isis.fixtures", not "isis.fixture".</p>
+
+<h3>Running the standalone jetty-console</h3>
+
+<p>A final variation allows the app to be run as a standalone WAR using jetty-console (ie <code>xxx-jetty-console.war</code>).  This
+is accomplished using the <code>--initParam</code> flag:</p>
+
+<pre><code>java -jar todoapp-jetty-console.war \
+    --initParam isis.fixtures=fixture.todo.scenarios.ToDoItemsRecreateForSven \
+    --initParam isis.persistor.datanucleus.install-fixtures=true
+</code></pre>
+
+<p>In this case any initParam named "isis." wil be loaded into Isis' configuration.</p>
+
 
 
       </div>