- Revision
- 985
- Author
- mauro
- Date
- 2008-10-25 06:35:56 -0500 (Sat, 25 Oct 2008)
Log Message
JBEHAVE-143: Updated and enhanced documentation for 2.1 release.
Modified Paths
- trunk/distribution/pom.xml
- trunk/distribution/src/site/content/download.html
- trunk/distribution/src/site/content/getting-started.html
- trunk/distribution/src/site/content/index.html
- trunk/distribution/src/site/content/license.html
- trunk/distribution/src/site/content/release-notes.html
- trunk/distribution/src/site/content/sitemap.xml
- trunk/distribution/src/site/content/team-list.html
Added Paths
Diff
Modified: trunk/distribution/pom.xml (984 => 985)
--- trunk/distribution/pom.xml 2008-10-24 21:14:09 UTC (rev 984) +++ trunk/distribution/pom.xml 2008-10-25 11:35:56 UTC (rev 985) @@ -1,4 +1,5 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.jbehave</groupId> @@ -66,6 +67,26 @@ </configuration> </execution> <execution> + <id>unpack-javadoc-ant</id> + <phase>install</phase> + <goals> + <goal>unpack</goal> + </goals> + <configuration> + <outputDirectory>${project.build.directory}/site/javadoc/ant</outputDirectory> + <overWriteReleases>false</overWriteReleases> + <overWriteSnapshots>true</overWriteSnapshots> + <artifactItems> + <artifactItem> + <groupId>${pom.groupId}</groupId> + <artifactId>jbehave-ant</artifactId> + <version>${pom.version}</version> + <classifier>javadoc</classifier> + </artifactItem> + </artifactItems> + </configuration> + </execution> + <execution> <id>unpack-javadoc-maven-plugin</id> <phase>install</phase> <goals>
Added: trunk/distribution/src/site/content/developing-scenarios.html (0 => 985)
--- trunk/distribution/src/site/content/developing-scenarios.html (rev 0) +++ trunk/distribution/src/site/content/developing-scenarios.html 2008-10-25 11:35:56 UTC (rev 985) @@ -0,0 +1,125 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html> +<head> +<title>Developing Scenarios</title> +</head> + +<body> + +<h2>Writing Text Scenarios</h2> + +<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 + When the stock is traded at 5.0 + Then the alert status should be OFF + When the stock is traded at 11.0 + Then the alert status should be ON +</textarea> and to give a name that is expressive, i.e. <code>status_alert_can_be_activated.scenario</code>. +This scenario will map to a Java file <code>StatusAlertCanBeActivated.java</code> +in same package.</p> + +<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"> + public class StatusAlertCanBeActivated extends JUnitScenario { + + public StatusAlertCanBeActivated() { + this(Thread.currentThread().getContextClassLoader()); + } + + public StatusAlertCanBeActivated(final ClassLoader classLoader) { + super(new MostUsefulConfiguration() { + public ScenarioDefiner forDefiningScenarios() { + return new ClasspathScenarioDefiner(new UnderscoredCamelCaseResolver(".scenario"), + new PatternScenarioParser(new PropertyBasedConfiguration()), classLoader); + } + }, new TraderSteps()); + } + +} +</textarea></li> + <li>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); + } + + @When("the stock is traded at $price") + public void theStockIsTradedAt(double price) { + stock.tradeAt(price); + } + + @Then("the alert status should be $status") + public void theAlertStatusShouldBe(String status) { + ensureThat(stock.getStatus().name(), equalTo(status)); + } + +} +</textarea></li> +</ol> +</p> + +<h2>Configuring Scenarios</h2> + +<p>JBehave was designed to be highly configurable but to provide +default behaviour for the most useful configuration. <a + 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> + +<h2>Configuring Steps</h2> + +<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="" + +</ul> + +</p> +<div class="clear"> +<hr /> +</div> + +</body> +</html> Property changes on: trunk/distribution/src/site/content/developing-scenarios.html ___________________________________________________________________ Name: svn:mergeinfo +
Modified: trunk/distribution/src/site/content/download.html (984 => 985)
--- trunk/distribution/src/site/content/download.html 2008-10-24 21:14:09 UTC (rev 984) +++ trunk/distribution/src/site/content/download.html 2008-10-25 11:35:56 UTC (rev 985) @@ -8,69 +8,47 @@ <h2>Stable releases</h2> -<p>The stable releases of jBehave can be found on the <a href="" Repository</a>: - <ul> - <li><a href="" bin distribution</a> (xx Aug 2008)</li> - <li><a href="" src distribution</a> (xx Aug 2008)</li> - </ul> +<p>The stable releases of jBehave can be found on the <a + href="" +Repository</a>: +<ul> + <li><a + href="" + bin distribution</a></li> + <li><a + href="" + src distribution</a></li> +</ul> </p> <h2 id="snapshot">Latest Snapshot</h2> -<p>The snapshot builds of jBehave can be found on the <a - href="" Snapshots Repository</a>. - Be sure to choose the snapshot with the latest 2.x version and the filename with the latest timestamp.</p> +<p>The snapshot builds of JBehave can be found on the <a + href="" +Snapshots Repository</a>. Be sure to choose the snapshot with the latest 2.x +version and the filename with the latest timestamp.</p> <h2 id="maven">Using Maven Artifacts</h2> -<p>If you use Maven as the build system (or one that is compatible with the Maven Repository, such as Ivy), you can -declare jBehave dependency as <textarea class="xml:nogutter:nocontrols" name="code"> +<p>If you use Maven as the build system (or one that is compatible +with the Maven Repository, such as Ivy), you can declare JBehave +dependency as <textarea class="xml:nogutter:nocontrols" name="code"> <dependency> <groupId>org.jbehave</groupId> <artifactId>jbehave-core</artifactId> <version>[version]</version> </dependency> - </textarea> specifying the correct version.</p> +</textarea> specifying the correct version.</p> -<p>You can also run scenarios using the jBehave Maven Plugin: -<textarea class="xml:nogutter:nocontrols" name="code"> - <plugin> - <groupId>org.jbehave</groupId> - <artifactId>jbehave-maven-plugin</artifactId> - <version>[version]</version> - <executions> - <execution> - <id>run-scenarios-listed</id> - <phase>integration-test</phase> - <configuration> - <scenarioClassNames> - <scenarioClassName>org.jbehave.examples.trader.scenarios.StatusAlertCanBeActivated</scenarioClassName> - <scenarioClassName>org.jbehave.examples.trader.scenarios.StatusAlertIsNeverActivated</scenarioClassName> - </scenarioClassNames> - </configuration> - <goals> - <goal>run-scenarios</goal> - </goals> - </execution> - <execution> - <id>run-scenarios-found</id> - <phase>integration-test</phase> - <configuration> - <scenarioIncludes> - <scenarioInclude>org/jbehave/examples/trader/scenarios/*.java</scenarioInclude> - </scenarioIncludes> - <scenarioExcludes> - <scenarioExclude>**/*Steps.java</scenarioExclude> - </scenarioExcludes> - </configuration> - <goals> - <goal>run-scenarios</goal> - </goals> - </execution> - </executions> - </plugin> -</textarea> specifying the correct [version].</p> +<p>JBehave was designed to be embeddable in different development +environments. The jbehave-core 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> +<p>You can also run scenarios using the JBehave Ant or Maven +extensions. In this case, an extra dependency needs to be declared, <code>jbehave-ant</code> +or <code>jbehave-maven-plugin</code>, as appropriate. Refer to <a href="" scenarios</a>. + <div class="clear"> <hr /> </div>
Modified: trunk/distribution/src/site/content/getting-started.html (984 => 985)
--- trunk/distribution/src/site/content/getting-started.html 2008-10-24 21:14:09 UTC (rev 984) +++ trunk/distribution/src/site/content/getting-started.html 2008-10-25 11:35:56 UTC (rev 985) @@ -5,13 +5,20 @@ </head> <body> -<p>Our goal with jBehave 2 was to make a framework that was lightweight, easy to use and didn't take as long to set -up as 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"> +<h2>Getting Started</h2> + +<p>Our goal with JBehave 2 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"> Given a 5 by 5 game When I toggle the cell at (2, 3) Then the grid should look like @@ -34,23 +41,28 @@ ..... ..... ..X.. -</textarea> -A few more elements are required: +</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"> + <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"> 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></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"> public class GridSteps extends Steps { private Game game; @@ -74,18 +86,19 @@ } } - </textarea> - </li> - <li>Run your new scenario as JUnit 4 test.</li> - <li>Check out the working <a href="" in the source repository.</li> + </textarea></li> + <li>Run your new scenario as JUnit test.</li> + <li>Check out the working <a + href="" + in the source repository.</li> </ul> <p>Future features we're thinking of: <ul> - <li>tagging scenarios</li> - <li>better tolerance of whitespace</li> - <li>an option for pending steps to break the build</li> - <li>anything you persuade us you need.</li> + <li>tagging scenarios</li> + <li>better tolerance of whitespace</li> + <li>an option for pending steps to break the build</li> + <li>anything you persuade us you need.</li> </ul> </p> </body>
Modified: trunk/distribution/src/site/content/index.html (984 => 985)
--- trunk/distribution/src/site/content/index.html 2008-10-24 21:14:09 UTC (rev 984) +++ trunk/distribution/src/site/content/index.html 2008-10-25 11:35:56 UTC (rev 985) @@ -1,32 +1,46 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> -<title>jBehave</title> +<title>JBehave</title> </head> <body> -<p>jBehave is a framework for <a href="" -Development</a> (BDD). BDD is an evolution of test-driven development (TDD) and acceptance-test driven design, and is -intended to make these practices more accessible and intuitive to newcomers and experts alike. It shifts the vocabulary -from being test-based to behaviour-based, and positions itself as a design philosophy.</p> +<p>JBehave is a framework for <a + href="" +Development</a> (BDD). BDD is an evolution of test-driven development (TDD) +and acceptance-test driven design, and is intended to make these +practices more accessible and intuitive to newcomers and experts alike. +It shifts the vocabulary from being test-based to behaviour-based, and +positions itself as a design philosophy.</p> -<p>You can find out more about behaviour-driven development on <a href="" -Newcomers are encouraged to start from <a href="" BDD</a>.</p> +<p>You can find out more about behaviour-driven development on <a + href="" +Newcomers are encouraged to start from <a + href="" BDD</a>.</p> -<p>Features of jBehave 2 include: +<p>Features of JBehave 2 include: <ul> - <li>Scenario runner - runs executable scenarios using text-based input, with auto-conversion of string arguments - to any parameter type (including generic types) via custom parameter converters.</li> - <li>Scenario steps defined using Java 5 annotations that match the scenarios</li> - <li>Scenario reporter - outputs scenarios executed in human-readable form</li> - <li>Scenario can be run as JUnit 4 tests, providing easy integration with your favourite IDE</li> - <li>Auto-generation of pending steps so the build is not broken by a missing step</li> - <li>Maven integration Ð allows scenarios to be run at integration-test build phase</li> + <li>Scenario runner - runs executable scenarios using + text-based input, with auto-conversion of string arguments to any + parameter type (including generic types) via custom parameter + converters.</li> + <li>Scenario steps defined using Java 5 annotations that match + the scenarios</li> + <li>Scenario reporter - outputs scenarios executed in + human-readable form</li> + <li>Scenario can be run as JUnit tests, providing easy + integration with your favourite IDE</li> + <li>Auto-generation of pending steps so the build is not broken + by a missing step</li> + <li>Ant integration: allows scenarios to be run via Ant task</li> + <li>Maven integration: allows scenarios to be run via Maven + plugin at given build phase</li> </ul> </p> -<p>This documentation is primarily to help users <a href="" started</a> and for -reference, containing the javadoc and the project information. More updated information can be found in <a - href="" website</a>.</p> +<p>This documentation is primarily to help users <a + href="" started</a> and as a reference development guide +for each release, containing the javadoc and the project information. More information can +be found in <a href="" website</a>.</p> </body> </html> \ No newline at end of file
Modified: trunk/distribution/src/site/content/license.html (984 => 985)
--- trunk/distribution/src/site/content/license.html 2008-10-24 21:14:09 UTC (rev 984) +++ trunk/distribution/src/site/content/license.html 2008-10-25 11:35:56 UTC (rev 985) @@ -10,9 +10,9 @@ <p>Typically the licenses listed for the project are that of the project itself, and not of dependencies.</p> -<h2>jBehave License</h2> +<h2>JBehave License</h2> -<p>jBehave is released under a BSD-style license: +<p>JBehave is released under a BSD-style license: <pre> Copyright (c) 2003-2008 jbehave.org
Modified: trunk/distribution/src/site/content/release-notes.html (984 => 985)
--- trunk/distribution/src/site/content/release-notes.html 2008-10-24 21:14:09 UTC (rev 984) +++ trunk/distribution/src/site/content/release-notes.html 2008-10-25 11:35:56 UTC (rev 985) @@ -5,6 +5,72 @@ </head> <body> +<h1>JBehave - Version 2.1 (Oct 26, 2008)</h1> + +<h2> Bug +</h2> +<ul> +<li>[<a href="" - Scenario class lookup fails on Windows +</li> +<li>[<a href="" - Bug recognising Step with content starting with Given, When, Then, And +</li> +</ul> + +<h2> Improvement +</h2> +<ul> +<li>[<a href="" - Support multiple test frameworks +</li> +<li>[<a href="" - Extract CandidateSteps interface +</li> +<li>[<a href="" - Make default converter classes publicly accessible and allow configuration of number format +</li> +</ul> + +<h2> New Feature +</h2> +<ul> +<li>[<a href="" - @BeforeScenario and @AfterScenario +</li> +<li>[<a href="" - Add Ant task integration +</li> +</ul> + +<h2> Task +</h2> +<ul> +<li>[<a href="" - Improve documentation for scenario developers +</li> +</ul> + +<h2> Wish +</h2> +<ul> +<li>[<a href="" - new StepMonitor method - executingStep(..) +</li> +<li>[<a href="" - StepsConfiguration - can it have a setMonitor(..) method please +</li> +<li>[<a href="" - RunnableScenario.addSteps(CandidateSteps) -> method needed +</li> +</ul> + + +<h1>JBehave - Version 2.0.1 (Oct 7, 2008)</h1> + +<h2> Bug +</h2> +<ul> +<li>[<a href="" - Scenario class lookup fails on Windows +</li> +</ul> + +<h2> Improvement +</h2> +<ul> +<li>[<a href="" - Make default converter classes publicly accessible and allow configuration of number format +</li> +</ul> + <h1>JBehave - Version 2.0 (Sep 1, 2008)</h1> <h2> Bug
Added: trunk/distribution/src/site/content/running-scenarios.html (0 => 985)
--- trunk/distribution/src/site/content/running-scenarios.html (rev 0) +++ trunk/distribution/src/site/content/running-scenarios.html 2008-10-25 11:35:56 UTC (rev 985) @@ -0,0 +1,84 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html> +<head> +<title>Running Scenarios</title> +</head> + +<body> + +<h2>Running Scenarios</h2> + +<p>JBehave was designed to be embeddable in different development +environments. The <code>jbehave-core</code> 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> + +<p>You can also run scenarios using the JBehave Ant or Maven +extensions. Both support two way to lookup scenarios, by list of +scenario classes or by Java path includes/excludes pattern. Below are +examples on how to configure both extensions - using the trader example.</p> + +<h2>Running as Ant task</h2> + +<p><textarea class="xml:nogutter:nocontrols" name="code"> + <taskdef name="scenarioRunner" + classname="org.jbehave.ant.ScenarioRunnerTask" + classpathref="your.runtime.classpath" /> + + <scenarioRunner + scenarioClassNames="org.jbehave.examples.trader.scenarios.StatusAlertCanBeActivated,org.jbehave.examples.trader.scenarios.StatusAlertCanBeActivated" /> + + <scenarioRunner + scenarioIncludes="org/jbehave/examples/trader/scenarios/*.java" + scenarioExcludes="**/*Steps.java" /> + +</textarea> Remember that you need to include <code>jbehave-ant</code> to your +runtime classpath.</p> + +<h2>Running as Maven Plugin</h2> + +<textarea class="xml:nogutter:nocontrols" name="code"> + <plugin> + <groupId>org.jbehave</groupId> + <artifactId>jbehave-maven-plugin</artifactId> + <version>[version]</version> + <executions> + <execution> + <id>run-scenarios-listed</id> + <phase>integration-test</phase> + <configuration> + <scenarioClassNames> + <scenarioClassName>org.jbehave.examples.trader.scenarios.StatusAlertCanBeActivated</scenarioClassName> + <scenarioClassName>org.jbehave.examples.trader.scenarios.StatusAlertIsNeverActivated</scenarioClassName> + </scenarioClassNames> + </configuration> + <goals> + <goal>run-scenarios</goal> + </goals> + </execution> + <execution> + <id>run-scenarios-found</id> + <phase>integration-test</phase> + <configuration> + <scenarioIncludes> + <scenarioInclude>org/jbehave/examples/trader/scenarios/*.java</scenarioInclude> + </scenarioIncludes> + <scenarioExcludes> + <scenarioExclude>**/*Steps.java</scenarioExclude> + </scenarioExcludes> + </configuration> + <goals> + <goal>run-scenarios</goal> + </goals> + </execution> + </executions> + </plugin> +</textarea> +</p> + +<div class="clear"> +<hr /> +</div> + +</body> +</html>
Modified: trunk/distribution/src/site/content/sitemap.xml (984 => 985)
--- trunk/distribution/src/site/content/sitemap.xml 2008-10-24 21:14:09 UTC (rev 984) +++ trunk/distribution/src/site/content/sitemap.xml 2008-10-25 11:35:56 UTC (rev 985) @@ -1,22 +1,25 @@ <sitemap> <section> - <name>About jBehave</name> + <name>About JBehave</name> <page>index.html</page> - <page>getting-started.html</page> <page>license.html</page> <page>download.html</page> + <link title="Issue Tracking">http://jira.codehaus.org/browse/JBEHAVE</link> <page>release-notes.html</page> - </section> - <section> - <name>Project Info</name> <page>mailing-lists.html</page> <page>team-list.html</page> <page>source-repository.html</page> - <link title="Issue Tracking">http://jira.codehaus.org/browse/JBEHAVE</link> </section> + <section> + <name>Using JBehave</name> + <page>getting-started.html</page> + <page>running-scenarios.html</page> + <page>developing-scenarios.html</page> + </section> <section> <name>JavaDoc</name> <link title="Core">javadoc/core/index.html</link> + <link title="Ant">javadoc/ant/index.html</link> <link title="Maven Plugin">javadoc/maven-plugin/index.html</link> </section> </sitemap> \ No newline at end of file
Modified: trunk/distribution/src/site/content/team-list.html (984 => 985)
--- trunk/distribution/src/site/content/team-list.html 2008-10-24 21:14:09 UTC (rev 984) +++ trunk/distribution/src/site/content/team-list.html 2008-10-25 11:35:56 UTC (rev 985) @@ -51,10 +51,13 @@ </tr> </table> <h3>Contributors</h3> -<table class="bodyTable" width="100%"> +<table class="bodyTable"> <tr class="a"> <th>Name</th> </tr> + <tr class="b"> + <td>Paul Hammant</td> + </tr> </table> <script type="text/_javascript_"> function offsetDate(id, offset) {
To unsubscribe from this list please visit:
