AIL – JBehave Trader Example, standalone.

JBehave comes with some very comprehensive examples, so I thought I’d start there to see if I could get one of them building – and reporting – under Maven. The example I chose was the ‘trader‘ example, which you can see at github.

I chose the trader example because it’s the base example for most of the others that they have, so it seemed a logical beginning point. So, the first thing I did was exported it into my spike repo.

(These links are links to the state of the repository at the commit mentioned, BTW)

Well, it didn’t run, and I didn’t expect it to. The examples in jbehave run as part of their build, and I wanted something standalone. To achieve that, I needed to do the following:

At this point, I could run the build and produce reports. But the HTML reports had references to static resources (little things – like CSS, images, and Javascript) that made them useless with out it. So I brought in some more things from the old parent:

The build now produces pretty reports! And there was much rejoicing!

You can see the whole thing under the ‘maven_reports_showing’ tag.

Actually, no there wasn’t any rejoicing. This isn’t anywhere near satisfactory to me. Some of it is just my usual gripes with Maven and its verbosity, and can be solved through better use of parent POMs to provide defaults (for example – the plugin configuration can be pulled into a parent, as could the view resource dependencies, which can be dependencies of the plugin instead of the project – possibly). But the biggest problem I’ve got with this is that the stories – and their supporting code – are in the prod code section. That’s going to have to change.

However, all of that is part of a different adventure – this one ends here, having achieved the minimal goal of “run and report under Maven”.

About these ads

3 thoughts on “AIL – JBehave Trader Example, standalone.

  1. Pingback: AiL – Simplest JBehave Scenario | Software is too expensive to build cheaply….

    1. Robert Watkins Post author

      Thank you. I am continuing the series, but the next example (using Spring) is a little more complicated and my time has been somewhat constrained lately.

      Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s