当前位置: 首页 > 知识库问答 >
问题:

JAVA伊奥。jbehave/storyDurations的FileNotFoundException。道具

法浩壤
2023-03-14

我正试图让jBehave在我的两个模块的谷歌应用引擎项目中模仿https://github.com/ctesniere/appengine-modules-sample-java.我使用Maven生成了jBehave原型(jBehave simple原型)。我成功地运行了它。

然而,当我手动将更改应用到我的目标项目的pom.xml,并复制由jBehave原型生成的两个java文件时,我无法获得成功的mvn清洁安装

我得到以下错误:

[INFO] --- jbehave-maven-plugin:3.9.5:run-stories-as-embeddables (embeddable-stories) @ followerdownloader-frontend ---
[INFO] Running stories as embeddables using embedder Embedder[storyMapper=StoryMapper,storyRunner=StoryRunner,embedderMonitor=MavenEmbedderMonitor,classLoader=EmbedderClassLoader[urls=[/Users/mosofsky/Developer/FollowerDownloader/followerdownloader-frontend/target/classes/, appengine-api-1.0-sdk-1.9.17.jar, servlet-api-2.5.jar, jstl-1.2.jar, jbehave-core-3.9.5.jar, hamcrest-integration-1.3.jar, commons-collections-3.2.1.jar, commons-io-2.4.jar, commons-lang-2.6.jar, plexus-utils-3.0.10.jar, freemarker-2.3.19.jar, paranamer-2.4.jar, xstream-1.4.5.jar, xmlpull-1.1.3.1.jar, xpp3_min-1.1.4c.jar],parent=ClassRealm[plugin>org.jbehave:jbehave-maven-plugin:3.9.5, parent: sun.misc.Launcher$AppClassLoader@6da21389]],embedderControls=UnmodifiableEmbedderControls[EmbedderControls[batch=false,skip=false,generateViewAfterStories=true,ignoreFailureInStories=true,ignoreFailureInView=false,verboseFailures=false,verboseFiltering=false,storyTimeoutInSecs=300,failOnStoryTimeout=false,threads=1]],embedderFailureStrategy=<null>,configuration=org.jbehave.core.configuration.MostUsefulConfiguration@3ba4236f,candidateSteps=<null>,stepsFactory=<null>,metaFilters=[],systemProperties=<null>,executorService=<null>,executorServiceCreated=false,storyManager=<null>]
[INFO] Found class names: [com.netbase.jbehaveexample.MyStories]
[INFO] Using controls UnmodifiableEmbedderControls[EmbedderControls[batch=false,skip=false,generateViewAfterStories=true,ignoreFailureInStories=true,ignoreFailureInView=false,verboseFailures=false,verboseFiltering=false,storyTimeoutInSecs=300,failOnStoryTimeout=false,threads=1]]
[INFO] Running embeddable com.netbase.jbehaveexample.MyStories
[INFO] Processing system properties {}
[INFO] Using controls UnmodifiableEmbedderControls[EmbedderControls[batch=false,skip=false,generateViewAfterStories=true,ignoreFailureInStories=true,ignoreFailureInView=false,verboseFailures=false,verboseFiltering=false,storyTimeoutInSecs=300,failOnStoryTimeout=false,threads=1]]

(BeforeStories)


(AfterStories)

[INFO] Generating reports view to '/Users/mosofsky/Developer/FollowerDownloader/followerdownloader-frontend/target/jbehave' using formats '[stats, console, txt, html, xml]' and view properties '{navigator=ftl/jbehave-navigator.ftl, views=ftl/jbehave-views.ftl, reports=ftl/jbehave-reports-with-totals.ftl, nonDecorated=ftl/jbehave-report-non-decorated.ftl, decorated=ftl/jbehave-report-decorated.ftl, maps=ftl/jbehave-maps.ftl}'
java.io.FileNotFoundException: /Users/mosofsky/Developer/FollowerDownloader/followerdownloader-frontend/target/jbehave/storyDurations.props (No such file or directory)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:146)
    at java.io.FileReader.<init>(FileReader.java:72)
    at org.jbehave.core.reporters.TemplateableViewGenerator.storyDurations(TemplateableViewGenerator.java:123)
    at org.jbehave.core.reporters.TemplateableViewGenerator.generateReportsView(TemplateableViewGenerator.java:115)
    at org.jbehave.core.embedder.Embedder.generateReportsView(Embedder.java:249)
    at org.jbehave.core.embedder.Embedder.generateReportsView(Embedder.java:237)
    at org.jbehave.core.embedder.Embedder.runStoriesAsPaths(Embedder.java:213)
    at org.jbehave.core.junit.JUnitStories.run(JUnitStories.java:20)
    at org.jbehave.core.embedder.Embedder.runAsEmbeddables(Embedder.java:121)
    at org.jbehave.mojo.RunStoriesAsEmbeddables.execute(RunStoriesAsEmbeddables.java:18)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[INFO] Reports view generated with 0 stories (of which 0 pending) containing 0 scenarios (of which 0 pending)
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ followerdownloader-frontend ---
[INFO] Installing /Users/mosofsky/Developer/FollowerDownloader/followerdownloader-frontend/target/followerdownloader-frontend-1.0.war to /Users/mosofsky/.m2/repository/com/netbase/followerdownloader/followerdownloader-frontend/1.0/followerdownloader-frontend-1.0.war
[INFO] Installing /Users/mosofsky/Developer/FollowerDownloader/followerdownloader-frontend/pom.xml to /Users/mosofsky/.m2/repository/com/netbase/followerdownloader/followerdownloader-frontend/1.0/followerdownloader-frontend-1.0.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.363 s
[INFO] Finished at: 2014-12-22T14:53:51-08:00
[INFO] Final Memory: 22M/222M
[INFO] ------------------------------------------------------------------------

