I have found the problem… the AnnotatedPathRunner example was setting a custom
pattern prefix:
public static class MyRegexPrefixCapturingPatternParser extends
RegexPrefixCapturingPatternParser {
public MyRegexPrefixCapturingPatternParser() {
super("%");
}
}
After removing this configuration parameters prefixed by default $ work again
and steps are recognized.
Luigi
From: Luigi Suardi
Sent: Wednesday, June 26, 2013 4:49 PM
To: [email protected]
Subject: RE: [jbehave-user] Pending steps using AnnotatedPathRunner
What about single quotes? I have used them with no problems with JUnitStory
based configuration…
From: louis gueye [mailto:[email protected]]
Sent: Wednesday, June 26, 2013 4:40 PM
To: [email protected]
Subject: Re: [jbehave-user] Pending steps using AnnotatedPathRunner
Hi,
You should use double quotes and escape them if you want them to be interpreted
like this:
When I GET "/account?searchString=0021" ACCEPT "application/json"
@When("I GET \"$storyURI\" ACCEPT \"$storyAccept\"")
public void whenHttpGetRequest(String storyURI, String storyAccept)
This should work
Cordialement/Regards,
Louis GUEYE
linkedin<http://fr.linkedin.com/in/louisgueye> |
blog<http://deepintojee.wordpress.com/> |
twitter<http://twitter.com/#%21/lgueye>
2013/6/26 Luigi Suardi <[email protected]<mailto:[email protected]>>
Hi there,
I am trying to use AnnotatedPathRunner to run my stories. The story files are
loaded properly, but all steps are PENDING.
The same exact steps work fine if I use JUnitStory rather than
AnnotatedPathRunner.
I have attached the AnnotatedPathRunner implementation. More info below.
I am running the project as JUnit test in Eclipse.
Thanks for your help.
Luigi
Story
Scenario: realistic scenario
Given service URI '' and authorization token ''
When I GET '/account?searchString=0021' ACCEPT 'application/json'
Then I expect status 200
Then I expect response body
…
Steps from RestJbehaveSteps class
@Given("service URI '$storyServiceURI' and authorization token
'$storyAuthToken'")
public void givenServiceUri(String storyServiceURI, String storyAuthToken)
…
@When("I GET '$storyURI' ACCEPT '$storyAccept'")
public void whenHttpGetRequest(String storyURI, String storyAccept)
throws Exception
…
Output in Eclipse console
Processing system properties {java.awt.headless=true}
System property 'java.awt.headless' set to 'true'
Using controls
EmbedderControls[batch=false,skip=false,generateViewAfterStories=true,ignoreFailureInStories=true,ignoreFailureInView=true,verboseFailures=false,verboseFiltering=false,storyTimeoutInSecs=100,threads=1]
(BeforeStories)
Running story restjbehave/Account_Resource_Jbehave_Configuration.story
(restjbehave/Account_Resource_Jbehave_Configuration.story)
Scenario: realistic scenario
Given service URI '' and authorization token '' (PENDING)
When I GET '/account?searchString=0021' ACCEPT 'application/json' (PENDING)
Then I expect status 200 (PENDING)
…
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email