Hi, I have been using Maven2 and JBehave trying to work on a simple example calculator project. I tried to run through 3 scenarios. Everything works fine if all the scenario results matches. However when the results doesn't match, during test phase (mvn test) the scenario runs until it reaches a scenario that fails and the process stops. Say for example I have 3 scenarios, CalculatorSpecs, MultiplyIntegersSpecs, SubtractIntegersSpecs, if MultiplyIntegersSpecs fail it will give me a build error and stops without running SubtractIntegersSpecs. I want to know how to make it run through all of the scenarios and tell me which ones failed.
Note: I am trying to set up and pom.xml so that it works as I expect. I am not using an IDE to run the behavioral tests. The multiply scenario has been deliberately made so that it gives an error. >>>>console error<<<< [INFO] Nothing to compile - all classes are up to date [INFO] [surefire:test] [INFO] No tests to run. [INFO] [jbehave:run-scenarios {execution: run-scenarios-found}] [INFO] Running scenario CalculatorExample.spec.CalculatorSpecs [INFO] Running scenario CalculatorExample.spec.MultiplyIntegersSpecs Scenario: MultiplyIntegersSpec Given I have two integers 5 and 2 When I want to multiply 5 and 2 together Then the TOTAL should be 12 (FAILED) [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Failed to run scenario CalculatorExample.spec.MultiplyIntegersSpecs Embedded error: Expected: <12> got: <10> [INFO] ------------------------------------------------------------------------ [INFO] For more information, run Maven with the -e switch [INFO] ------------------------------------------------------------------------ [INFO] Total time: 3 seconds [INFO] Finished at: Tue Jan 20 09:16:11 EST 2009 [INFO] Final Memory: 10M/18M [INFO] ------------------------------------------------------------------------ >>>>Inside pom.xml (plugin for jbehave)<<<< <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> </plugin> <plugin> <groupId>org.jbehave</groupId> <artifactId>jbehave-maven-plugin</artifactId> <executions> <execution> <id>run-scenarios-found</id> <phase>test</phase> <configuration> <scenarioIncludes> <scenarioInclude>CalculatorExample/spec/*.java</scenarioInclude> </scenarioIncludes> <scenarioExcludes> <scenarioExclude>**/*Steps.java</scenarioExclude> </scenarioExcludes> </configuration> <goals> <goal>run-scenarios</goal> </goals> </execution> </executions> </plugin> File structure: Src ->CalculatorExample -> code (contain the source file) Src ->CalculatorExample -> spec (contain the scenario files) Thanks, Laura --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email