【问题标题】:ScenarioNotFoundException when trying to run jBehave scenario尝试运行 jBehave 场景时出现 ScenarioNotFoundException
【发布时间】:2011-02-25 20:26:19
【问题描述】:

我已经在谷歌上搜索了一段时间,试图找出解决这个问题的方法,但没有真正的运气。我在尝试运行 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>

任何帮助将不胜感激!

【问题讨论】:

  • Path_to_jBehave_Directory 的值是多少?

标签: java testing behavior jbehave


【解决方案1】:

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

    <testResources>
        <testResource>
            <directory>src/test/java</directory>
            <includes>
                <include>**/*.story</include>
            </includes>
        </testResource>
    </testResources>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-02-15
    相关资源
    最近更新 更多