我找不到一个名为行为/故事urations.props的文件来从原型构建复制到我自己的项目。我错过了什么?

共有3个答案

周子平
2023-03-14

我把它修好了-

  1. StoryRunner中添加步骤类实例的列表项,如new ClassnameSteps()java
胡国兴
2023-03-14

我尝试了很多方法,但仍然没有解决我的问题。最后,我从路径(包括文件夹名称)中删除了空格和通配符,然后它允许我执行Test Runner

阙庆
2023-03-14

缺少从原型复制到新项目的文件是stories/my。故事。尽管这个错误是关于其他事情的,但当我在我的计算机上复制时,我能够消除这个错误。故事文件:

[INFO] --- jbehave-maven-plugin:3.9.5:run-stories-as-embeddables (embeddable-stories) @ followerdownloader-frontend ---
[INFO] Running stories as embeddables using embedder Embedder[storyMapper=StoryMapper,storyRunner=StoryRunner,embedderMonitor=MavenEmbedderMonitor,classLoader=EmbedderClassLoader[urls=[/Users/mosofsky/Developer/FollowerDownloader/followerdownloader-frontend/target/classes/, appengine-api-1.0-sdk-1.9.17.jar, servlet-api-2.5.jar, jstl-1.2.jar, jbehave-core-3.9.5.jar, hamcrest-integration-1.3.jar, commons-collections-3.2.1.jar, commons-io-2.4.jar, commons-lang-2.6.jar, plexus-utils-3.0.10.jar, freemarker-2.3.19.jar, paranamer-2.4.jar, xstream-1.4.5.jar, xmlpull-1.1.3.1.jar, xpp3_min-1.1.4c.jar],parent=ClassRealm[plugin>org.jbehave:jbehave-maven-plugin:3.9.5, parent: sun.misc.Launcher$AppClassLoader@6da21389]],embedderControls=UnmodifiableEmbedderControls[EmbedderControls[batch=false,skip=false,generateViewAfterStories=true,ignoreFailureInStories=true,ignoreFailureInView=false,verboseFailures=false,verboseFiltering=false,storyTimeoutInSecs=300,failOnStoryTimeout=false,threads=1]],embedderFailureStrategy=<null>,configuration=org.jbehave.core.configuration.MostUsefulConfiguration@2b37d486,candidateSteps=<null>,stepsFactory=<null>,metaFilters=[],systemProperties=<null>,executorService=<null>,executorServiceCreated=false,storyManager=<null>]
[INFO] Found class names: [com.netbase.jbehaveexample.MyStories]
[INFO] Using controls UnmodifiableEmbedderControls[EmbedderControls[batch=false,skip=false,generateViewAfterStories=true,ignoreFailureInStories=true,ignoreFailureInView=false,verboseFailures=false,verboseFiltering=false,storyTimeoutInSecs=300,failOnStoryTimeout=false,threads=1]]
[INFO] Running embeddable com.netbase.jbehaveexample.MyStories
[INFO] Processing system properties {}
[INFO] Using controls UnmodifiableEmbedderControls[EmbedderControls[batch=false,skip=false,generateViewAfterStories=true,ignoreFailureInStories=true,ignoreFailureInView=false,verboseFailures=false,verboseFiltering=false,storyTimeoutInSecs=300,failOnStoryTimeout=false,threads=1]]

(BeforeStories)

