Speed up Integration Test Suite

I'm trying to speed up running my integration test suite. For every integration test class I have, it recreates the whole in-memory H2 database from scratch before running the tests - which takes up the most time. All methods I'm testing are within a Spring/Hibernate stack.

Is there a way to avoid recreating the db for each test while ensuring the db is in a clean state?

Some methods I'm testing call methods that start new Hibernate transactions - so not sure if it's possible to begin a new transaction before each test and roll everything back after.

Answers


That is the default behavior (rollback) when using @Transactional with @RunWith(SpringJunit4TestRunner.class).

See the Integration Testing Chapter for complete information.


Need Your Help

Sencha Touch 2.3: Remove validations from hidden form fields

extjs sencha-touch sencha-touch-2

I am doing form validations in Sencha Touch 2.3. My model looks like following.

Download a torrent with php

php download bittorrent

I want to download a torrent using php.