Tuesday, April 18, 2006

Still loving the AbstractTransactionalDataSource- SpringContextTests

written by Daniel Rijkhof

If you are using junit testing and a spring context, you surely have the performance problem of loading the context every time you run a single test. Reusing the context would enormously improve the performance. The next thing you'll find irritating is modifying the persistent data. Having a transaction for every test and rolling back after every run would solve this.

So after thinking about these solutions, you obviously google if someone else already made this possible.
You'll find the AbstractTransactionalDataSourceSpringContextTests class from the org.springframework.test package. It does precisely what i was looking for.

We are using it since the moment we found it, and we still love it. You'll find the class in the spring-mock.jar.

Read more about it here

1 comment:

missMW said...

okay seems interesting... just way too hard to understand for a bored person like me lol(A)

btw I think I should get brownie points for leaving your first comment hehe =D