[INFO] Running story com/netbase/jbehaveexample/stories/my.story

(com/netbase/jbehaveexample/stories/my.story)
Scenario: A scenario with some pending steps
Given I am a pending step (PENDING)
And I am still pending step (PENDING)
When a good soul will implement me (PENDING)
Then I shall be happy (PENDING)
@Given("I am a pending step")
@Pending
public void givenIAmAPendingStep() {
  // PENDING
}

@Given("I am still pending step")
@Pending
public void givenIAmStillPendingStep() {
  // PENDING
}

@When("a good soul will implement me")
@Pending
public void whenAGoodSoulWillImplementMe() {
  // PENDING
}

@Then("I shall be happy")
@Pending
public void thenIShallBeHappy() {
  // PENDING
}




(AfterStories)

[INFO] Generating reports view to '/Users/mosofsky/Developer/FollowerDownloader/followerdownloader-frontend/target/jbehave' using formats '[stats, console, txt, html, xml]' and view properties '{navigator=ftl/jbehave-navigator.ftl, views=ftl/jbehave-views.ftl, reports=ftl/jbehave-reports-with-totals.ftl, nonDecorated=ftl/jbehave-report-non-decorated.ftl, decorated=ftl/jbehave-report-decorated.ftl, maps=ftl/jbehave-maps.ftl}'
[INFO] Reports view generated with 1 stories (of which 1 pending) containing 1 scenarios (of which 1 pending)
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ followerdownloader-frontend ---
[INFO] Installing /Users/mosofsky/Developer/FollowerDownloader/followerdownloader-frontend/target/followerdownloader-frontend-1.0.war to /Users/mosofsky/.m2/repository/com/netbase/followerdownloader/followerdownloader-frontend/1.0/followerdownloader-frontend-1.0.war
[INFO] Installing /Users/mosofsky/Developer/FollowerDownloader/followerdownloader-frontend/pom.xml to /Users/mosofsky/.m2/repository/com/netbase/followerdownloader/followerdownloader-frontend/1.0/followerdownloader-frontend-1.0.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.486 s
[INFO] Finished at: 2014-12-22T15:08:01-08:00
[INFO] Final Memory: 22M/229M
[INFO] ------------------------------------------------------------------------

复制这个故事文件可以消除java.io.FileNotFoundExctive的j行为/StoryDurations.props错误。

=================

更新:另一个解决方案是创建一个到包含故事文件的目录的符号链接。如果您有多个谷歌应用引擎模块,但您想跨模块共享故事文件,这很有用。有关如何设置符号链接(“符号链接”)的解释,请参见另一个解决方案:https://stackoverflow.com/a/28137844/2848676

 类似资料:
  • 当我在 XMLParser。JAVA } 我的decdeBase64方法: 我想知道如何将从XML解析的图像正确添加到SimpleAdapter。我必须创建自己的适配器吗?

  • 构建了一个简单的springboot应用程序,包括一些方面的检查架构等。 我试着捕捉系统的每一个呼叫。出来println()给出使用警告,这就是我目前发现的: System.out.println()使用PrintStream,所以我尝试了这个: 但没有成功。日志上写着 一个类似的方面正在发挥作用,但是执行而不是调用:

  • 我想解码我从画廊拍的照片,但它有一个错误。我尝试过各种方法,但都没有成功。请帮我修改代码。 这是我的代码:https://pastebin.com/syWjqPDK } 这是logcat的结果

  • 我正试图为我的应用程序保存和编写一个包含一些数据的XML文件,但当它试图打开该文件时,它给出了一个java。伊奥。FileNotFoundException。 我用来保存XML文件的代码是: 我用来读取文件的代码是: 它给出的逻辑是: 有人知道如何解决这个问题吗?提前谢谢 编辑:整个写代码是:(抱歉,有些名字和注释是荷兰语) 整个读取代码是:

  • 当使用意图选择图像时,我会得到一个无法打开文件的URI。如果我尝试打开文件,如下所示: 它给出了以下例外情况: <代码>/文档/图像: 9537 似乎确实是一条不正确的路径,但是我如何获得正确的路径呢? 我用这个逻辑打开图像拾取器: 然后在onActivityResult中检索Uri,如下所示: 我需要对文件进行解码,使其变小。

  • 我在groovy类中有一个Restendpoint,其方法签名如下...... 是一个。在我的post请求中,我传递json。 如果我这样做,我可以看到参数(注意:我知道这是在java样式循环中打印字符串。这不是我想要的)...... 我想要的是一种转换使用groovy读取一个漂亮的Json对象,然后从Json对象读取属性? 谢谢