Hi Mauro,
No, I still don't get it I'm afraid :(
The embedder get's passed a list of story files:
embedder.runStoriesAsPaths(storyPaths);
in the the config method a story loader and location are specified:
.useStoryLoader(new LoadFromRelativeFile(url))
which according to the example is the same root directory.
System.getProperty("user.dir") + "/JBehave/src");
are you saying the storyPaths indicate which story[s] to run and the
LoadFromRelativeFile() says where the reports should go?
cheers,
Graham
On 8 March 2012 18:14, Mauro Talevi <[email protected]> wrote:
> Hi Graham,
>
> the location is used by the embedder to write the output reports. The
> story paths constitute the input for the story running and are independent,
> ie you can have the input from remote or a different local path.
>
> Hope that clarifies it.
>
> Cheers
>
> On 8 Mar 2012, at 18:24, Graham Abell <[email protected]> wrote:
>
> Hi Mauro,
>
> in the example Zoltan gave, what's the point of providing the story paths
> to the embedder if you then have to specify a location in the config? Is
> there a way around that or which one takes precedence?
>
> cheers,
> graham
>
> On 8 March 2012 16:55, Mauro Talevi < <[email protected]>
> [email protected]> wrote:
>
>> Hi,
>>
>> you can use the StoryFinder with the CodeLocations.**
>> codeLocationFromPath("/your/**absolute/path") as your searchIn URL.
>>
>> Cheers
>>
>>
>> On 08/03/2012 17:20, Penzeli, Zoltan wrote:
>>
>>> Hi All,
>>>
>>>
>>> We are in the middle of creating our BDD framework, and haven't yet
>>> decided where our .story files will be - but most likely they will be in
>>> a directory well separated from our Java project.
>>>
>>> We tried the following code:
>>>
>>> ****************************
>>>
>>> public Configuration configuration() {
>>>
>>> URL url = null;
>>> try {
>>> url = new URL("file://" + System.getProperty("user.dir") +
>>> "/JBehave/src");
>>> } catch (MalformedURLException e) {
>>> return null;
>>> }
>>>
>>> Class<?> embedderClass = this.getClass();
>>> URL codeLocation =
>>> CodeLocations.**codeLocationFromClass(**embedderClass);
>>> Configuration configuration = new MostUsefulConfiguration()
>>> .useStoryLoader(new LoadFromRelativeFile(url))
>>> .useStoryReporterBuilder(new StoryReporterBuilder()
>>> .withCodeLocation(**codeLocation)
>>> .withDefaultFormats());
>>> return configuration;
>>> }
>>>
>>> ****************************
>>>
>>> public void SmoketestSteps() {
>>>
>>> Embedder embedder = new StackEmbedder();
>>> StoryFinder finder = new StoryFinder();
>>> String storyLocation = System.getProperty("user.dir") +
>>> "/JBehave/src/";
>>> List<String> storyPaths = finder.findPaths(**storyLocation,
>>> Arrays.asList("**/*.story"),
>>> Arrays.asList("**/*smoke*"),
>>> "");
>>>
>>> embedder.runStoriesAsPaths(**storyPaths);
>>> }
>>>
>>> (Actually it did us a bit of a time to realise what kind of StoryLoader
>>> we should use...)
>>>
>>> It seems to be running but nothing is actually executed. Moreover, we
>>> couldn't really understand what's the function of the constructor of
>>> LoadFromRelativeFile() AND the first parameter of finder.findPaths().
>>> The latter doesn't seem to have any effect on the execution.
>>>
>>> We couldn't find any concrete example how Stories could be found and run
>>> from _absolute_ paths - if this is possible at all with the current
>>> code.
>>>
>>> It would nice if someone could provide one...
>>>
>>> Best Regards,
>>>
>>> Zoltan
>>>
>>> ______________________________**______________________________**
>>> ____________
>>> Privileged, confidential and/or copyright information may be contained
>>> in this communication. This e-mail and any files transmitted with it are
>>> confidential and intended solely for the use of the individual or entity to
>>> whom they are addressed. If you are not the intended addressee, you may not
>>> copy, forward, disclose or otherwise use this e-mail or any part of it in
>>> any way whatsoever. To do so is prohibited and may be unlawful. If you have
>>> received this email in error
>>> please notify the sender immediately.
>>>
>>> Paddy Power PLC may monitor the content of e-mail sent and received for
>>> the purpose of ensuring compliance with its policies and procedures.
>>>
>>> Paddy Power plc, Power Tower, Blocks 1-3 Belfield Office Park, Beech
>>> Hill Road, Clonskeagh, Dublin 4. Registered in Ireland: 16956
>>> ______________________________**______________________________**
>>> ____________
>>>
>>> ------------------------------**------------------------------**
>>> ---------
>>> To unsubscribe from this list, please visit:
>>>
>>> <http://xircles.codehaus.org/manage_email>
>>> http://xircles.codehaus.org/**manage_email
>>>
>>>
>>>
>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe from this list, please visit:
>>
>> <http://xircles.codehaus.org/manage_email>http://xircles.codehaus.org/*
>> *manage_email
>>
>>
>>
>