Hi Liz,
answering you question regarding to the SprinWorld, I really like the idea!
During the project I was wondering for a solution that could turn out the
spring container available throughout the stories, and I haven't thought
about an extension to the World class.
My solution was a bit different but I also have one spring container per
stories execution. My app is an API using REST as interface for its clients
and it only returns XML, so it doesn't have any javascript or page
verification.
So what I'm doing is, before I run the stories, I'm starting up an embedded
Jetty server, which loads my Spring container (creating an in memory HSQLDB,
for independency), then I execute all the stories, and after that I stop the
server.
The solution is good but I will take a look at the SpringWorld idea.
Now related to your lower-level tests for database interaction, I don't know
if I got your idea, but I think you wanna test if your Hibernate mapping is
done rightly, is it? Would you mind send me a piece of this code? Currently
I don't write tests to verify Hibernate, instead I prefer to write
acceptance tests, but I'd like to see what are you doing.
Cheers,
On 6/12/07, Elizabeth Keogh <[EMAIL PROTECTED]> wrote:
"Alexandre Martins" <[EMAIL PROTECTED]> wrote on 11/06/2007 22:58:35:
> Hi everybody,
> in one of my projects that I use JBehave I had to find a way to write
> integration tests,
> so I decided to make it using an in memory database, created through
> Spring configuration.
> I wanted to integrate it with JBehave, in a way that, for each
> behaviour, the container should be assembled first,
> so that I could use any of its beans. For example:
>
> public class FooBehaviour() extends UsingSpringContext {
Hi Alex,
It's great that you're mixing Spring and JBehave; I've tried to do that
here but my understanding of Spring is limited (and limiting); please
correct or question if what I'm saying doesn't make sense.
Here we also have lower-level tests for database interaction. We have
described how Hibernate and our domain objects should interact, to help us
design our Hibernate configurations and check that they're correct (and they
do feel more like tests than descriptions of behaviour, to be honest,
probably because we're just checking our understanding of Hibernate's
magic). So maybe a UsingSpringContext would be useful. Can anyone with more
experience help decide?
What I would really like to see is something like a SpringWorld, which
lets us use Spring at a Story level. I think I would use that much more than
at a unit level, since we don't really need the full application context
just to set up a database. Are you using the Story framework with Spring at
all?
Cheers,
Liz.
--
Elizabeth Keogh
[EMAIL PROTECTED]
http://sirenian.livejournal.com
http://jbehave.org
--
______________________
Alexandre Martins Nunes
http://m.artins.net