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”.

Author: Robert Watkins

My name is Robert Watkins. I am a software developer and have been for over 20 years now. I currently work for people, but my opinions here are in no way endorsed by them (which is cool; their opinions aren’t endorsed by me either). My main professional interests are in Java development, using Agile methods, with a historical focus on building web based applications. I’m also a Mac-fan and love my iPhone, which I’m currently learning how to code for. I live and work in Brisbane, Australia, but I grew up in the Northern Territory, and still find Brisbane too cold (after 22 years here). I’m married, with two children and one cat. My politics are socialist in tendency, my religious affiliation is atheist (aka “none of the above”), my attitude is condescending and my moral standing is lying down.

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

    1. 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.

Leave a Reply

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

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

Facebook photo

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

Connecting to %s

%d bloggers like this: