You are right Mike. My problem was that as per instructions in the tutorial I
was creating the user in onSetUpBeforeTransaction() but did not have
corresponding onTearDownAfterTransaction() to remove the test user.
Thanks,
Arvinder
Michael Horwitz wrote:
>
> The test cases normall extend
> Abstr
The test cases normall extend
AbstractTransactionalDataSourceSpringContextTests from the Spring framework
(you may need to look one or two steps down the class hierarchy to see
this). By default all transactions are rolled back when the tests complete,
so the record will still be in the database.
Thanks Matt that explains the nice clean up, But if I am running only one
test,testRemove() in IDEA, should it not remove the record from the
database.
My test passes but the record is still there when I check the db
Arvinder
arvinder wrote:
>
> I am trying to run PersonActionTests from IDEA. I
This happens because dbunit is set to run twice in your pom.xml - once
before tests are run and once after they're completed:
test-compile
test-compile
operation
I am trying to run PersonActionTests from IDEA. If I run testRemove the
setupBeforeTransaction inserts a record in database, the testRemove()
successfully passes but I still have the record in the database.
If I execute all the tests, all tests pass but the records created during
tests are still