Ah, I missed that you have your intended jbehave tests in a folder at the
same level as the module you want to test.  The projects I deal with have
the jbehave tests in module/src/jbehave-tests at the same level as main, in
that way the relative path src/jbehave-tests is always on the classpath and
always exists locally per module.  Some of my parent projects have 15-20
different web services so I need to keep the tests branching/releasing with
the module like that.
Then as Mauro points out, I use the StoryFinder like this:
@Override
protected List<String> storyPaths() {
return new StoryFinder().findPaths(
codeLocationFromClass(this.getClass()).getFile(),
asList("**/${story.matcher}"), null);
}

passing in the story.matcher at run time from maven.
Perhaps you could use the build helper or resource plugin to add the
acceptance-test dir as a resource when the module build occurs, if that
doesn't work maybe try moving your tests into the webapp module where maven
can find them automatically.
Seth
p.s. If you really want it separate you could try to set it up like
checkstyle recommends for a global rules in multi module projects:
http://maven.apache.org/plugins/maven-checkstyle-plugin/examples/multi-module-config.html


On Monday, October 24, 2011, Mauro Talevi <[email protected]>
wrote:
> Hi,
>
> StoryFinder supports lookup by URL code locations.  Best portability is
obtained by using CodeLocations.codeLocationByClass() method which finds
resources in the classpath.
>
> Have a look at the examples and let us know if anything is not clear.
 These show the stories being shared across modules.
>
> Cheers
>
>
>
> On 23 Oct 2011, at 15:54, louis gueye <[email protected]> wrote:
>
>> Hi all,
>>
>> I've come around a strange behaviour. I'm on that issue since 5 days. Now
I've understood the problem.
>>
>> When I run jebahave-maven-plugin on a single module project the
InjectableEmbedder can find my stories.
>>
>> When I run jebahave-maven-plugin on a muti module project, from the
project defining stories the InjectableEmbedder can find my stories.
>>
>> When I run jebahave-maven-plugin on a muti module project, from the root
project the InjectableEmbedder can't find my stories. I guess it's related
to how I look for the stories :
>>
>>     /**
>>      * @see org.jbehave.core.Embeddable#run()
>>      */
>>     @Test
>>     @Override
>>     public void run() throws Throwable {
>>         injectedEmbedder().runStoriesAsPaths(storyPaths());
>>     }
>>
>>     protected List<String> storyPaths() {
>>         return new StoryFinder().findPaths("src/test/resources",
Arrays.asList("**/*.story"), null);
>>     }
>>
>> my dirs are organized this way :
>>
>>  - root
>>    + acceptance-tests
>>    + server
>>    + webapp
>>
>> When I run mvn clean install -Pjbehave from root nothing happens because
root project, which has pom packaging doesn't have any src/test/resources
dir.
>> When I run mvn clean install -Pjbehave from acceptance-tests it runs the
sories.
>>
>> My build always runs on the root dir. I don't want to merge all modules
just because of jbehave. Any idea how I could keep the best of both worlds ?
>>
>> Thx
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>

Reply via email to