Just an update, the quick hack failed completely when testing on an XP
system, but it worked perfectly on Ubuntu.

Any links or example on getting Spring/Hibernate/WicketTester/JUnit4 to work
will be appreciated. "lmgtfy" will also suffice ;)

On Tue, Feb 16, 2010 at 9:57 AM, Leon Nieuwoudt <[email protected]>wrote:

> 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 <[email protected]>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