users@jersey.java.net

Spring, transaction and Jersey test framework

From: Leo Geoffroy <leo.geoffroy_at_gmail.com>
Date: Wed, 20 Oct 2010 15:59:00 +0200

Hello,
I'm using the jersey-test-framework to test my Jersey Webservice.
I launch my unit tests with JUNIT4 using the spring annotations
@Transactional and @TransactionConfiguration(defaultRollback = true) to
avoid putting unused test data into database.
Apparently, these annotations are not taken into account by my
GrizzlyWebTestContainer because data processed in my webservice is inserted
in my database and not removed afterward.
It sounds like it is a context problem : Grizzly Webapp and JUnit test are
not using the same context, and then are working in differents transactions.

Have you ever faced this problem? Any solution?
Thanks in advance,
Leo