Thanks Again Mauro,

I seem to have everything working very nicely now and I'm not sure why I
wasn't seeing the stack trace for the story failure before. It might have
been because I was experimenting with run-with-annotated-embedder instead of
run-stories-as-embeddables, or because I was trying to use an
InjectableEmbedder instead of the (seemingly) more reliable JUnitStories.

I'm extremely pleased with how powerful jbehave is. If anyone is interested,
here are the areas where I had difficulty and found the learning curve a
little steep.

1) Figuring out what the different configuration parameters meant. There are
a lot of links to Javadocs, but these don't provide any more information.
For example, I'm still not quite sure what the difference between

@BeforeStory(uponGivenStory = true)

and

@BeforeStory(uponGivenStory = false)

might be.

2) Figuring out classpath issues in the Maven plugin.

It would seem that the plugin requires you to add all dependencies that your
tests require as dependencies of the plugin. This isn't clear and took a
while to figure out.

3) Understanding which embedders work in which situations

I was able to get JUnitStory/JUnitStories to work everywhere, but I couldn't
get the AnnotatedEmbedderUsingGuice to work via maven at all. Possibly it
doesn't - as there were no examples I could find.


---------------------

And a few areas where I couldn't achieve quite as much as I hoped I would be
able to,

1) If there are errors then I would like the report to be generated AND for
the build to fail. This doesn't seem to be easily possible.

2) I was able to use the ExamplesTable to populate my DB using dbunit, but
it was a bit cumbersome. I'm sure I'll improve the process but it seems like
an easy thing to provide out of the box (as EasyB does).


All in all, a great product though.

Thanks Again,

Caoilte



On Sat, Apr 30, 2011 at 8:12 AM, Mauro Talevi <[email protected]>wrote:

>  An alternative to get you started is to use archetypes:
>
> http://jbehave.org/reference/preview/archetypes.html
>
> Just download latest bin distribution of 3.4 beta and find the
> archetype-catalog.xml in the archetypes dir.
>
> On 30/04/2011 00:46, Mauro Talevi wrote:
>
> A bit thin on the details to help, I'm afraid.
>
> What you trying to run, and how?
>
> On 29/04/2011 21:29, Caoilte O'Connor wrote:
>
> Thanks Mauro,
> I'm slowly starting to figure it out. I was doing something wrong that was
> totally un-connected (my step was in the story package), but it's hard to be
> sure when you don't even know what version you're testing against.
>
> I'm now trying to figure out how  the maven plugin / intellij plugin don't
> print any useful information when the When/Then methods throw an exception
>
> All i get is
>
> [INFO] Failures in running embeddable com.x.stories.SetConfiguration
> Failures in running stories in batch:
> org.jbehave.core.embedder.Embedder$NonThreadingExecutorService$1@5dda32d0:
> Failures in running stories com/x/stories/set_configuration.story
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Trace
> org.jbehave.core.embedder.Embedder$RunningEmbeddablesFailed: Failures in
> running embeddable com.x.stories.SetConfiguration
>     at
> org.jbehave.core.embedder.Embedder.runAsEmbeddables(Embedder.java:126)
>
> which would seem to imply that all of my step classes will have to put
> try/catch(throwable e) in if I ever want to find catch failure information.
>
> I shall try using different "embedders"
>
> Thanks again
>
> Caoilte
>
>
> On Fri, Apr 29, 2011 at 7:56 PM, Mauro Talevi 
> <[email protected]>wrote:
>
>> Hi,
>>
>> the examples are not part of the release, hence by default they depend
>> on the latest snapshot.
>>
>> You can easily run them against a fixed version:
>>
>> http://jbehave.org/reference/stable/running-examples.html
>>
>> Cheers
>>
>> On 29/04/2011 20:51, Caoilte O'Connor wrote:
>> > Hi,
>> > I'm just trying to get started with JBehave, but it's a little tricky
>> > working out which documentation to read for the latest stable version.
>> > I downloaded the source bundle and have been following the website
>> > documentation page but just hit a brick wall with trying to simulate
>> > the gameoflife example in my own code
>> >
>> > Creating a simple POJO Step file as instructed here,
>> >
>> > http://jbehave.org/reference/stable/getting-started.html
>> >
>> > gets me this when running in maven (3.3.2 plugin)
>> >
>> > java.lang.ClassCastException: com.x.TestSteps cannot be cast to
>> > org.jbehave.core.Embeddable
>> >     at
>> > org.jbehave.core.embedder.Embedder.runAsEmbeddables(Embedder.java:112)
>> >     at
>> >
>> org.jbehave.mojo.RunStoriesAsEmbeddables.execute(RunStoriesAsEmbeddables.java:17)
>> >
>> > After a bit of digging I found out that even though I have the 3.3.2
>> > source bundle, all of the examples are actually referencing
>> > 3.4-SNAPSHOT (via help:effective-pom).
>> >
>> > I'm a little bit confused now.
>> >
>> > Can someone point me at some examples that actually marry up to a
>> > stable version?
>> >
>> > thanks muchly
>> >
>> > Caoilte
>>
>>
>>  ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>>
>
>
>

Reply via email to