I\'m running a simple JUnit test agains an application DAO. The problem is that I always get:
javax.persistence.RollbackException: Transaction marked as roll
It is strange to desire a test that changes your database and keep the modification. Tests are supposed to be orthogonal : no test depends on an other. Moreover, tests are supposed to be independent of tests order, and even idempotent.
So either you want to change you data base in your setUp()
method and rollback the change in your tearDown()
method, either you want to setup a test database with some good values in it for tests.
Maybe I am missing something here but usually you should not want that.