Title: [1022] trunk/examples: JBEHAVE-155: Merged changeset 1021 from branches/jbehave-2.1.x to trunk.
Revision
1022
Author
mauro
Date
2009-01-24 12:57:03 -0600 (Sat, 24 Jan 2009)

Log Message

JBEHAVE-155: Merged changeset 1021 from branches/jbehave-2.1.x to trunk.

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/examples/pom.xml (1021 => 1022)

--- trunk/examples/pom.xml	2009-01-24 18:46:36 UTC (rev 1021)
+++ trunk/examples/pom.xml	2009-01-24 18:57:03 UTC (rev 1022)
@@ -16,6 +16,7 @@
     <module>noughtsandcrosses</module>
     <module>noughtsandcrosses/scenarios</module>
     <module>trader</module>
+    <module>trader-test-scope</module>
   </modules>
 
   <dependencies>

Copied: trunk/examples/trader-test-scope (from rev 1021, branches/jbehave-2.1.x/examples/trader-test-scope) ( => )


Property changes on: trunk/examples/trader-test-scope
___________________________________________________________________
Name: svn:ignore
   + target

Deleted: trunk/examples/trader-test-scope/pom.xml (1021 => 1022)

--- branches/jbehave-2.1.x/examples/trader-test-scope/pom.xml	2009-01-24 18:46:36 UTC (rev 1021)
+++ trunk/examples/trader-test-scope/pom.xml	2009-01-24 18:57:03 UTC (rev 1022)
@@ -1,63 +0,0 @@
-<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

Copied: trunk/examples/trader-test-scope/pom.xml (from rev 1021, branches/jbehave-2.1.x/examples/trader-test-scope/pom.xml) (0 => 1022)

--- trunk/examples/trader-test-scope/pom.xml	                        (rev 0)
+++ trunk/examples/trader-test-scope/pom.xml	2009-01-24 18:57:03 UTC (rev 1022)
@@ -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.2-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: trunk/jbehave-maven-plugin/src/main/java/org/jbehave/mojo/AbstractScenarioMojo.java (1021 => 1022)

--- trunk/jbehave-maven-plugin/src/main/java/org/jbehave/mojo/AbstractScenarioMojo.java	2009-01-24 18:46:36 UTC (rev 1021)
+++ trunk/jbehave-maven-plugin/src/main/java/org/jbehave/mojo/AbstractScenarioMojo.java	2009-01-24 18:57:03 UTC (rev 1022)
@@ -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:

http://xircles.codehaus.org/manage_email

Reply via email to