- Revision
- 1021
- Author
- mauro
- Date
- 2009-01-24 12:46:36 -0600 (Sat, 24 Jan 2009)
Log Message
JBEHAVE-155: Reverted to keeping references to compile and test classpath elements. Added trader-test-scope example to prove scenarios can be run in test scope.
Modified Paths
- branches/jbehave-2.1.x/examples/gameoflife/pom.xml
- branches/jbehave-2.1.x/examples/gameoflife/scenarios/pom.xml
- branches/jbehave-2.1.x/examples/noughtsandcrosses/pom.xml
- branches/jbehave-2.1.x/examples/noughtsandcrosses/scenarios/pom.xml
- branches/jbehave-2.1.x/examples/pom.xml
- branches/jbehave-2.1.x/examples/trader/pom.xml
- branches/jbehave-2.1.x/jbehave-maven-plugin/src/main/java/org/jbehave/mojo/AbstractScenarioMojo.java
Added Paths
- branches/jbehave-2.1.x/examples/trader-test-scope/
- branches/jbehave-2.1.x/examples/trader-test-scope/pom.xml
Diff
Modified: branches/jbehave-2.1.x/examples/gameoflife/pom.xml (1020 => 1021)
--- branches/jbehave-2.1.x/examples/gameoflife/pom.xml 2008-12-26 18:18:57 UTC (rev 1020) +++ branches/jbehave-2.1.x/examples/gameoflife/pom.xml 2009-01-24 18:46:36 UTC (rev 1021) @@ -4,7 +4,7 @@ <parent> <groupId>org.jbehave</groupId> <artifactId>jbehave-examples</artifactId> - <version>2.1-SNAPSHOT</version> + <version>2.1.1-SNAPSHOT</version> </parent> <artifactId>jbehave-gameoflife-example</artifactId> <name>JBehave Game of Life Example</name>
Modified: branches/jbehave-2.1.x/examples/gameoflife/scenarios/pom.xml (1020 => 1021)
--- branches/jbehave-2.1.x/examples/gameoflife/scenarios/pom.xml 2008-12-26 18:18:57 UTC (rev 1020) +++ branches/jbehave-2.1.x/examples/gameoflife/scenarios/pom.xml 2009-01-24 18:46:36 UTC (rev 1021) @@ -4,7 +4,7 @@ <parent> <groupId>org.jbehave</groupId> <artifactId>jbehave-examples</artifactId> - <version>2.1-SNAPSHOT</version> + <version>2.1.1-SNAPSHOT</version> </parent> <artifactId>jbehave-gameoflife-example-scenarios</artifactId> <name>JBehave Game of Life Example Scenarios</name>
Modified: branches/jbehave-2.1.x/examples/noughtsandcrosses/pom.xml (1020 => 1021)
--- branches/jbehave-2.1.x/examples/noughtsandcrosses/pom.xml 2008-12-26 18:18:57 UTC (rev 1020) +++ branches/jbehave-2.1.x/examples/noughtsandcrosses/pom.xml 2009-01-24 18:46:36 UTC (rev 1021) @@ -4,7 +4,7 @@ <parent> <groupId>org.jbehave</groupId> <artifactId>jbehave-examples</artifactId> - <version>2.1-SNAPSHOT</version> + <version>2.1.1-SNAPSHOT</version> </parent> <artifactId>jbehave-noughtsandcrosses-example</artifactId> <name>JBehave Noughts And Crosses Example</name>
Modified: branches/jbehave-2.1.x/examples/noughtsandcrosses/scenarios/pom.xml (1020 => 1021)
--- branches/jbehave-2.1.x/examples/noughtsandcrosses/scenarios/pom.xml 2008-12-26 18:18:57 UTC (rev 1020) +++ branches/jbehave-2.1.x/examples/noughtsandcrosses/scenarios/pom.xml 2009-01-24 18:46:36 UTC (rev 1021) @@ -4,7 +4,7 @@ <parent> <groupId>org.jbehave</groupId> <artifactId>jbehave-examples</artifactId> - <version>2.1-SNAPSHOT</version> + <version>2.1.1-SNAPSHOT</version> </parent> <artifactId>jbehave-noughtsandcrosses-example-scenarios</artifactId> <name>JBehave Noughts And Crosses Example Scenarios</name>
Modified: branches/jbehave-2.1.x/examples/pom.xml (1020 => 1021)
--- branches/jbehave-2.1.x/examples/pom.xml 2008-12-26 18:18:57 UTC (rev 1020) +++ branches/jbehave-2.1.x/examples/pom.xml 2009-01-24 18:46:36 UTC (rev 1021) @@ -4,7 +4,7 @@ <parent> <groupId>org.jbehave</groupId> <artifactId>jbehave</artifactId> - <version>2.1-SNAPSHOT</version> + <version>2.1.1-SNAPSHOT</version> </parent> <artifactId>jbehave-examples</artifactId> <packaging>pom</packaging> @@ -16,6 +16,7 @@ <module>noughtsandcrosses</module> <module>noughtsandcrosses/scenarios</module> <module>trader</module> + <module>trader-test-scope</module> </modules> <dependencies>
Modified: branches/jbehave-2.1.x/examples/trader/pom.xml (1020 => 1021)
--- branches/jbehave-2.1.x/examples/trader/pom.xml 2008-12-26 18:18:57 UTC (rev 1020) +++ branches/jbehave-2.1.x/examples/trader/pom.xml 2009-01-24 18:46:36 UTC (rev 1021) @@ -4,7 +4,7 @@ <parent> <groupId>org.jbehave</groupId> <artifactId>jbehave-examples</artifactId> - <version>2.1-SNAPSHOT</version> + <version>2.1.1-SNAPSHOT</version> </parent> <artifactId>jbehave-trader-example</artifactId> <name>JBehave Trader Example</name>
Property changes: branches/jbehave-2.1.x/examples/trader-test-scope
Name: svn:ignore
+ target
Added: branches/jbehave-2.1.x/examples/trader-test-scope/pom.xml (0 => 1021)
--- branches/jbehave-2.1.x/examples/trader-test-scope/pom.xml (rev 0) +++ branches/jbehave-2.1.x/examples/trader-test-scope/pom.xml 2009-01-24 18:46:36 UTC (rev 1021) @@ -0,0 +1,63 @@ +<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> + <artifactId>jbehave-examples</artifactId> + <version>2.1.1-SNAPSHOT</version> + </parent> + <artifactId>jbehave-trader-test-scope-example</artifactId> + <name>JBehave Trader Test Scope Example</name> + + <build> + <!-- JBEHAVE-155: we want to prove that we can run scenarios in test scope --> + <testSourceDirectory>${basedir}/../trader/src/main/java</testSourceDirectory> + <plugins> + <plugin> + <groupId>org.jbehave</groupId> + <artifactId>jbehave-maven-plugin</artifactId> + <version>${pom.version}</version> + <executions> + <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> + <skip>false</skip> + <scope>test</scope> + </configuration> + <goals> + <goal>run-scenarios</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-antrun-plugin</artifactId> + <executions> + <execution> + <id>run-scenarios-via-ant</id> + <phase>integration-test</phase> + <configuration> + <tasks> + <taskdef name="scenarioRunner" classname="org.jbehave.ant.ScenarioRunnerTask" classpathref="maven.runtime.classpath" /> + <scenarioRunner scenarioIncludes="org/jbehave/examples/trader/scenarios/*.java" + scenarioExcludes="**/*Steps.java" skip="false" scope="test" /> + </tasks> + </configuration> + <goals> + <goal>run</goal> + </goals> + </execution> + </executions> + </plugin> + + </plugins> + </build> +</project> \ No newline at end of file
Modified: branches/jbehave-2.1.x/jbehave-maven-plugin/src/main/java/org/jbehave/mojo/AbstractScenarioMojo.java (1020 => 1021)
--- branches/jbehave-2.1.x/jbehave-maven-plugin/src/main/java/org/jbehave/mojo/AbstractScenarioMojo.java 2008-12-26 18:18:57 UTC (rev 1020) +++ branches/jbehave-2.1.x/jbehave-maven-plugin/src/main/java/org/jbehave/mojo/AbstractScenarioMojo.java 2009-01-24 18:46:36 UTC (rev 1021) @@ -66,30 +66,39 @@ private List<String> scenarioExcludes; /** - * Runtime classpath + * Compile classpath. * - * @parameter _expression_="${project.runtimeClasspathElements}" + * @parameter _expression_="${project.compileClasspathElements}" * @required * @readonly */ - private List<String> runtimeClasspathElements; + private List<String> compileClasspathElements; /** + * Test classpath. + * + * @parameter _expression_="${project.testClasspathElements}" + * @required + * @readonly + */ + private List<String> testClasspathElements; + + /** * Used to find scenario class names */ private ScenarioClassNameFinder finder = new ScenarioClassNameFinder(); /** - * Determines if the scope of the source directory is "test" + * Determines if the scope of the mojo classpath is "test" * * @return A boolean <code>true</code> if test scoped */ - private boolean isSourceTestScope() { + private boolean isTestScope() { return TEST_SCOPE.equals(scope); } private String rootSourceDirectory() { - if (isSourceTestScope()) { + if (isTestScope()) { return testSourceDirectory; } return sourceDirectory; @@ -114,7 +123,10 @@ } private List<String> classpathElements() { - List<String> classpathElements = runtimeClasspathElements; + List<String> classpathElements = compileClasspathElements; + if (isTestScope()) { + classpathElements = testClasspathElements; + } return classpathElements; }
To unsubscribe from this list please visit:
