2 Replies Latest reply on Mar 22, 2011 7:51 AM by Ronny Fraunhofer

    tests and transactions

    Ronny Fraunhofer Newbie



      i'm using Arquillian to run integrationtests inside a JBoss AS.

      All my tests are running IN_CONTAINER. Does the test creates his own transaction?

      I'm asking this, because i'm creating a lot of test data inside my test. The test data will be persisted inside an database (no hypersonic db, so it will be physically persisted).

      At the end of the test i have to manually clean up all my test data. But what happens if the tests fails? Now I have to do the cleanup inside a finally-block.

      Perhaps it would be easier, if the tests opens an transaction and at the end of the test the transaction gets rolled back, so that all my test data is automatically deleted.


      So, does the test spans an transaction and if not, could this be possible to my make testing a little bit easier?