Hi Igor

Glad to hear there's another way.

I'm already using the Spring JUnit runner, like this:

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
public class UserTest extends ..... {

    @Test
    public void testCRUD() {
       // Code...
    }
}

This what I tried:

* Adding @Transactional over testCRUD() out of desperation

* Subclassing the base tester from
AbstractTransactionalDataSourceSpringContextTests, according to the docs
this will automatically begin a transaction and rollback. It also looks like
it's for JUnit 3.x.

The above didn't work though, so I tried the attach()/detach() route to
emulate OSIV which worked fine. I therefore assume I'm missing something.

On Tue, Feb 16, 2010 at 9:18 AM, Igor Vaynberg <igor.vaynb...@gmail.com>wrote:

> all you have to do is start a transaction before each unit test and
> roll it back after. spring has base unit tests and test runners that
> do this for you...
>
>

Reply via email to