I'm running 2.3.2, btw.

I also added the extra ctor

 public Greeting(final Class<? extends RunnableScenario> scenarioClass) {
        super(new PropertyBasedConfiguration() {
            @Override
            public ScenarioDefiner forDefiningScenarios() {
                return new ClasspathScenarioDefiner(converter, new
PatternScenarioParser(this));
            }
        }, new GreetingSteps());
}

and changed the build file with the same result ("No scenarios to
run.").  Again, everything still works through Eclipse's JUnit runner.

<path id="test.classpath">
    <fileset refid="jbehave.files" />
    <fileset dir="${lib.dir}" includes="**/*.jar"/>
    <pathelement location="${scenarios.dir}" />
    <pathelement location="${build.test.classes.dir}" />
  </path>

  <classloader classpathref="test.classpath" />


....

  <target name="run-scenarios" depends="compile-test">
    <taskdef name="scenarioRunner"
classname="org.jbehave.ant.ScenarioRunnerTask"
      classpathref="test.classpath" />

    <scenarioRunner scenarioIncludes="${test.java.dir}/**/*.java"
      classLoaderInjected="true" />
  </target>
On Mon, Dec 21, 2009 at 4:26 PM, Christopher Gardner
<[email protected]> wrote:
> I can run the following through the Eclipse JUnit support with no
> problems whatsoever:
>
> public class Greeting extends JUnitScenario {
>    private static ScenarioNameResolver converter =
>        new UnderscoredCamelCaseResolver(".scenario");
>
>    public Greeting() {
>        super(new PropertyBasedConfiguration() {
>           �...@override
>            public ScenarioDefiner forDefiningScenarios() {
>                return new ClasspathScenarioDefiner(converter, new
> PatternScenarioParser(this));
>            }
>
>           �...@override
>            public PendingErrorStrategy forPendingSteps() {
>                    return PendingErrorStrategy.FAILING;
>            }
>        }, new GreetingSteps());
>    }
>
> However, when I try to run it with the ant scenarioRunner, I receive
> "No scenarios to run."
>
> Here is my ant file, where "jbehave.files" referenced in the
> test.classpath points to all the JBehave jars.
>
> <?xml version="1.0" encoding="UTF-8"?>
> <project name="fsa-srv-specs" default="run-scenarios" basedir=".">
>
>  <property name="build.common.dir" location="${basedir}/build-common" />
>  <!-- =====================================================================
>       Properties: Structure
>       ===================================================================== 
> -->
>  <property name="test.dir" location="${basedir}/test" />
>
>  <!-- the Java Steps and Scenario file location -->
>  <property name="test.java.dir" location="${test.dir}/java" />
>
>  <!-- the *.scenario file location with the same package structure as
> the corresponding Steps files -->
>  <property name="scenarios.dir" location="${basedir}/scenarios" />
>  <property name="lib.dir" location="${basedir}/lib" />
>  <property name="build.dir" location="${basedir}/build" />
>  <property name="build.test.dir" location="${build.dir}/test" />
>  <property name="build.test.classes.dir"
> location="${build.test.dir}/classes" />
>
>  <import file="${build.common.dir}/dependencies.xml" />
>  <!-- =====================================================================
>       Classpaths
>       ===================================================================== 
> -->
>  <path id="test.classpath">
>    <fileset refid="jbehave.files" /> <!-- imported through dependencies.xml 
> -->
>    <fileset dir="${lib.dir}" includes="**/*.jar" />
>    <pathelement location="${scenarios.dir}" />
>    <pathelement location="${build.test.classes.dir}" />
>  </path>
>
>  <!-- =====================================================================
>       Targets: Build
>       ===================================================================== 
> -->
>  <target name="init-test">
>     <mkdir dir="${build.test.classes.dir}" />
>   </target>
>
>   <target name="compile-test" description="Compile the tests."
> depends="init-test">
>     <javac.local destdir="${build.test.classes.dir}" 
> srcdir="${test.java.dir}">
>       <classpath refid="test.classpath" />
>     </javac.local>
>   </target>
>
>  <target name="run-scenarios" description="Run the behavioral tests."
> depends="compile-test">
>    <taskdef name="scenarioRunner"
> classname="org.jbehave.ant.ScenarioRunnerTask"
>      classpathref="test.classpath" />
>
>    <scenarioRunner scenarioIncludes="${test.java.dir}/**/*.java"
>      classLoaderInjected="false" />
>  </target>
>
>  <target name="clean" description="Clean the build.">
>    <delete dir="${build.dir}" />
>  </target>
>
>  <!-- =====================================================================
>       Macros, Presets, and Typedefs
>       ===================================================================== 
> -->
>  <presetdef name="javac.local">
>    <javac debug="true" />
>  </presetdef>
> </project>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to