2

我一直在谷歌搜索一段时间,试图找出解决这个问题的方法,但没有真正的运气。我在尝试运行 jBehave 测试时遇到了这个问题 -

org.jbehave.scenario.errors.ScenarioNotFoundException: Path '$Path_to_jBehave_Directory' 
could not be found by classloader sun.misc.Launcher$AppClassLoader@f4a24a ...

我的文本场景、Steps 类和场景类都在同一个目录中($Path_to_jBehave_Directory)。

这是我在我的 maven pom 中使用的:

<dependency>
  <groupId>org.jbehave</groupId>
  <artifactId>jbehave-core</artifactId>
  <version>2.5</version>
</dependency>

任何帮助将不胜感激!

4

1 回答 1

7

Maven 不会自动将 .story 文件复制到测试类路径,除非您告诉它:

    <testResources>
        <testResource>
            <directory>src/test/java</directory>
            <includes>
                <include>**/*.story</include>
            </includes>
        </testResource>
    </testResources>
于 2011-02-25T12:26:19.200 回答