필자의 컨텍스트가 본인의 컨텍스트와 같은지 확실하지 않지만 제 경우에는 문제가 내 단계 파일의 오타였습니다. 두 개의 매개 변수가있는 Then
조건이 있지만 내 Steps.java
파일에 내 메소드 서명 중 하나가 누락되었습니다. 실수를 바로 잡았고 테스트가 성공적으로 통과되었습니다.
이
[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/OpMetricsFilterBuilder/stories/ComputeDerivedValue.story
Compute Derived Value
(com/netbase/OpMetricsFilterBuilder/stories/ComputeDerivedValue.story)
Narrative:
In order to explore how my social media activity ties to my core business metrics
As a n analyst
I want to compute a derived time series value from a set of component time series
Scenario: Compute Net Intent to Shop
Given the following time series:
|Date|Shop|NotShop|
|11/5/2014|330|400|
|11/6/2014|370|410|
|11/7/2014|320|390|
|11/8/2014|200|280|
|11/9/2014|430|450|
And a derived value name of NetIntentToShop
And a formula for computing the derived value is (#{Shop} - #{NotShop})/(#{Shop} + #{NotShop}) * 100
When the NetIntentToShop is derived
Then the NetIntentToShop should be
|Date|NetIntentToShop|
|11/5/2014|-9.58904109589041|
|11/6/2014|-5.128205128205128|
|11/7/2014|-9.859154929577464|
|11/8/2014|-16.666666666666664|
|11/9/2014|-2.272727272727273| (FAILED)
(org.jbehave.core.io.StoryResourceNotFound: Story path 'NetIntentToShop' not found by class loader EmbedderClassLoader[urls=[/Users/mosofsky/Developer/SocialMetrics/nbsocialmetrics-frontend/target/classes/, appengine-api-1.0-sdk-1.9.15.jar, servlet-api-2.5.jar, jstl-1.2.jar, objectify-5.1.1.jar, guava-17.0.jar, jeval-0.9.4.jar, gwt-user-2.7.0-rc1.jar, validation-api-1.0.0.GA.jar, validation-api-1.0.0.GA-sources.jar, gwt-dev-2.7.0-rc1.jar, asm-5.0.3.jar, asm-util-5.0.3.jar, asm-tree-5.0.3.jar, asm-commons-5.0.3.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, jbehave-junit-runner-1.1.2.jar, junit-4.11.jar, mockito-core-1.9.5.jar, hamcrest-core-1.3.jar, hamcrest-library-1.3.jar, objenesis-1.3.jar],parent=ClassRealm[plugin>org.jbehave:jbehave-maven-plugin:3.9.5, parent: [email protected]]])
[WARNING] Failed to run story com/netbase/OpMetricsFilterBuilder/stories/ComputeDerivedValue.story
org.jbehave.core.io.StoryResourceNotFound: Story path 'NetIntentToShop' not found by class loader EmbedderClassLoader[urls=[/Users/mosofsky/Developer/SocialMetrics/nbsocialmetrics-frontend/target/classes/, appengine-api-1.0-sdk-1.9.15.jar, servlet-api-2.5.jar, jstl-1.2.jar, objectify-5.1.1.jar, guava-17.0.jar, jeval-0.9.4.jar, gwt-user-2.7.0-rc1.jar, validation-api-1.0.0.GA.jar, validation-api-1.0.0.GA-sources.jar, gwt-dev-2.7.0-rc1.jar, asm-5.0.3.jar, asm-util-5.0.3.jar, asm-tree-5.0.3.jar, asm-commons-5.0.3.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, jbehave-junit-runner-1.1.2.jar, junit-4.11.jar, mockito-core-1.9.5.jar, hamcrest-core-1.3.jar, hamcrest-library-1.3.jar, objenesis-1.3.jar],parent=ClassRealm[plugin>org.jbehave:jbehave-maven-plugin:3.9.5, parent: [email protected]]]
at org.jbehave.core.io.LoadFromClasspath.resourceAsStream(LoadFromClasspath.java:44)
at org.jbehave.core.io.LoadFromClasspath.loadResourceAsText(LoadFromClasspath.java:29)
at org.jbehave.core.model.ExamplesTableFactory.createExamplesTable(ExamplesTableFactory.java:76)
at org.jbehave.core.steps.ParameterConverters$ExamplesTableConverter.convertValue(ParameterConverters.java:647)
at org.jbehave.core.steps.ParameterConverters.convert(ParameterConverters.java:151)
at org.jbehave.core.steps.StepCreator.convertParameterValues(StepCreator.java:304)
at org.jbehave.core.steps.StepCreator.access$1100(StepCreator.java:36)
at org.jbehave.core.steps.StepCreator$ParametrisedStep.parametriseStep(StepCreator.java:640)
at org.jbehave.core.steps.StepCreator$ParametrisedStep.perform(StepCreator.java:592)
at org.jbehave.core.embedder.StoryRunner$FineSoFar.run(StoryRunner.java:535)
at org.jbehave.core.embedder.StoryRunner.runStepsWhileKeepingState(StoryRunner.java:515)
at org.jbehave.core.embedder.StoryRunner.runScenarioSteps(StoryRunner.java:479)
at org.jbehave.core.embedder.StoryRunner.runStepsWithLifecycle(StoryRunner.java:445)
at org.jbehave.core.embedder.StoryRunner.runCancellable(StoryRunner.java:305)
at org.jbehave.core.embedder.StoryRunner.run(StoryRunner.java:220)
at org.jbehave.core.embedder.StoryRunner.run(StoryRunner.java:181)
at org.jbehave.core.embedder.StoryManager$EnqueuedStory.call(StoryManager.java:262)
at org.jbehave.core.embedder.StoryManager$EnqueuedStory.call(StoryManager.java:229)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
다음은 잘못된 방법 서명입니다 : 여기
@Then("the $derivedValueName should be: $expectedOutputDataTable")
public void thenTheDerivedValueShouldBe(ExamplesTable expectedOutputDataTable) {
것 보정 :
@Then("the $derivedValueName should be: $expectedOutputDataTable")
public void thenTheDerivedValueShouldBe(String derivedValueName, ExamplesTable expectedOutputDataTable) {
그것은 우스운 것 같아 여기
는 오류가 나는 점점 것을 뭔지 내 상황에 대한 오류 메시지. 매개 변수가
Steps.java
파일에서 누락 된 경우 Jbehave가 리소스로 검색 할 수 있습니다.
이름보다 예외가 더 있습니다. – jedwards
org.jbehave.core.io.StoryResourceNotFound : 경로 경로 'path/story_name.story'를 클래스 로더에서 찾을 수 없습니다. [email protected] – user1772643
그래서 'story_name.story' 파일이 당신이있는 곳이 아닙니다 (경로'/'안에) 프로그램을 말했거나'path/story_name.story' 경로를 지정하고 프로젝트 레이아웃을 반영하기 위해 코드를 복사하고 붙여 넣었습니다. 그리고 스토리가 실제로 어디에 있는지/이름이 지정되었습니다. – jedwards