- Revision
- 1250
- Author
- mauro
- Date
- 2009-09-16 19:11:13 -0500 (Wed, 16 Sep 2009)
Log Message
Tidying up of reference docs.
Modified Paths
- trunk/core/distribution/src/site/content/developing-scenarios.html
- trunk/core/distribution/src/site/content/getting-started.html
- trunk/core/distribution/src/site/content/running-scenarios.html
- trunk/core/distribution/src/site/resources/style/jbehave.css
Diff
Modified: trunk/core/distribution/src/site/content/developing-scenarios.html (1249 => 1250)
--- trunk/core/distribution/src/site/content/developing-scenarios.html 2009-09-16 23:51:42 UTC (rev 1249) +++ trunk/core/distribution/src/site/content/developing-scenarios.html 2009-09-17 00:11:13 UTC (rev 1250) @@ -11,7 +11,7 @@ <p>We encourage users to start from writing your scenarios in a non-Java format, e.g. in simple text: <textarea class="xml:nogutter:nocontrols" name="code"> - Given a stock of price 1.0 and a threshold of 10.0 + Given a stock of symbol STK1 and a threshold of 10.0 When the stock is traded at 5.0 Then the alert status should be OFF When the stock is traded at 11.0 @@ -22,16 +22,14 @@ <h2>Writing Java Scenarios</h2> -<p>The contract for a user-defined Java scenario is the following: -<ol> - <li>Must extend an instance of a <a - href="" - such as <a - href="" - </li> - <li>Must provide a default constructor and a constructor with a - ClassLoader parameter, e.g.: <textarea - class="java:nogutter:nocontrols" name="code"> +<p>The contract for a user-defined Java scenario is the following:</p> +<p>Must extend an instance of a <a + href="" +such as <a href="" +</p> +<p>Must provide a default constructor and a constructor with a +ClassLoader parameter, e.g.: <textarea class="java:nogutter:nocontrols" + name="code"> public class StatusAlertCanBeActivated extends JUnitScenario { public StatusAlertCanBeActivated() { @@ -48,17 +46,17 @@ } } -</textarea></li> - <li>Must inject an instance of <a - href="" - e.g.: <textarea class="java:nogutter:nocontrols" name="code"> +</textarea></p> +<p>Must inject an instance of <a + href="" +e.g.: <textarea class="java:nogutter:nocontrols" name="code"> public class TraderSteps extends Steps { private Stock stock; - @Given("a stock of price $price and a threshold of $threshold") - public void aStockOfPrice(double price, double threshold) { - stock = new Stock(price, threshold); + @Given("a stock of symbol $symbol and a threshold of $threshold") + public void aStock(String symbol, double threshold) { + stock = new Stock(symbol, threshold); } @When("the stock is traded at $price") @@ -72,8 +70,7 @@ } } -</textarea></li> -</ol> +</textarea></p> </p> <h2>Configuring Scenarios</h2> @@ -83,14 +80,12 @@ href="" is the main interface for configuring all the components of a scenario. JBehave provides two implementations: -<ul> - <li><a - href="" - provides default configuration that most user will find appropriate</li> - <li><a - href="" - overrides default configuration via system properties</li> -</ul> +<p><a + href="" +provides default configuration that most user will find appropriate</p> +<p><a + href="" +overrides default configuration via system properties</p> </p> <h2>Configuring Steps</h2> @@ -98,24 +93,21 @@ <p>Steps can also be configured to a high degree via the <a href="" Among the elements that can be configured are: -<ul> - <li><a - href="" - defaults to <a - href="" - <li><a - href="" - defaults to <a - href="" - useful to either debug the step matching or to describe the steps - being performed to some output</li> - <li><a - href="" - facade for collecting user-defined <a - href="" +<p><a + href="" +defaults to <a + href="" +<p><a + href="" +defaults to <a + href="" +useful to either debug the step matching or to describe the steps being +performed to some output</p> +<p><a + href="" +facade for collecting user-defined <a + href="" -</ul> - </p> <div class="clear"> <hr />
Modified: trunk/core/distribution/src/site/content/getting-started.html (1249 => 1250)
--- trunk/core/distribution/src/site/content/getting-started.html 2009-09-16 23:51:42 UTC (rev 1249) +++ trunk/core/distribution/src/site/content/getting-started.html 2009-09-17 00:11:13 UTC (rev 1250) @@ -8,17 +8,10 @@ <h2>Getting Started</h2> -<p>Our goal with JBehave was to make a framework that was -lightweight, easy to use and overcome some of the usability limitations -of JBehave 1. To that end, we've been driving this entirely from example -code - no guessing, unless it's obvious - and we've ended up with -something that works quite a lot like RSpec's story runner, but for -Java.</p> - -<p>To use it, simply name your scenario file with underscores, eg -i_can_toggle_a_cell (although the file name resolution is configurable) -and define steps in it: <textarea class="xml:nogutter:nocontrols" - name="code"> +<p>To start using JBehave, simply name your scenario file with +underscores, eg i_can_toggle_a_cell (although the file name resolution +is configurable) and define steps in it: <textarea + class="xml:nogutter:nocontrols" name="code"> Given a 5 by 5 game When I toggle the cell at (2, 3) Then the grid should look like @@ -42,27 +35,27 @@ ..... ..X.. </textarea> A few more elements are required: -<ul> - <li>Extend the <a - href="" - class with a similarly named Java class: <code>ICanToggleACell.java</code></li> - <li>Extend the <a - href="" - class - this is where your steps will be defined, and you can have - as many as you want</li> - <li>Inject these into the Scenario: <textarea - class="java:nogutter:nocontrols" name="code"> +<p>1. Extend the <a + href="" +class with a similarly named Java class: <code>ICanToggleACell.java</code> +</p> + +<p>2. Extend the <a + href="" +class - this is where your steps will be defined, and you can have as +many as you want. Associate the Steps with the Scenario: <textarea + class="java:nogutter:nocontrols" name="code"> public class ICanToggleACell extends Scenario { public ICanToggleACell() { super(new GridSteps()); // varargs, can have lots of steps } } - </textarea></li> - <li><a - href="" - methods in your step class to match the ones in your plain text - scenario. <textarea class="java:nogutter:nocontrols" name="code"> + </textarea></p> +<p>3. <a + href="" +methods in your step class to match the ones in your plain text +scenario. <textarea class="java:nogutter:nocontrols" name="code"> public class GridSteps extends Steps { private Game game; @@ -86,19 +79,11 @@ } } - </textarea></li> - <li>Run your new scenario as JUnit test.</li> - <li>Check out the working <a - href="" - in the source repository.</li> -</ul> + </textarea></p> +<p>Run your new scenario as JUnit test.</p> +<p>Check out the working <a + href="" +in the source repository.</p> -<p>Future features we're thinking of: -<ul> - <li>tagging scenarios</li> - <li>better tolerance of whitespace</li> - <li>anything you persuade us you need.</li> -</ul> -</p> </body> </html> \ No newline at end of file
Modified: trunk/core/distribution/src/site/content/running-scenarios.html (1249 => 1250)
--- trunk/core/distribution/src/site/content/running-scenarios.html 2009-09-16 23:51:42 UTC (rev 1249) +++ trunk/core/distribution/src/site/content/running-scenarios.html 2009-09-17 00:11:13 UTC (rev 1250) @@ -9,7 +9,7 @@ <h2>Running Scenarios</h2> <p>JBehave was designed to be embeddable in different development -environments. The <code>jbehave-core</code> contains support for running +environments. The JBehave Core module contains support for running scenarios as JUnit tests - which can be run either in your favourite IDE or in your command-line build that supports JUnit tests.</p> @@ -32,7 +32,7 @@ scenarioIncludes="org/jbehave/examples/trader/scenarios/*.java" scenarioExcludes="**/*Steps.java" /> -</textarea> Remember that you need to include <code>jbehave-ant</code> to your +</textarea> Remember that you need to include <b>jbehave-ant</b> to your runtime classpath.</p> <h2>Running as Maven Plugin</h2>
Modified: trunk/core/distribution/src/site/resources/style/jbehave.css (1249 => 1250)
--- trunk/core/distribution/src/site/resources/style/jbehave.css 2009-09-16 23:51:42 UTC (rev 1249) +++ trunk/core/distribution/src/site/resources/style/jbehave.css 2009-09-17 00:11:13 UTC (rev 1250) @@ -94,6 +94,7 @@ a:link { color: #39912b; + font-weight: bold; } a:visited {
To unsubscribe from this list please visit:
