• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

integration test via AbstractTransactionalDataSourceSpringContextTests

 
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I would like to use extend AbstractTransactionalDataSourceSpringContextTests or something else to not need delete rows temporary created during integration tests. I afraid I have a problem with transactions of test methods. First I am newbie, I have wroted a test method which checks concrete implementation of generics dao. It is common crud functionality. In the test method :

Note: Before test running there is no row in the database.



If I run the content of the test method in the main method (without asserts) then all works fine, it saves into database.
In the meantime I have solved this problem that I extend AbstractDependencyInjectionSpringContextTests and delete each row via hibernateTemplate. But this solution doesn't make sense. Why do I make something what can do a transaction.

Please, could anyone explain this behavior or where can I make mistake ? I have tried so much version of code that I am desperate from it.
I will very happy for your help.



--------------------------------------------------------------------------------
Before test running or running main I get this exception. It appears that there isn't any relationship with the behavior see above. But as I have written I am newbie.
It throws an exception which it appears it hasn't any influence to test.
reply
    Bookmark Topic Watch Topic
  • New Topic